Changes in src/unittests/ObserverTest.cpp [5e5283:317df8]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/unittests/ObserverTest.cpp
r5e5283 r317df8 18 18 using namespace std; 19 19 20 #ifdef HAVE_TESTRUNNER21 #include "UnitTestMain.hpp"22 #endif /*HAVE_TESTRUNNER*/23 24 20 // Registers the fixture into the 'registry' 25 21 CPPUNIT_TEST_SUITE_REGISTRATION( ObserverTest ); … … 44 40 void changeMethod() { 45 41 OBSERVE; 46 int i = 0;42 int i; 47 43 i++; 48 44 } … … 53 49 void changeMethod1() { 54 50 OBSERVE; 55 int i = 0;51 int i; 56 52 i++; 57 53 } … … 59 55 void changeMethod2() { 60 56 OBSERVE; 61 int i = 0;57 int i; 62 58 i++; 63 59 changeMethod1(); … … 76 72 void changeMethod() { 77 73 OBSERVE; 78 int i = 0;74 int i; 79 75 i++; 80 76 subObservable->changeMethod(); … … 114 110 simpleObservable1->signOn(observer2); 115 111 simpleObservable1->signOn(observer3); 116 117 112 simpleObservable2->signOn(observer2); 118 113 simpleObservable2->signOn(observer4); … … 186 181 CPPUNIT_ASSERT(true); 187 182 } 183 184 /********************************************** Main routine **************************************/ 185 186 int main(int argc, char **argv) 187 { 188 // Get the top level suite from the registry 189 CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest(); 190 191 // Adds the test to the list of test to run 192 CppUnit::TextUi::TestRunner runner; 193 runner.addTest( suite ); 194 195 // Change the default outputter to a compiler error format outputter 196 runner.setOutputter( new CppUnit::CompilerOutputter( &runner.result(), 197 std::cerr ) ); 198 // Run the tests. 199 bool wasSucessful = runner.run(); 200 201 // Return error code 1 if the one of test failed. 202 return wasSucessful ? 0 : 1; 203 };
Note:
See TracChangeset
for help on using the changeset viewer.