]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug #2240 fix: AsyncCall-related unit tests fail
authorrousskov <>
Tue, 26 Feb 2008 07:22:07 +0000 (07:22 +0000)
committerrousskov <>
Tue, 26 Feb 2008 07:22:07 +0000 (07:22 +0000)
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.

src/tests/testEventLoop.cc
src/tests/testEventLoop.h

index edbfd81c5dba856170b909ddd27b57c6d59eac59..9133604a47ca9b0aa7b367309232f6bc6c1ed824 100644 (file)
@@ -2,7 +2,7 @@
 #include <cppunit/TestAssert.h>
 
 #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.
  */
index 658281337efb388c53984e824ee342032f505c57..c06bda5be36637f6a1509cf1fe6a2fcf20e3d551 100644 (file)
@@ -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