]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Compile errors in auto-testing.
authorAmos Jeffries <squid3@treenet.co.nz>
Fri, 21 Mar 2008 09:45:33 +0000 (21:45 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 21 Mar 2008 09:45:33 +0000 (21:45 +1200)
Also some auto-documentation.

src/EventLoop.cc
src/EventLoop.h
src/tests/stub_HttpReply.cc
src/tests/testEventLoop.cc

index dc45f68d8d12099e8b6f48547a1619d6a990e84f..39c18c2e758d3701ef5a9f3fea3e332de99c49ca 100644 (file)
@@ -103,7 +103,7 @@ EventLoop::runOnce()
     bool sawActivity = false;
     runOnceResult = true;
     error = false;
-    loop_delay = 1000; /* 1s default delay */
+    loop_delay = EVENT_LOOP_TIMEOUT;
 
     AsyncEngine *waitingEngine = primaryEngine;
     if (!waitingEngine && !engines.empty())
index 1262295be2b0a95767aed425e7274458f5557ee6..5b3adc99c7cb9b1ea1f8ae1187c3028e3734881f 100644 (file)
@@ -1,4 +1,3 @@
-
 /*
  * $Id: EventLoop.h,v 1.4 2008/02/12 23:49:44 rousskov Exp $
  *
 #include "AsyncEngine.h"
 #include "SquidTime.h"
 
-/* An event loop. An event loop is the core inner loop of squid.
+#define EVENT_LOOP_TIMEOUT     1000 /* 1s timeout */
+
+/** An event loop. An event loop is the core inner loop of squid.
  * The event loop can be run until exit, or once. After it finishes control
  * returns to the caller. If desired it can be run again.
- *
+ \par
  * The event loop cannot be run once it is running until it has finished.
  */
-
 class EventLoop
 {
 
 public:
     EventLoop();
-    /* register an async engine which will be given the opportunity to perform
+
+    /** register an async engine which will be given the opportunity to perform
      * in-main-thread tasks each event loop.
      */
     void registerEngine(AsyncEngine *engine);
-    /* start the event loop running. The loop will run until it is stopped by
+
+    /** start the event loop running. The loop will run until it is stopped by
      * calling stop(), or when the loop is completely idle - nothing 
      * dispatched in a loop, and all engines idle.
      */
     void run();
-    /* run the loop once. This may not complete all events! It should therefor
+
+    /** run the loop once. This may not complete all events! It should therefor
      * be used with care.
      * TODO: signal in runOnce whether or not the loop is over - IDLE vs OK vs
      * TIMEOUT?
      */
     bool runOnce();
-    /* set the primary async engine. The primary async engine recieves the
+
+    /** set the primary async engine. The primary async engine recieves the
      * lowest requested timeout gathered from the other engines each loop.
      * (There is a default of 10ms if all engines are idle or request higher
      * delays).
@@ -74,11 +78,13 @@ public:
      * implicitly the default.
      */
     void setPrimaryEngine(AsyncEngine * engine);
-    /* set the time service. There can be only one time service set at any
+
+    /** set the time service. There can be only one time service set at any
      * time. The time service is invoked on each loop 
      */
     void setTimeService(TimeEngine *engine);
-    /* stop the event loop - it will finish the current loop and then return to the
+
+    /** stop the event loop - it will finish the current loop and then return to the
      * caller of run().
      */
     void stop();
@@ -86,11 +92,13 @@ public:
     int errcount;
 
 private:
-    /* setup state variables prior to running */
+    /** setup state variables prior to running */
     void prepareToRun();
-    /* check an individual engine */
+
+    /** check an individual engine */
     void checkEngine(AsyncEngine * engine, bool const primary);
-    /* dispatch calls and events scheduled during checkEngine() */
+
+    /** dispatch calls and events scheduled during checkEngine() */
     bool dispatchCalls();
 
     bool last_loop;
@@ -98,9 +106,9 @@ private:
     engine_vector engines;
     TimeEngine * timeService;
     AsyncEngine * primaryEngine;
-    int loop_delay; /* the delay to be given to the primary engine */
-    bool error; /* has an error occured in this loop */
-    bool runOnceResult; /* the result from runOnce */
+    int loop_delay; /**< the delay to be given to the primary engine */
+    bool error; /**< has an error occured in this loop */
+    bool runOnceResult; /**< the result from runOnce */
 };
 
 
index 94ba11599aefebbb3f42152076dc807febb67dac..51b8a2db2aef775e384f5bcdf3a7a73c0e269826 100644 (file)
@@ -45,12 +45,6 @@ HttpReply::~HttpReply()
     fatal ("Not implemented.");
 }
 
-void
-HttpReply::absorb(HttpReply * new_rep)
-{
-    fatal ("Not implemented");
-}
-
 void
 HttpReply::setHeaders(HttpVersion ver, http_status status, const char *reason,
                       const char *ctype, int64_t clen, time_t lmt, time_t expires)
index 06fbd444efe9b78d39f2cae967db4ce4a630fd79..dc16ab888961c1fea97f602d92d99cdb1493a86a 100644 (file)
@@ -278,7 +278,7 @@ testEventLoop::testSetPrimaryEngine()
     /* one engine - gets a timeout */
     theLoop.registerEngine(&first_engine);
     theLoop.runOnce();
-    CPPUNIT_ASSERT_EQUAL(10, first_engine.lasttimeout);
+    CPPUNIT_ASSERT_EQUAL(EVENT_LOOP_TIMEOUT, first_engine.lasttimeout);
     /* two engines - the second gets the timeout */
     theLoop.registerEngine(&second_engine);
     theLoop.runOnce();
@@ -289,5 +289,4 @@ testEventLoop::testSetPrimaryEngine()
     theLoop.runOnce();
     CPPUNIT_ASSERT_EQUAL(10, first_engine.lasttimeout);
     CPPUNIT_ASSERT_EQUAL(0, second_engine.lasttimeout);
-
 }