1 //------------------------------------------------------------------------------
4 //------------------------------------------------------------------------------
6 // Standard Includes -----------------------------------------------------------
8 // System Includes -------------------------------------------------------------
11 // Project Includes ------------------------------------------------------------
13 // Local Includes --------------------------------------------------------------
14 #include "HandlerLooperTest.h"
16 // Local Defines ---------------------------------------------------------------
18 // Globals ---------------------------------------------------------------------
20 //------------------------------------------------------------------------------
23 @case Not added to a BLooper
26 void TLooperTest::LooperTest1()
28 CPPUNIT_ASSERT(fHandler
.Looper() == NULL
);
30 //------------------------------------------------------------------------------
33 @case Add to a BLooper, then remove
34 @results Returns the added-to BLooper; when removed, returns NULL
36 void TLooperTest::LooperTest2()
39 Looper
.AddHandler(&fHandler
);
40 CPPUNIT_ASSERT(fHandler
.Looper() == &Looper
);
42 CPPUNIT_ASSERT(Looper
.RemoveHandler(&fHandler
));
43 CPPUNIT_ASSERT(fHandler
.Looper() == NULL
);
45 //------------------------------------------------------------------------------
46 Test
* TLooperTest::Suite()
48 TestSuite
* SuiteOfTests
= new TestSuite("BHandler::Looper");
50 ADD_TEST4(BHandler
, SuiteOfTests
, TLooperTest
, LooperTest1
);
51 ADD_TEST4(BHandler
, SuiteOfTests
, TLooperTest
, LooperTest2
);
55 //------------------------------------------------------------------------------