Changeset 6d574a for src


Ignore:
Timestamp:
Jun 24, 2010, 2:31:45 PM (15 years ago)
Author:
Tillmann Crueger <crueger@…>
Branches:
Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
Children:
0d1ad0
Parents:
906822
Message:

Replaced several old-style asserts with more usable ASSERTs

Location:
src
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • src/Descriptors/AtomDescriptor.cpp

    r906822 r6d574a  
    1212
    1313#include "World.hpp"
    14 
    1514#include "atom.hpp"
    1615
    1716#include <boost/bind.hpp>
    18 #include <cassert>
     17
    1918#include <iostream>
    2019
  • src/Descriptors/MoleculeDescriptor.cpp

    r906822 r6d574a  
    1616
    1717#include <boost/bind.hpp>
    18 #include <cassert>
    1918#include <iostream>
    2019
  • src/Helpers/MemDebug.cpp

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

    r906822 r6d574a  
    99#define SINGLETON_HPP_
    1010
    11 #include <cassert>
    1211#include <boost/thread.hpp>
    1312
     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");
     193      ASSERT(0, "Cannot create a singleton of this type directly");
     194      return 0;
    194195    }
    195196    inline static void set(ptr_t& dest,creator_T* src){
  • src/Patterns/Singleton_impl.hpp

    r906822 r6d574a  
    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

    r906822 r6d574a  
    77
    88#include "Helpers/MemDebug.hpp"
    9 
    10 #include <cassert>
    119
    1210#include "Dialog.hpp"
  • src/World.cpp

    r906822 r6d574a  
    2020#include "Descriptors/SelectiveIterator_impl.hpp"
    2121#include "Actions/ManipulateAtomsProcess.hpp"
     22#include "Helpers/Assert.hpp"
    2223
    2324#include "Patterns/Singleton_impl.hpp"
     
    105106  molecule *mol = NULL;
    106107  mol = NewMolecule();
    107   assert(!molecules.count(currMoleculeId));
     108  ASSERT(!molecules.count(currMoleculeId),"currMoleculeId did not specify an unused ID");
    108109  mol->setId(currMoleculeId++);
    109110  // store the molecule by ID
     
    121122  OBSERVE;
    122123  molecule *mol = molecules[id];
    123   assert(mol);
     124  ASSERT(mol,"Molecule id that was meant to be destroyed did not exist");
    124125  DeleteMolecule(mol);
    125126  molecules.erase(id);
     
    157158  OBSERVE;
    158159  atom *atom = atoms[id];
    159   assert(atom);
     160  ASSERT(atom,"Atom ID that was meant to be destroyed did not exist");
    160161  DeleteAtom(atom);
    161162  atoms.erase(id);
     
    169170  if(!target){
    170171    target = atoms[oldId];
    171     assert(target && "Atom with that ID not found");
     172    ASSERT(target,"Atom with that ID not found");
    172173    return target->changeId(newId);
    173174  }
  • src/tesselation.cpp

    r906822 r6d574a  
    99
    1010#include <fstream>
    11 #include <assert.h>
    1211
    1312#include "helpers.hpp"
     
    2423#include "Plane.hpp"
    2524#include "Exceptions/LinearDependenceException.hpp"
    26 #include "Helpers/Assert.hpp"
    27 
    2825#include "Helpers/Assert.hpp"
    2926
     
    25272524    baseline = Runner->second;
    25282525    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");
    25302527      T = (((baseline->BaseLine->triangles.begin()))->second);
    25312528      DoLog(1) && (Log() << Verbose(1) << "Finding best candidate for open line " << *baseline->BaseLine << " of triangle " << *T << endl);
  • src/unittests/Makefile.am

    r906822 r6d574a  
    210210
    211211SingletonTest_SOURCES = UnitTestMain.cpp SingletonTest.cpp SingletonTest.hpp
    212 SingletonTest_LDADD = $(BOOST_LIB) ${BOOST_THREAD_LIB}
     212SingletonTest_LDADD = ${ALLLIBS} $(BOOST_LIB) ${BOOST_THREAD_LIB}
    213213
    214214StackClassUnitTest_SOURCES = UnitTestMain.cpp stackclassunittest.cpp stackclassunittest.hpp
  • src/unittests/manipulateAtomsTest.cpp

    r906822 r6d574a  
    8787static void operation(atom* _atom){
    8888  AtomStub *atom = dynamic_cast<AtomStub*>(_atom);
    89   assert(atom);
     89  CPPUNIT_ASSERT(atom);
    9090  atom->doSomething();
    9191}
     
    100100    AtomStub *atom;
    101101    atom = dynamic_cast<AtomStub*>(*iter);
    102     assert(atom);
     102    CPPUNIT_ASSERT(atom);
    103103    CPPUNIT_ASSERT(atom->manipulated);
    104104  }
     
    114114    AtomStub *atom;
    115115    atom = dynamic_cast<AtomStub*>(*iter);
    116     assert(atom);
     116    CPPUNIT_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.