Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified src/unittests/ObserverTest.cpp

    r317df8 r5e5283  
    1717
    1818using namespace std;
     19
     20#ifdef HAVE_TESTRUNNER
     21#include "UnitTestMain.hpp"
     22#endif /*HAVE_TESTRUNNER*/
    1923
    2024// Registers the fixture into the 'registry'
     
    4044  void changeMethod() {
    4145    OBSERVE;
    42     int i;
     46    int i = 0;
    4347    i++;
    4448  }
     
    4953  void changeMethod1() {
    5054    OBSERVE;
    51     int i;
     55    int i = 0;
    5256    i++;
    5357  }
     
    5559  void changeMethod2() {
    5660    OBSERVE;
    57     int i;
     61    int i = 0;
    5862    i++;
    5963    changeMethod1();
     
    7276  void changeMethod() {
    7377    OBSERVE;
    74     int i;
     78    int i = 0;
    7579    i++;
    7680    subObservable->changeMethod();
     
    110114  simpleObservable1->signOn(observer2);
    111115  simpleObservable1->signOn(observer3);
     116
    112117  simpleObservable2->signOn(observer2);
    113118  simpleObservable2->signOn(observer4);
     
    181186  CPPUNIT_ASSERT(true);
    182187}
    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.