1 //------------------------------------------------------------------------------
4 //------------------------------------------------------------------------------
6 // Standard Includes -----------------------------------------------------------
8 // System Includes -------------------------------------------------------------
10 // Project Includes ------------------------------------------------------------
12 // Local Includes --------------------------------------------------------------
13 #include "IsWatchedTest.h"
15 // Local Defines ---------------------------------------------------------------
17 // Globals ---------------------------------------------------------------------
19 //------------------------------------------------------------------------------
22 @case No added watchers
23 @results Returns false
25 void TIsWatchedTest::IsWatched1()
27 CPPUNIT_ASSERT(!fHandler
.IsWatched());
29 //------------------------------------------------------------------------------
32 @case Add then remove watcher
33 @results Returns true after add, returns false after remove
34 @note Original implementation fails this test. Either the removal
35 doesn't happen (unlikely) or some list-within-a-list doesn't
36 get removed when there's nothing in it anymore.
38 void TIsWatchedTest::IsWatched2()
41 fHandler
.StartWatching(&Watcher
, '1234');
42 CPPUNIT_ASSERT(fHandler
.IsWatched() == true);
44 fHandler
.StopWatching(&Watcher
, '1234');
46 CPPUNIT_ASSERT(fHandler
.IsWatched() == false);
49 //------------------------------------------------------------------------------
50 Test
* TIsWatchedTest::Suite()
52 TestSuite
* SuiteOfTests
= new TestSuite("BHandler::IsWatched");
54 ADD_TEST4(BHandler
, SuiteOfTests
, TIsWatchedTest
, IsWatched1
);
55 ADD_TEST4(BHandler
, SuiteOfTests
, TIsWatchedTest
, IsWatched2
);
59 //------------------------------------------------------------------------------