Changeset 8f822c for src/unittests


Ignore:
Timestamp:
Jul 1, 2010, 1:55:08 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:
b5bf84
Parents:
0d5dce (diff), 014475 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'VectorRefactoring' into Shapes

Location:
src/unittests
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • src/unittests/LineUnittest.cpp

    r0d5dce r8f822c  
    1717
    1818#include <iostream>
     19#include <cmath>
    1920
    2021using namespace std;
  • src/unittests/LinkedCellUnitTest.cpp

    r0d5dce r8f822c  
    264264  Vector tester;
    265265  LinkedCell::LinkedNodes *ListOfPoints = NULL;
    266   atom *Walker = NULL;
    267266  size_t size = 0;
    268267
     
    326325  Vector tester;
    327326  LinkedCell::LinkedNodes *ListOfPoints = NULL;
    328   atom *Walker = NULL;
    329327  size_t size = 0;
    330328
  • src/unittests/Makefile.am

    r0d5dce r8f822c  
    5353GSLLIBS = ../libgslwrapper.a $(BOOST_LIB) ${BOOST_THREAD_LIB}
    5454ALLLIBS = ../libmolecuilder.a ${GSLLIBS}
     55PARSERLIBS = ../libparser.a ${ALLLIBS}
    5556
    5657TESTSOURCES = \
     
    203204
    204205ParserUnitTest_SOURCES = UnitTestMain.cpp ParserUnitTest.cpp ParserUnitTest.hpp
    205 ParserUnitTest_LDADD = ${ALLLIBS}
     206ParserUnitTest_LDADD = ${PARSERLIBS}
    206207
    207208periodentafelTest_SOURCES = UnitTestMain.cpp periodentafelTest.cpp periodentafelTest.hpp
     
    215216
    216217SingletonTest_SOURCES = UnitTestMain.cpp SingletonTest.cpp SingletonTest.hpp
    217 SingletonTest_LDADD = $(BOOST_LIB) ${BOOST_THREAD_LIB}
     218SingletonTest_LDADD = ${ALLLIBS} $(BOOST_LIB) ${BOOST_THREAD_LIB}
    218219
    219220StackClassUnitTest_SOURCES = UnitTestMain.cpp stackclassunittest.cpp stackclassunittest.hpp
  • src/unittests/ObserverTest.cpp

    r0d5dce r8f822c  
    382382  // make this Observable its own subject. NEVER DO THIS IN ACTUAL CODE
    383383  simpleObservable1->signOn(simpleObservable1);
     384#ifndef NDEBUG
    384385  CPPUNIT_ASSERT_THROW(simpleObservable1->changeMethod(),Assert::AssertionFailure);
     386#else
     387  simpleObservable1->changeMethod();
     388#endif
    385389
    386390  // more complex test
     
    388392  simpleObservable1->signOn(simpleObservable2);
    389393  simpleObservable2->signOn(simpleObservable1);
     394#ifndef NDEBUG
    390395  CPPUNIT_ASSERT_THROW(simpleObservable1->changeMethod(),Assert::AssertionFailure);
     396#else
     397  simpleObservable1->changeMethod();
     398#endif
     399
     400
    391401  simpleObservable1->signOff(simpleObservable2);
    392402  simpleObservable2->signOff(simpleObservable1);
  • src/unittests/ParserUnitTest.cpp

    r0d5dce r8f822c  
    1212#include <cppunit/ui/text/TestRunner.h>
    1313
     14#include "Parser/MpqcParser.hpp"
     15#include "Parser/PcpParser.hpp"
     16#include "Parser/TremoloParser.hpp"
    1417#include "Parser/XyzParser.hpp"
    15 #include "Parser/TremoloParser.hpp"
    1618#include "World.hpp"
    1719#include "atom.hpp"
     
    2931CPPUNIT_TEST_SUITE_REGISTRATION( ParserUnitTest );
    3032
     33static string waterPcp = "# ParallelCarParinello - main configuration file - created with molecuilder\n\
     34\n\
     35mainname\tpcp\t# programm name (for runtime files)\n\
     36defaultpath\not specified\t# where to put files during runtime\n\
     37pseudopotpath\not specified\t# where to find pseudopotentials\n\
     38\n\
     39ProcPEGamma\t8\t# for parallel computing: share constants\n\
     40ProcPEPsi\t1\t# for parallel computing: share wave functions\n\
     41DoOutVis\t0\t# Output data for OpenDX\n\
     42DoOutMes\t1\t# Output data for measurements\n\
     43DoOutOrbitals\t0\t# Output all Orbitals\n\
     44DoOutCurr\t0\t# Ouput current density for OpenDx\n\
     45DoOutNICS\t0\t# Output Nucleus independent current shieldings\n\
     46DoPerturbation\t0\t# Do perturbation calculate and determine susceptibility and shielding\n\
     47DoFullCurrent\t0\t# Do full perturbation\n\
     48DoConstrainedMD\t0\t# Do perform a constrained (>0, relating to current MD step) instead of unconstrained (0) MD\n\
     49Thermostat\tBerendsen\t2.5\t# Which Thermostat and its parameters to use in MD case.\n\
     50CommonWannier\t0\t# Put virtual centers at indivual orbits, all common, merged by variance, to grid point, to cell center\n\
     51SawtoothStart\t0.01\t# Absolute value for smooth transition at cell border \n\
     52VectorPlane\t0\t# Cut plane axis (x, y or z: 0,1,2) for two-dim current vector plot\n\
     53VectorCut\t0\t# Cut plane axis value\n\
     54AddGramSch\t1\t# Additional GramSchmidtOrtogonalization to be safe\n\
     55Seed\t1\t# initial value for random seed for Psi coefficients\n\
     56\n\
     57MaxOuterStep\t0\t# number of MolecularDynamics/Structure optimization steps\n\
     58Deltat\t0.01\t# time per MD step\n\
     59OutVisStep\t10\t# Output visual data every ...th step\n\
     60OutSrcStep\t5\t# Output \"restart\" data every ..th step\n\
     61TargetTemp\t0.000950045\t# Target temperature\n\
     62MaxPsiStep\t3\t# number of Minimisation steps per state (0 - default)\n\
     63EpsWannier\t1e-07\t# tolerance value for spread minimisation of orbitals\n\
     64# Values specifying when to stop\n\
     65MaxMinStep\t100\t# Maximum number of steps\n\
     66RelEpsTotalE\t1e-07\t# relative change in total energy\n\
     67RelEpsKineticE\t1e-05\t# relative change in kinetic energy\n\
     68MaxMinStopStep\t2\t# check every ..th steps\n\
     69MaxMinGapStopStep\t1\t# check every ..th steps\n\
     70\n\
     71# Values specifying when to stop for INIT, otherwise same as above\n\
     72MaxInitMinStep\t100\t# Maximum number of steps\n\
     73InitRelEpsTotalE\t1e-05\t# relative change in total energy\n\
     74InitRelEpsKineticE\t0.0001\t# relative change in kinetic energy\n\
     75InitMaxMinStopStep\t2\t# check every ..th steps\n\
     76InitMaxMinGapStopStep\t1\t# check every ..th steps\n\
     77\n\
     78BoxLength\t# (Length of a unit cell)\n\
     7920\n\
     800\t20\n\
     810\t0\t20\n\
     82\n\
     83ECut\t128\t# energy cutoff for discretization in Hartrees\n\
     84MaxLevel\t5\t# number of different levels in the code, >=2\n\
     85Level0Factor\t2\t# factor by which node number increases from S to 0 level\n\
     86RiemannTensor\t0\t# (Use metric)\n\
     87PsiType\t0\t# 0 - doubly occupied, 1 - SpinUp,SpinDown\n\
     88MaxPsiDouble\t2\t# here: specifying both maximum number of SpinUp- and -Down-states\n\
     89PsiMaxNoUp\t2\t# here: specifying maximum number of SpinUp-states\n\
     90PsiMaxNoDown\t2\t# here: specifying maximum number of SpinDown-states\n\
     91AddPsis\t0\t# Additional unoccupied Psis for bandgap determination\n\
     92\n\
     93RCut\t20\t# R-cut for the ewald summation\n\
     94StructOpt\t0\t# Do structure optimization beforehand\n\
     95IsAngstroem\t1\t# 0 - Bohr, 1 - Angstroem\n\
     96RelativeCoord\t0\t# whether ion coordinates are relative (1) or absolute (0)\n\
     97MaxTypes\t2\t# maximum number of different ion types\n\
     98\n\
     99# Ion type data (PP = PseudoPotential, Z = atomic number)\n\
     100#Ion_TypeNr.\tAmount\tZ\tRGauss\tL_Max(PP)L_Loc(PP)IonMass\t# chemical name, symbol\n\
     101Ion_Type1\t2\t1\t1.0\t3\t3\t1.008\tHydrogen\tH\n\
     102Ion_Type2\t1\t8\t1.0\t3\t3\t15.999\tOxygen\tO\n\
     103#Ion_TypeNr._Nr.R[0]\tR[1]\tR[2]\tMoveType (0 MoveIon, 1 FixedIon)\n\
     104Ion_Type2_1\t0.000000000\t0.000000000\t0.000000000\t0 # molecule nr 0\n\
     105Ion_Type1_1\t0.758602\t0.000000000\t0.504284\t0 # molecule nr 1\n\
     106Ion_Type1_2\t0.758602\t0.000000000\t-0.504284\t0 # molecule nr 2\n";
     107static string waterMpqc ="% Created by MoleCuilder\n\
     108mpqc: (\n\
     109\tsavestate = no\n\
     110\tdo_gradient = yes\n\
     111\tmole<MBPT2>: (\n\
     112\t\tmaxiter = 200\n\
     113\t\tbasis = $:basis\n\
     114\t\tmolecule = $:molecule\n\
     115\t\treference<CLHF>: (\n\
     116\t\t\tbasis = $:basis\n\
     117\t\t\tmolecule = $:molecule\n\
     118\t\t)\n\
     119\t)\n\
     120)\n\
     121molecule<Molecule>: (\n\
     122\tunit = angstrom\n\
     123\t{ atoms geometry } = {\n\
     124\t\tO [ -0.505735\t0\t0 ]\n\
     125\t\tH [ 0.252867\t0\t0.504284 ]\n\
     126\t\tH [ 0.252867\t0\t-0.504284 ]\n\
     127\t}\n\
     128)\n\
     129basis<GaussianBasisSet>: (\n\
     130\tname = \"3-21G\"\n\
     131\tmolecule = $:molecule\n\
     132)\n";
     133static string waterXyz = "3\nH2O: water molecule\nO\t0\t0\t0\nH\t0.758602\t0\t0.504284\nH\t0.758602\t0\t-0.504284\n";
     134static string Tremolo_Atomdata1 = "# ATOMDATA\tId\tname\tType\tx=3\n";
     135static string Tremolo_Atomdata2 = "#\n#ATOMDATA Id name Type x=3\n1 hydrogen H 3.0 4.5 0.1\n\n";
     136static string Tremolo_invalidkey = "#\n#ATOMDATA Id name foo Type x=3\n\n\n";
     137static string Tremolo_velocity = "#\n#ATOMDATA Id name Type u=3\n1 hydrogen H 3.0 4.5 0.1\n\n";
     138static string Tremolo_neighbours = "#\n#ATOMDATA Id Type neighbors=2\n1 H 3 0\n2 H 3 0\n3 O 1 2\n";
     139static string Tremolo_improper = "#\n#ATOMDATA Id Type imprData\n8 H 9-10\n9 H 10-8,8-10\n10 O -\n";
     140static string Tremolo_torsion = "#\n#ATOMDATA Id Type torsion\n8 H 9-10\n9 H 10-8,8-10\n10 O -\n";
     141static string Tremolo_full = "# ATOMDATA\tx=3\tu=3\tF\tstress\tId\tneighbors=5\timprData\tGroupMeasureTypeNo\tType\textType\tname\tresName\tchainID\tresSeq\toccupancy\ttempFactor\tsegID\tCharge\tcharge\tGrpTypeNo\ttorsion\n0\t0\t0\t0\t0\t0\t0\t0\t0\t0\t0\t0\t0\t0\t-\t0\tH\t-\t-\t-\t0\t0\t0\t0\t0\t0\t0\t0\t-\t\n";
    31142
    32143void ParserUnitTest::setUp() {
    33144  World::getInstance();
     145
     146  // we need hydrogens and oxygens in the following tests
     147  CPPUNIT_ASSERT(World::getInstance().getPeriode()->FindElement(1) != NULL);
     148  CPPUNIT_ASSERT(World::getInstance().getPeriode()->FindElement(8) != NULL);
    34149}
    35150
    36151void ParserUnitTest::tearDown() {
     152  ChangeTracker::purgeInstance();
    37153  World::purgeInstance();
    38154}
     
    43159  cout << "Testing the XYZ parser." << endl;
    44160  XyzParser* testParser = new XyzParser();
    45   string waterXyz = "3\nH2O: water molecule\nO\t0.000000\t0.000000\t0.000000\nH\t0.758602\t0.000000\t0.504284\nH\t0.758602\t0.000000\t-0.504284\n";
    46161  stringstream input;
    47162  input << waterXyz;
     
    62177  TremoloParser* testParser = new TremoloParser();
    63178  stringstream input, output;
    64   string waterTremolo;
    65179
    66180  // Atomdata beginning with "# ATOMDATA"
    67   waterTremolo = "# ATOMDATA\tId\tname\tType\tx=3\n";
    68   input << waterTremolo;
    69   testParser->load(&input);
    70   testParser->save(&output);
    71   CPPUNIT_ASSERT(waterTremolo == output.str());
     181  input << Tremolo_Atomdata1;
     182  testParser->load(&input);
     183  testParser->save(&output);
     184  CPPUNIT_ASSERT(Tremolo_Atomdata1 == output.str());
    72185  input.clear();
    73186  output.clear();
    74187
    75188  // Atomdata beginning with "#ATOMDATA"
    76   waterTremolo = "#\n#ATOMDATA Id name Type x=3\n1 hydrogen H 3.0 4.5 0.1\n\n";
    77   input << waterTremolo;
     189  input << Tremolo_Atomdata2;
    78190  testParser->load(&input);
    79191  testParser->save(&output);
     
    83195
    84196  // Invalid key in Atomdata line
    85   waterTremolo = "#\n#ATOMDATA Id name foo Type x=3\n\n\n";
    86   input << waterTremolo;
     197  input << Tremolo_invalidkey;
    87198  testParser->load(&input);
    88199  //TODO: proove invalidity
     
    93204  TremoloParser* testParser = new TremoloParser();
    94205  stringstream input;
    95   string waterTremolo;
    96206
    97207  // One simple data line
    98   waterTremolo = "#\n#ATOMDATA Id name Type x=3\n1 hydrogen H 3.0 4.5 0.1\n\n";
    99   input << waterTremolo;
     208  input << Tremolo_Atomdata2;
    100209  testParser->load(&input);
    101210  CPPUNIT_ASSERT(World::getInstance().getAtom(AtomByType(1))->x[0] == 3.0);
     
    106215  TremoloParser* testParser = new TremoloParser();
    107216  stringstream input;
    108   string waterTremolo;
    109217
    110218  // One simple data line
    111   waterTremolo = "#\n#ATOMDATA Id name Type u=3\n1 hydrogen H 3.0 4.5 0.1\n\n";
    112   input << waterTremolo;
     219  input << Tremolo_velocity;
    113220  testParser->load(&input);
    114221  CPPUNIT_ASSERT(World::getInstance().getAtom(AtomByType(1))->v[0] == 3.0);
     
    119226  TremoloParser* testParser = new TremoloParser();
    120227  stringstream input;
    121   string waterTremolo;
    122228
    123229  // Neighbor data
    124   waterTremolo = "#\n#ATOMDATA Id Type neighbors=2\n1 H 3 0\n2 H 3 0\n3 O 1 2\n";
    125   input << waterTremolo;
     230  input << Tremolo_neighbours;
    126231  testParser->load(&input);
    127232
     
    135240  TremoloParser* testParser = new TremoloParser();
    136241  stringstream input, output;
    137   string waterTremolo;
    138242
    139243  // Neighbor data
    140   waterTremolo = "#\n#ATOMDATA Id Type imprData\n8 H 9-10\n9 H 10-8,8-10\n10 O -\n";
    141   input << waterTremolo;
     244  input << Tremolo_improper;
    142245  testParser->load(&input);
    143246  testParser->save(&output);
     
    151254  TremoloParser* testParser = new TremoloParser();
    152255  stringstream input, output;
    153   string waterTremolo;
    154256
    155257  // Neighbor data
    156   waterTremolo = "#\n#ATOMDATA Id Type torsion\n8 H 9-10\n9 H 10-8,8-10\n10 O -\n";
    157   input << waterTremolo;
     258  input << Tremolo_torsion;
    158259  testParser->load(&input);
    159260  testParser->save(&output);
     
    173274  testParser->setFieldsForSave("x=3 u=3 F stress Id neighbors=5 imprData GroupMeasureTypeNo Type extType name resName chainID resSeq occupancy tempFactor segID Charge charge GrpTypeNo torsion");
    174275  testParser->save(&output);
    175   CPPUNIT_ASSERT(output.str() == "# ATOMDATA\tx=3\tu=3\tF\tstress\tId\tneighbors=5\timprData\tGroupMeasureTypeNo\tType\textType\tname\tresName\tchainID\tresSeq\toccupancy\ttempFactor\tsegID\tCharge\tcharge\tGrpTypeNo\ttorsion\n0\t0\t0\t0\t0\t0\t0\t0\t0\t0\t0\t0\t0\t0\t-\t0\tH\t-\t-\t-\t0\t0\t0\t0\t0\t0\t0\t0\t-\t\n");
     276  CPPUNIT_ASSERT(output.str() == Tremolo_full);
    176277
    177278  cout << "testing the tremolo parser is done" << endl;
    178279}
     280
     281void ParserUnitTest::readwritePcpTest() {
     282  stringstream input(waterPcp);
     283  PcpParser* testParser = new PcpParser();
     284  testParser->load(&input);
     285  input.clear();
     286
     287  CPPUNIT_ASSERT_EQUAL(3, World::getInstance().numAtoms());
     288
     289  string newWaterPcp = "";
     290  stringstream output;
     291  testParser->save(&output);
     292
     293  input << output;
     294  PcpParser* testParser2 = new PcpParser();
     295  testParser2->load(&input);
     296
     297  CPPUNIT_ASSERT_EQUAL(6, World::getInstance().numAtoms());
     298
     299  CPPUNIT_ASSERT(*testParser == *testParser2);
     300}
     301
     302void ParserUnitTest::writeMpqcTest() {
     303  // build up water molecule
     304  atom *Walker = NULL;
     305  Walker = World::getInstance().createAtom();
     306  Walker->type = World::getInstance().getPeriode()->FindElement(8);
     307  Walker->x = Vector(0,0,0);
     308  Walker = World::getInstance().createAtom();
     309  Walker->type = World::getInstance().getPeriode()->FindElement(1);
     310  Walker->x = Vector(0.758602,0,0.504284);
     311  Walker = World::getInstance().createAtom();
     312  Walker->type = World::getInstance().getPeriode()->FindElement(1);
     313  Walker->x = Vector(0.758602,0,-0.504284);
     314  CPPUNIT_ASSERT_EQUAL(3, World::getInstance().numAtoms());
     315
     316  // create two stringstreams, one stored, one created
     317  stringstream input(waterMpqc);
     318  MpqcParser* testParser = new MpqcParser();
     319  stringstream output;
     320  testParser->save(&output);
     321
     322  // compare both configs
     323  string first = input.str();
     324  string second = output.str();
     325  CPPUNIT_ASSERT(first == second);
     326}
  • src/unittests/ParserUnitTest.hpp

    r0d5dce r8f822c  
    2222  CPPUNIT_TEST ( readAndWriteTremoloTorsionInformationTest );
    2323  CPPUNIT_TEST ( writeTremoloTest );
     24  CPPUNIT_TEST ( readwritePcpTest );
     25  CPPUNIT_TEST ( writeMpqcTest );
    2426  CPPUNIT_TEST_SUITE_END();
    2527
     
    3638  void readAndWriteTremoloTorsionInformationTest();
    3739  void writeTremoloTest();
     40  void readwritePcpTest();
     41  void writeMpqcTest();
    3842};
    3943
  • src/unittests/PlaneUnittest.cpp

    r0d5dce r8f822c  
    1111#include <cppunit/extensions/TestFactoryRegistry.h>
    1212#include <cppunit/ui/text/TestRunner.h>
     13
     14#include <cmath>
    1315
    1416#ifdef HAVE_TESTRUNNER
  • src/unittests/linearsystemofequationsunittest.cpp

    r0d5dce r8f822c  
    1212#include <cppunit/extensions/TestFactoryRegistry.h>
    1313#include <cppunit/ui/text/TestRunner.h>
     14#include <cmath>
    1415
    1516#include "linearsystemofequationsunittest.hpp"
  • src/unittests/manipulateAtomsTest.cpp

    r0d5dce r8f822c  
    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);
  • src/unittests/vectorunittest.cpp

    r0d5dce r8f822c  
    2121#include "Plane.hpp"
    2222#include "Exceptions/LinearDependenceException.hpp"
     23#include "Matrix.hpp"
    2324
    2425#ifdef HAVE_TESTRUNNER
     
    221222void VectorTest::IsInParallelepipedTest()
    222223{
    223   double parallelepiped[NDIM*NDIM];
    224   parallelepiped[0] = 1;
    225   parallelepiped[1] = 0;
    226   parallelepiped[2] = 0;
    227   parallelepiped[3] = 0;
    228   parallelepiped[4] = 1;
    229   parallelepiped[5] = 0;
    230   parallelepiped[6] = 0;
    231   parallelepiped[7] = 0;
    232   parallelepiped[8] = 1;
     224  Matrix parallelepiped;
     225  parallelepiped.at(0,0) = 1;
     226  parallelepiped.at(1,0) = 0;
     227  parallelepiped.at(2,0) = 0;
     228  parallelepiped.at(0,1) = 0;
     229  parallelepiped.at(1,1) = 1;
     230  parallelepiped.at(2,1) = 0;
     231  parallelepiped.at(0,2) = 0;
     232  parallelepiped.at(1,2) = 0;
     233  parallelepiped.at(2,2) = 1;
    233234
    234235  fixture = zero;
Note: See TracChangeset for help on using the changeset viewer.