Changes in src/unittests/ObserverTest.cpp [317df8:5e5283]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/unittests/ObserverTest.cpp ¶
r317df8 r5e5283 17 17 18 18 using namespace std; 19 20 #ifdef HAVE_TESTRUNNER 21 #include "UnitTestMain.hpp" 22 #endif /*HAVE_TESTRUNNER*/ 19 23 20 24 // Registers the fixture into the 'registry' … … 40 44 void changeMethod() { 41 45 OBSERVE; 42 int i ;46 int i = 0; 43 47 i++; 44 48 } … … 49 53 void changeMethod1() { 50 54 OBSERVE; 51 int i ;55 int i = 0; 52 56 i++; 53 57 } … … 55 59 void changeMethod2() { 56 60 OBSERVE; 57 int i ;61 int i = 0; 58 62 i++; 59 63 changeMethod1(); … … 72 76 void changeMethod() { 73 77 OBSERVE; 74 int i ;78 int i = 0; 75 79 i++; 76 80 subObservable->changeMethod(); … … 110 114 simpleObservable1->signOn(observer2); 111 115 simpleObservable1->signOn(observer3); 116 112 117 simpleObservable2->signOn(observer2); 113 118 simpleObservable2->signOn(observer4); … … 181 186 CPPUNIT_ASSERT(true); 182 187 } 183 184 /********************************************** Main routine **************************************/185 186 int main(int argc, char **argv)187 {188 // Get the top level suite from the registry189 CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();190 191 // Adds the test to the list of test to run192 CppUnit::TextUi::TestRunner runner;193 runner.addTest( suite );194 195 // Change the default outputter to a compiler error format outputter196 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.