- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/unittests/manipulateAtomsTest.cpp
r46d958 r57adc7 34 34 {} 35 35 36 virtual int getId(){36 virtual atomId_t getId(){ 37 37 return id; 38 38 } … … 44 44 bool manipulated; 45 45 private: 46 int id;46 atomId_t id; 47 47 }; 48 48 … … 78 78 79 79 // some helper functions 80 bool hasAll(std::vector<atom*> atoms,int min, int max, std::set<int> excluded = std::set<int>()){80 static bool hasAll(std::vector<atom*> atoms,int min, int max, std::set<int> excluded = std::set<int>()){ 81 81 for(int i=min;i<max;++i){ 82 82 if(!excluded.count(i)){ … … 95 95 } 96 96 97 bool hasNoDuplicates(std::vector<atom*> atoms){97 static bool hasNoDuplicates(std::vector<atom*> atoms){ 98 98 std::set<int> found; 99 99 std::vector<atom*>::iterator iter; … … 107 107 } 108 108 109 void operation(atom* _atom){109 static void operation(atom* _atom){ 110 110 AtomStub *atom = dynamic_cast<AtomStub*>(_atom); 111 111 assert(atom); … … 153 153 delete obs; 154 154 } 155 156 /********************************************** Main routine **************************************/157 158 int main(int argc, char **argv)159 {160 // Get the top level suite from the registry161 CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();162 163 // Adds the test to the list of test to run164 CppUnit::TextUi::TestRunner runner;165 runner.addTest( suite );166 167 // Change the default outputter to a compiler error format outputter168 runner.setOutputter( new CppUnit::CompilerOutputter( &runner.result(),169 std::cerr ) );170 // Run the tests.171 bool wasSucessful = runner.run();172 173 // Return error code 1 if the one of test failed.174 return wasSucessful ? 0 : 1;175 };
Note:
See TracChangeset
for help on using the changeset viewer.