Changes in / [0c5eeb:326bbe]


Ignore:
Location:
src
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • src/Descriptors/AtomDescriptor.cpp

    r0c5eeb r326bbe  
    1212
    1313#include "World.hpp"
     14
    1415#include "atom.hpp"
    1516
    1617#include <boost/bind.hpp>
    17 
     18#include <cassert>
    1819#include <iostream>
    1920
  • src/Descriptors/MoleculeDescriptor.cpp

    r0c5eeb r326bbe  
    1616
    1717#include <boost/bind.hpp>
     18#include <cassert>
    1819#include <iostream>
    1920
  • src/Helpers/MemDebug.cpp

    r0c5eeb r326bbe  
    66 */
    77
    8 #ifndef NDEBUG
     8#ifndef NDBEGUG
    99#ifndef NO_MEMDEBUG
    1010
  • src/Patterns/Singleton.hpp

    r0c5eeb r326bbe  
    99#define SINGLETON_HPP_
    1010
     11#include <cassert>
    1112#include <boost/thread.hpp>
    1213
    13 #include "Helpers/Assert.hpp"
    1414#include "defs.hpp"
    1515
     
    181181
    182182    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");
    184184    }
    185185  };
     
    191191  struct creator_t<creator_T,false>{
    192192    inline static creator_T* make(){
    193       ASSERT(0, "Cannot create a singleton of this type directly");
    194       return 0;
     193      assert(0 && "Cannot create a singleton of this type directly");
    195194    }
    196195    inline static void set(ptr_t& dest,creator_T* src){
  • src/Patterns/Singleton_impl.hpp

    r0c5eeb r326bbe  
    7272template <class T,bool _may_create>
    7373void 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");
    7575  boost::recursive_mutex::scoped_lock guard(instanceLock);
    7676  theInstance.reset(newInstance);
     
    8383template <class T, bool _may_create>
    8484Singleton<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");
    8686}
    8787
  • src/UIElements/Dialog.cpp

    r0c5eeb r326bbe  
    77
    88#include "Helpers/MemDebug.hpp"
     9
     10#include <cassert>
    911
    1012#include "Dialog.hpp"
  • src/World.cpp

    r0c5eeb r326bbe  
    2121#include "Descriptors/SelectiveIterator_impl.hpp"
    2222#include "Actions/ManipulateAtomsProcess.hpp"
    23 #include "Helpers/Assert.hpp"
    2423
    2524#include "Patterns/Singleton_impl.hpp"
     
    113112  molecule *mol = NULL;
    114113  mol = NewMolecule();
    115   ASSERT(!molecules.count(currMoleculeId),"currMoleculeId did not specify an unused ID");
     114  cout << "Creating molecule with id " << currMoleculeId << "." << endl;
     115  assert(!molecules.count(currMoleculeId));
    116116  mol->setId(currMoleculeId++);
    117117  // store the molecule by ID
     
    129129  OBSERVE;
    130130  molecule *mol = molecules[id];
    131   ASSERT(mol,"Molecule id that was meant to be destroyed did not exist");
     131  assert(mol);
    132132  DeleteMolecule(mol);
    133133  molecules.erase(id);
     
    165165  OBSERVE;
    166166  atom *atom = atoms[id];
    167   ASSERT(atom,"Atom ID that was meant to be destroyed did not exist");
     167  assert(atom);
    168168  DeleteAtom(atom);
    169169  atoms.erase(id);
     
    177177  if(!target){
    178178    target = atoms[oldId];
    179     ASSERT(target,"Atom with that ID not found");
     179    assert(target && "Atom with that ID not found");
    180180    return target->changeId(newId);
    181181  }
  • src/molecule.cpp

    r0c5eeb r326bbe  
    155155molecule::const_iterator molecule::erase( atom * key )
    156156{
     157  cout << "trying to erase atom" << endl;
    157158  molecule::const_iterator iter = find(key);
    158159  if (iter != end()){
  • src/tesselation.cpp

    r0c5eeb r326bbe  
    99
    1010#include <fstream>
     11#include <assert.h>
    1112
    1213#include "helpers.hpp"
     
    2324#include "Plane.hpp"
    2425#include "Exceptions/LinearDependenceException.hpp"
     26#include "Helpers/Assert.hpp"
     27
    2528#include "Helpers/Assert.hpp"
    2629
     
    25242527    baseline = Runner->second;
    25252528    if (baseline->pointlist.empty()) {
    2526       ASSERT((baseline->BaseLine->triangles.size() == 1),"Open line without exactly one attached triangle");
     2529      assert((baseline->BaseLine->triangles.size() == 1) && ("Open line without exactly one attached triangle"));
    25272530      T = (((baseline->BaseLine->triangles.begin()))->second);
    25282531      DoLog(1) && (Log() << Verbose(1) << "Finding best candidate for open line " << *baseline->BaseLine << " of triangle " << *T << endl);
  • src/unittests/Makefile.am

    r0c5eeb r326bbe  
    211211
    212212SingletonTest_SOURCES = UnitTestMain.cpp SingletonTest.cpp SingletonTest.hpp
    213 SingletonTest_LDADD = ${ALLLIBS} $(BOOST_LIB) ${BOOST_THREAD_LIB}
     213SingletonTest_LDADD = $(BOOST_LIB) ${BOOST_THREAD_LIB}
    214214
    215215StackClassUnitTest_SOURCES = UnitTestMain.cpp stackclassunittest.cpp stackclassunittest.hpp
  • src/unittests/ObserverTest.cpp

    r0c5eeb r326bbe  
    382382  // make this Observable its own subject. NEVER DO THIS IN ACTUAL CODE
    383383  simpleObservable1->signOn(simpleObservable1);
    384 #ifndef NDEBUG
    385384  CPPUNIT_ASSERT_THROW(simpleObservable1->changeMethod(),Assert::AssertionFailure);
    386 #else
    387   simpleObservable1->changeMethod();
    388 #endif
    389385
    390386  // more complex test
     
    392388  simpleObservable1->signOn(simpleObservable2);
    393389  simpleObservable2->signOn(simpleObservable1);
    394 #ifndef NDEBUG
    395390  CPPUNIT_ASSERT_THROW(simpleObservable1->changeMethod(),Assert::AssertionFailure);
    396 #else
    397   simpleObservable1->changeMethod();
    398 #endif
    399 
    400 
    401391  simpleObservable1->signOff(simpleObservable2);
    402392  simpleObservable2->signOff(simpleObservable1);
  • src/unittests/manipulateAtomsTest.cpp

    r0c5eeb r326bbe  
    8787static void operation(atom* _atom){
    8888  AtomStub *atom = dynamic_cast<AtomStub*>(_atom);
    89   CPPUNIT_ASSERT(atom);
     89  assert(atom);
    9090  atom->doSomething();
    9191}
     
    100100    AtomStub *atom;
    101101    atom = dynamic_cast<AtomStub*>(*iter);
    102     CPPUNIT_ASSERT(atom);
     102    assert(atom);
    103103    CPPUNIT_ASSERT(atom->manipulated);
    104104  }
     
    114114    AtomStub *atom;
    115115    atom = dynamic_cast<AtomStub*>(*iter);
    116     CPPUNIT_ASSERT(atom);
     116    assert(atom);
    117117    if(atom->getId()!=(int)ATOM_COUNT/2)
    118118      CPPUNIT_ASSERT(atom->manipulated);
Note: See TracChangeset for help on using the changeset viewer.