]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/tests/testCacheManager.cc
2 #include <cppunit/TestAssert.h>
5 #include "testCacheManager.h"
6 #include "CacheManager.h"
9 CPPUNIT_TEST_SUITE_REGISTRATION( testCacheManager
);
11 /* stub functions to link successfully */
22 /* init memory pools */
24 void testCacheManager::setUp()
30 * Test creating a CacheManager
33 testCacheManager::testCreate()
38 /* an action to register */
40 dummy_action(StoreEntry
* sentry
)
44 * registering an action makes it findable.
47 testCacheManager::testRegister()
50 manager
.registerAction("sample", "my sample", &dummy_action
, false, false);
51 CacheManagerAction
*anAction
= manager
.findAction("sample");
52 CPPUNIT_ASSERT_EQUAL(String("sample"), String(anAction
->action
));
53 CPPUNIT_ASSERT_EQUAL(String("my sample"), String(anAction
->desc
));
54 CPPUNIT_ASSERT_EQUAL(&dummy_action
, anAction
->handler
);
55 CPPUNIT_ASSERT_EQUAL(0, (int)anAction
->flags
.pw_req
);
56 CPPUNIT_ASSERT_EQUAL(0, (int)anAction
->flags
.atomic
);