]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/tests/testUfs.cc
SourceFormat Enforcement
[thirdparty/squid.git] / src / tests / testUfs.cc
index e850076c1e5b7da28ce405a8ca6b72aa4ae43832..a21ee007be86cb1d0e181a855bacbb397c36583b 100644 (file)
@@ -1,12 +1,17 @@
-#define SQUID_UNIT_TEST 1
-#include "squid.h"
+/*
+ * Copyright (C) 1996-2015 The Squid Software Foundation and contributors
+ *
+ * Squid software is distributed under GPLv2+ license and includes
+ * contributions from numerous individuals and organizations.
+ * Please see the COPYING and CONTRIBUTORS files for details.
+ */
 
+#include "squid.h"
 #include "DiskIO/DiskIOModule.h"
 #include "fs/ufs/UFSSwapDir.h"
 #include "globals.h"
 #include "HttpHeader.h"
 #include "HttpReply.h"
-#include "Mem.h"
 #include "MemObject.h"
 #include "RequestFlags.h"
 #include "SquidConfig.h"
@@ -14,6 +19,7 @@
 #include "SwapDir.h"
 #include "testStoreSupport.h"
 #include "testUfs.h"
+#include "unitTestMain.h"
 
 #include <stdexcept>
 
@@ -22,7 +28,7 @@
 CPPUNIT_TEST_SUITE_REGISTRATION( testUfs );
 
 typedef RefCount<Fs::Ufs::UFSSwapDir> SwapDirPointer;
-extern REMOVALPOLICYCREATE createRemovalPolicy_lru;    /* XXX fails with --enable-removal-policies=heap */
+extern REMOVALPOLICYCREATE createRemovalPolicy_lru; /* XXX fails with --enable-removal-policies=heap */
 
 static void
 addSwapDir(SwapDirPointer aStore)
@@ -66,9 +72,9 @@ testUfs::commonInit()
 
     comm_init();
 
-    httpHeaderInitModule();    /* must go before any header processing (e.g. the one in errorInitialize) */
+    httpHeaderInitModule(); /* must go before any header processing (e.g. the one in errorInitialize) */
 
-    httpReplyInitModule();     /* must go before accepting replies */
+    httpReplyInitModule();  /* must go before accepting replies */
 
     inited = true;
 }
@@ -140,7 +146,7 @@ testUfs::testUfsSearch()
         RequestFlags flags;
         flags.cachable = true;
         StoreEntry *pe = storeCreateEntry("dummy url", "dummy log url", flags, Http::METHOD_GET);
-        HttpReply *rep = (HttpReply *) pe->getReply(); // bypass const
+        HttpReply *rep = (HttpReply *) pe->getReply();  // bypass const
         rep->setHeaders(Http::scOkay, "dummy test object", "x-squid-internal/test", 0, -1, squid_curtime + 100000);
 
         pe->setPublicKey();
@@ -254,3 +260,4 @@ testUfs::testUfsDefaultEngine()
     if (0 > system ("rm -rf " TESTDIR))
         throw std::runtime_error("Failed to clean test work directory");
 }
+