Changes in / [a356f2:0d1ad0]
- Location:
- src
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Descriptors/AtomDescriptor.cpp
ra356f2 r0d1ad0 12 12 13 13 #include "World.hpp" 14 15 14 #include "atom.hpp" 16 15 17 16 #include <boost/bind.hpp> 18 #include <cassert> 17 19 18 #include <iostream> 20 19 -
src/Descriptors/MoleculeDescriptor.cpp
ra356f2 r0d1ad0 16 16 17 17 #include <boost/bind.hpp> 18 #include <cassert>19 18 #include <iostream> 20 19 -
src/Helpers/MemDebug.cpp
ra356f2 r0d1ad0 6 6 */ 7 7 8 #ifndef ND BEGUG8 #ifndef NDEBUG 9 9 #ifndef NO_MEMDEBUG 10 10 -
src/Patterns/Singleton.hpp
ra356f2 r0d1ad0 9 9 #define SINGLETON_HPP_ 10 10 11 #include <cassert>12 11 #include <boost/thread.hpp> 13 12 13 #include "Helpers/Assert.hpp" 14 14 #include "defs.hpp" 15 15 … … 181 181 182 182 inline static void set(creator_T*&,creator_T*){ 183 assert(0 &&"Cannot set the Instance for a singleton of this type");183 ASSERT(0, "Cannot set the Instance for a singleton of this type"); 184 184 } 185 185 }; … … 191 191 struct creator_t<creator_T,false>{ 192 192 inline static creator_T* make(){ 193 assert(0 && "Cannot create a singleton of this type directly"); 193 ASSERT(0, "Cannot create a singleton of this type directly"); 194 return 0; 194 195 } 195 196 inline static void set(ptr_t& dest,creator_T* src){ -
src/Patterns/Singleton_impl.hpp
ra356f2 r0d1ad0 72 72 template <class T,bool _may_create> 73 73 void Singleton<T,_may_create>::setInstance(T* newInstance){ 74 assert(!theInstance.get() &&"Trying to set the instance of an already created singleton");74 ASSERT(!theInstance.get(), "Trying to set the instance of an already created singleton"); 75 75 boost::recursive_mutex::scoped_lock guard(instanceLock); 76 76 theInstance.reset(newInstance); … … 83 83 template <class T, bool _may_create> 84 84 Singleton<T,_may_create>::Singleton(const Singleton<T,_may_create>&){ 85 assert(0 &&"Copy constructor of singleton template called");85 ASSERT(0, "Copy constructor of singleton template called"); 86 86 } 87 87 -
src/UIElements/Dialog.cpp
ra356f2 r0d1ad0 7 7 8 8 #include "Helpers/MemDebug.hpp" 9 10 #include <cassert>11 9 12 10 #include "Dialog.hpp" -
src/World.cpp
ra356f2 r0d1ad0 21 21 #include "Descriptors/SelectiveIterator_impl.hpp" 22 22 #include "Actions/ManipulateAtomsProcess.hpp" 23 #include "Helpers/Assert.hpp" 23 24 24 25 #include "Patterns/Singleton_impl.hpp" … … 112 113 molecule *mol = NULL; 113 114 mol = NewMolecule(); 114 cout << "Creating molecule with id " << currMoleculeId << "." << endl; 115 assert(!molecules.count(currMoleculeId)); 115 ASSERT(!molecules.count(currMoleculeId),"currMoleculeId did not specify an unused ID"); 116 116 mol->setId(currMoleculeId++); 117 117 // store the molecule by ID … … 129 129 OBSERVE; 130 130 molecule *mol = molecules[id]; 131 assert(mol);131 ASSERT(mol,"Molecule id that was meant to be destroyed did not exist"); 132 132 DeleteMolecule(mol); 133 133 molecules.erase(id); … … 165 165 OBSERVE; 166 166 atom *atom = atoms[id]; 167 assert(atom);167 ASSERT(atom,"Atom ID that was meant to be destroyed did not exist"); 168 168 DeleteAtom(atom); 169 169 atoms.erase(id); … … 177 177 if(!target){ 178 178 target = atoms[oldId]; 179 assert(target &&"Atom with that ID not found");179 ASSERT(target,"Atom with that ID not found"); 180 180 return target->changeId(newId); 181 181 } -
src/molecule.cpp
ra356f2 r0d1ad0 155 155 molecule::const_iterator molecule::erase( atom * key ) 156 156 { 157 cout << "trying to erase atom" << endl;158 157 molecule::const_iterator iter = find(key); 159 158 if (iter != end()){ -
src/tesselation.cpp
ra356f2 r0d1ad0 9 9 10 10 #include <fstream> 11 #include <assert.h>12 11 13 12 #include "helpers.hpp" … … 24 23 #include "Plane.hpp" 25 24 #include "Exceptions/LinearDependenceException.hpp" 26 #include "Helpers/Assert.hpp"27 28 25 #include "Helpers/Assert.hpp" 29 26 … … 2527 2524 baseline = Runner->second; 2528 2525 if (baseline->pointlist.empty()) { 2529 assert((baseline->BaseLine->triangles.size() == 1) && ("Open line without exactly one attached triangle"));2526 ASSERT((baseline->BaseLine->triangles.size() == 1),"Open line without exactly one attached triangle"); 2530 2527 T = (((baseline->BaseLine->triangles.begin()))->second); 2531 2528 DoLog(1) && (Log() << Verbose(1) << "Finding best candidate for open line " << *baseline->BaseLine << " of triangle " << *T << endl); -
src/unittests/Makefile.am
ra356f2 r0d1ad0 211 211 212 212 SingletonTest_SOURCES = UnitTestMain.cpp SingletonTest.cpp SingletonTest.hpp 213 SingletonTest_LDADD = $ (BOOST_LIB) ${BOOST_THREAD_LIB}213 SingletonTest_LDADD = ${ALLLIBS} $(BOOST_LIB) ${BOOST_THREAD_LIB} 214 214 215 215 StackClassUnitTest_SOURCES = UnitTestMain.cpp stackclassunittest.cpp stackclassunittest.hpp -
src/unittests/ObserverTest.cpp
ra356f2 r0d1ad0 382 382 // make this Observable its own subject. NEVER DO THIS IN ACTUAL CODE 383 383 simpleObservable1->signOn(simpleObservable1); 384 #ifndef NDEBUG 384 385 CPPUNIT_ASSERT_THROW(simpleObservable1->changeMethod(),Assert::AssertionFailure); 386 #else 387 simpleObservable1->changeMethod(); 388 #endif 385 389 386 390 // more complex test … … 388 392 simpleObservable1->signOn(simpleObservable2); 389 393 simpleObservable2->signOn(simpleObservable1); 394 #ifndef NDEBUG 390 395 CPPUNIT_ASSERT_THROW(simpleObservable1->changeMethod(),Assert::AssertionFailure); 396 #else 397 simpleObservable1->changeMethod(); 398 #endif 399 400 391 401 simpleObservable1->signOff(simpleObservable2); 392 402 simpleObservable2->signOff(simpleObservable1); -
src/unittests/manipulateAtomsTest.cpp
ra356f2 r0d1ad0 87 87 static void operation(atom* _atom){ 88 88 AtomStub *atom = dynamic_cast<AtomStub*>(_atom); 89 assert(atom);89 CPPUNIT_ASSERT(atom); 90 90 atom->doSomething(); 91 91 } … … 100 100 AtomStub *atom; 101 101 atom = dynamic_cast<AtomStub*>(*iter); 102 assert(atom);102 CPPUNIT_ASSERT(atom); 103 103 CPPUNIT_ASSERT(atom->manipulated); 104 104 } … … 114 114 AtomStub *atom; 115 115 atom = dynamic_cast<AtomStub*>(*iter); 116 assert(atom);116 CPPUNIT_ASSERT(atom); 117 117 if(atom->getId()!=(int)ATOM_COUNT/2) 118 118 CPPUNIT_ASSERT(atom->manipulated);
Note:
See TracChangeset
for help on using the changeset viewer.