From: rousskov <> Date: Tue, 26 Feb 2008 07:22:07 +0000 (+0000) Subject: Bug #2240 fix: AsyncCall-related unit tests fail X-Git-Tag: BASIC_TPROXY4~55 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb9b9424b3108307a2e6bd66fecf48b8d1fbc2df;p=thirdparty%2Fsquid.git Bug #2240 fix: AsyncCall-related unit tests fail Removed EventDispatcher references, disabling the following test cases: testRunOnce, testRegisterDispatcher, testRegisterEngine, testEngineTimeout, testStopOnIdle. Eventually, we will add AsyncCallQueue test cases, but EventLoop testing does not have to wait for that. --- diff --git a/src/tests/testEventLoop.cc b/src/tests/testEventLoop.cc index edbfd81c5d..9133604a47 100644 --- a/src/tests/testEventLoop.cc +++ b/src/tests/testEventLoop.cc @@ -2,7 +2,7 @@ #include #include "AsyncEngine.h" -#include "CompletionDispatcher.h" +#include "AsyncCallQueue.h" #include "Mem.h" #include "testEventLoop.h" #include "EventLoop.h" @@ -36,6 +36,7 @@ testEventLoop::testCreate() EventLoop(); } +#if POLISHED_MAIN_LOOP /* * Running the loop once is useful for integration with other loops, such as @@ -62,6 +63,8 @@ public: } }; +#endif /* POLISHED_MAIN_LOOP */ + class RecordingEngine : public AsyncEngine { @@ -81,6 +84,8 @@ public: } }; +#if POLISHED_MAIN_LOOP + void testEventLoop::testRunOnce() { @@ -220,6 +225,8 @@ testEventLoop::testStopOnIdle() CPPUNIT_ASSERT_EQUAL(false, theLoop.runOnce()); } +#endif /* POLISHED_MAIN_LOOP */ + /* An event loop has a time service which is like an async engine but never * generates events and there can only be one such service. */ diff --git a/src/tests/testEventLoop.h b/src/tests/testEventLoop.h index 658281337e..c06bda5be3 100644 --- a/src/tests/testEventLoop.h +++ b/src/tests/testEventLoop.h @@ -12,13 +12,17 @@ class testEventLoop : public CPPUNIT_NS::TestFixture { CPPUNIT_TEST_SUITE( testEventLoop ); CPPUNIT_TEST( testCreate ); + +#if POLISHED_MAIN_LOOP CPPUNIT_TEST( testRunOnce ); CPPUNIT_TEST( testRegisterDispatcher ); CPPUNIT_TEST( testRegisterEngine ); CPPUNIT_TEST( testEngineTimeout ); + CPPUNIT_TEST( testStopOnIdle ); +#endif + CPPUNIT_TEST( testSetTimeService ); CPPUNIT_TEST( testSetPrimaryEngine ); - CPPUNIT_TEST( testStopOnIdle ); CPPUNIT_TEST_SUITE_END(); public: @@ -26,13 +30,17 @@ public: protected: void testCreate(); + +#if POLISHED_MAIN_LOOP void testEngineTimeout(); void testRunOnce(); void testRegisterDispatcher(); void testRegisterEngine(); + void testStopOnIdle(); +#endif + void testSetTimeService(); void testSetPrimaryEngine(); - void testStopOnIdle(); /* TODO: * test that engine which errors a couple of times, then returns 0, then * errors 10 times in a row triggers a fail on the 10th time around