Ignore:
Timestamp:
Apr 26, 2010, 3:47:54 PM (16 years ago)
Author:
Frederik Heber <heber@…>
Children:
bb50e0
Parents:
d2390d (diff), aa8542 (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 'FixBondGraphUnitTest_hydrogencarbon' into Analysis_PairCorrelation

Conflicts:

molecuilder/src/molecule_graph.cpp

There have been conflicts due to LinkedNodes now being local in context LinkedCell.

Signed-off-by: Frederik Heber <heber@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/unittests/bondgraphunittest.cpp

    rd2390d rd1829c  
    2020#include "bondgraph.hpp"
    2121#include "element.hpp"
     22#include "log.hpp"
    2223#include "molecule.hpp"
    2324#include "periodentafel.hpp"
     
    4243  hydrogen = new element;
    4344  hydrogen->Z = 1;
     45  hydrogen->CovalentRadius = 0.23;
     46  hydrogen->VanDerWaalsRadius = 1.09;
    4447  strcpy(hydrogen->name, "hydrogen");
    4548  strcpy(hydrogen->symbol, "H");
    4649  carbon = new element;
    47   carbon->Z = 1;
     50  carbon->Z = 2;
     51  carbon->CovalentRadius = 0.68;
     52  carbon->VanDerWaalsRadius = 1.7;
    4853  strcpy(carbon->name, "carbon");
    4954  strcpy(carbon->symbol, "C");
     
    5863  TestMolecule = new molecule(tafel);
    5964  Walker = new atom();
    60   Walker->type = hydrogen;
     65  Walker->type = carbon;
    6166  Walker->node->Init(1., 0., 1. );
    6267  TestMolecule->AddAtom(Walker);
    6368  Walker = new atom();
    64   Walker->type = hydrogen;
     69  Walker->type = carbon;
    6570  Walker->node->Init(0., 1., 1. );
    6671  TestMolecule->AddAtom(Walker);
    6772  Walker = new atom();
    68   Walker->type = hydrogen;
     73  Walker->type = carbon;
    6974  Walker->node->Init(1., 1., 0. );
    7075  TestMolecule->AddAtom(Walker);
    7176  Walker = new atom();
    72   Walker->type = hydrogen;
     77  Walker->type = carbon;
    7378  Walker->node->Init(0., 0., 0. );
    7479  TestMolecule->AddAtom(Walker);
     
    7883
    7984  // create a small file with table
     85  dummyname = new string("dummy.dat");
    8086  filename = new string("test.dat");
    8187  ofstream test(filename->c_str());
     
    9399  remove(filename->c_str());
    94100  delete(filename);
     101  delete(dummyname);
    95102  delete(BG);
    96103
     
    114121/** UnitTest for BondGraphTest::ConstructBondGraph().
    115122 */
    116 void BondGraphTest::ConstructGraphTest()
     123void BondGraphTest::ConstructGraphFromTableTest()
    117124{
    118125  atom *Walker = TestMolecule->start->next;
     
    120127  CPPUNIT_ASSERT( TestMolecule->end != Walker );
    121128  CPPUNIT_ASSERT_EQUAL( true , BG->LoadBondLengthTable(*filename) );
     129  CPPUNIT_ASSERT_EQUAL( true , BG->ConstructBondGraph(TestMolecule) );
     130  CPPUNIT_ASSERT_EQUAL( true , Walker->IsBondedTo(Runner) );
     131};
     132
     133/** UnitTest for BondGraphTest::ConstructBondGraph().
     134 */
     135void BondGraphTest::ConstructGraphFromCovalentRadiiTest()
     136{
     137  atom *Walker = TestMolecule->start->next;
     138  atom *Runner = TestMolecule->end->previous;
     139  CPPUNIT_ASSERT( TestMolecule->end != Walker );
     140  CPPUNIT_ASSERT_EQUAL( false , BG->LoadBondLengthTable(*dummyname) );
    122141  CPPUNIT_ASSERT_EQUAL( true , BG->ConstructBondGraph(TestMolecule) );
    123142  CPPUNIT_ASSERT_EQUAL( true , Walker->IsBondedTo(Runner) );
Note: See TracChangeset for help on using the changeset viewer.