16#include <cppunit/TestAssert.h>
79 CPPUNIT_ASSERT_EQUAL(
true, theLoop.
runOnce());
90 CPPUNIT_ASSERT_EQUAL(
true, theLoop.
runOnce());
91 CPPUNIT_ASSERT_EQUAL(1, engine.
calls);
93 CPPUNIT_ASSERT_EQUAL(2, engine.
calls);
103 CPPUNIT_ASSERT_EQUAL(
false, theLoop.
runOnce());
104 CPPUNIT_ASSERT_EQUAL(1, engine.
calls);
128 CPPUNIT_ASSERT_EQUAL(1, engineOne.
calls);
130 CPPUNIT_ASSERT_EQUAL(1, engineTwo.
calls);
144 CPPUNIT_ASSERT_EQUAL(
false, theLoop.
runOnce());
145 CPPUNIT_ASSERT_EQUAL(1, failing_engine.
calls);
146 CPPUNIT_ASSERT_EQUAL(1, theLoop.
errcount);
149 CPPUNIT_ASSERT_EQUAL(10, theLoop.
errcount);
150 CPPUNIT_ASSERT_EQUAL(11, failing_engine.
calls);
178 CPPUNIT_ASSERT_EQUAL(1, myTime.
calls);
181 CPPUNIT_ASSERT_EQUAL(2, myTime.
calls);
201 CPPUNIT_ASSERT_EQUAL(10, second_engine.
lasttimeout);
205 CPPUNIT_ASSERT_EQUAL(10, first_engine.
lasttimeout);
206 CPPUNIT_ASSERT_EQUAL(0, second_engine.
lasttimeout);
#define EVENT_LOOP_TIMEOUT
void setTimeService(Time::Engine *)
void registerEngine(AsyncEngine *engine)
void setPrimaryEngine(AsyncEngine *engine)
int checkEvents(int timeout) override
RecordingEngine(int aTimeout=0)
CPPUNIT_TEST(testSetPrimaryEngine)
void testSetTimeService()
void testSetPrimaryEngine()
CPPUNIT_TEST(testSetTimeService)
CPPUNIT_TEST(testEngineTimeout)
CPPUNIT_TEST(testEngineErrors)
CPPUNIT_TEST_SUITE(TestEventLoop)
CPPUNIT_TEST(testRunOnce)
implements test program's main() function while enabling customization
int run(int argc, char *argv[])
event class for doing synthetic time etc
CPPUNIT_TEST_SUITE_REGISTRATION(TestEventLoop)