Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/unittests/ObserverTest.cpp

    r5e5283 r317df8  
    1818using namespace std;
    1919
    20 #ifdef HAVE_TESTRUNNER
    21 #include "UnitTestMain.hpp"
    22 #endif /*HAVE_TESTRUNNER*/
    23 
    2420// Registers the fixture into the 'registry'
    2521CPPUNIT_TEST_SUITE_REGISTRATION( ObserverTest );
     
    4440  void changeMethod() {
    4541    OBSERVE;
    46     int i = 0;
     42    int i;
    4743    i++;
    4844  }
     
    5349  void changeMethod1() {
    5450    OBSERVE;
    55     int i = 0;
     51    int i;
    5652    i++;
    5753  }
     
    5955  void changeMethod2() {
    6056    OBSERVE;
    61     int i = 0;
     57    int i;
    6258    i++;
    6359    changeMethod1();
     
    7672  void changeMethod() {
    7773    OBSERVE;
    78     int i = 0;
     74    int i;
    7975    i++;
    8076    subObservable->changeMethod();
     
    114110  simpleObservable1->signOn(observer2);
    115111  simpleObservable1->signOn(observer3);
    116 
    117112  simpleObservable2->signOn(observer2);
    118113  simpleObservable2->signOn(observer4);
     
    186181  CPPUNIT_ASSERT(true);
    187182}
     183
     184/********************************************** Main routine **************************************/
     185
     186int 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.