Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/unittests/CountBondsUnitTest.cpp

    rd74077 r920c70  
    5454  Walker = World::getInstance().createAtom();
    5555  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
    56   Walker->setType(hydrogen);
    57   Walker->setPosition(Vector(-0.2418, 0.9350, 0. ));
     56  Walker->type = hydrogen;
     57  *Walker->node = Vector(-0.2418, 0.9350, 0. );
    5858  TestMolecule1->AddAtom(Walker);
    5959  Walker = World::getInstance().createAtom();
    6060  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
    61   Walker->setType(hydrogen);
    62   Walker->setPosition(Vector(0.9658, 0., 0. ));
     61  Walker->type = hydrogen;
     62  *Walker->node = Vector(0.9658, 0., 0. );
    6363  TestMolecule1->AddAtom(Walker);
    6464  Walker = World::getInstance().createAtom();
    6565  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
    66   Walker->setType(oxygen);
    67   Walker->setPosition(Vector(0., 0., 0. ));
     66  Walker->type = oxygen;
     67  *Walker->node = Vector(0., 0., 0. );
    6868  TestMolecule1->AddAtom(Walker);
    6969
     
    7272  Walker = World::getInstance().createAtom();
    7373  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
    74   Walker->setType(hydrogen);
    75   Walker->setPosition(Vector(-0.2418, 0.9350, 0. ));
     74  Walker->type = hydrogen;
     75  *Walker->node = Vector(-0.2418, 0.9350, 0. );
    7676  TestMolecule2->AddAtom(Walker);
    7777  Walker = World::getInstance().createAtom();
    7878  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
    79   Walker->setType(hydrogen);
    80   Walker->setPosition(Vector(0.9658, 0., 0. ));
     79  Walker->type = hydrogen;
     80  *Walker->node = Vector(0.9658, 0., 0. );
    8181  TestMolecule2->AddAtom(Walker);
    8282  Walker = World::getInstance().createAtom();
    8383  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
    84   Walker->setType(oxygen);
    85   Walker->setPosition(Vector(0., 0., 0. ));
     84  Walker->type = oxygen;
     85  *Walker->node = Vector(0., 0., 0. );
    8686  TestMolecule2->AddAtom(Walker);
    8787
     
    9292
    9393  // check that TestMolecule was correctly constructed
    94   CPPUNIT_ASSERT_EQUAL( TestMolecule1->getAtomCount(), 3 );
    95   CPPUNIT_ASSERT_EQUAL( TestMolecule2->getAtomCount(), 3 );
     94  CPPUNIT_ASSERT_EQUAL( TestMolecule1->AtomCount, 3 );
     95  Walker = TestMolecule1->start->next;
     96  CPPUNIT_ASSERT( TestMolecule1->end != Walker );
     97  CPPUNIT_ASSERT_EQUAL( TestMolecule2->AtomCount, 3 );
     98  Walker = TestMolecule2->start->next;
     99  CPPUNIT_ASSERT( TestMolecule2->end != Walker );
    96100
    97101  // create a small file with table
     
    154158  Translator  = Vector(3,0,0);
    155159  TestMolecule2->Translate(&Translator);
    156   CPPUNIT_ASSERT_EQUAL( 1 , CountHydrogenBridgeBonds(molecules, NULL, NULL) );
    157   CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, oxygen, NULL) );
     160  CPPUNIT_ASSERT_EQUAL( 1 , CountHydrogenBridgeBonds(molecules, NULL) );
     161  CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, oxygen) );
    158162  //OutputTestMolecule(TestMolecule2, "testmolecule2-1.xyz");
    159163  Translator = Vector(-3,0,0);
     
    163167  Translator = Vector(0,3,0);
    164168  TestMolecule2->Translate(&Translator);
    165   CPPUNIT_ASSERT_EQUAL( 1 , CountHydrogenBridgeBonds(molecules, NULL, NULL) );
     169  CPPUNIT_ASSERT_EQUAL( 1 , CountHydrogenBridgeBonds(molecules, NULL) );
    166170  //OutputTestMolecule(TestMolecule2, "testmolecule2-2.xyz");
    167171  Translator = Vector(0,-3,0);
     
    172176  TestMolecule2->Scale((const double ** const)&mirror);
    173177  TestMolecule2->Translate(&Translator);
    174   CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, NULL, NULL) );
     178  CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, NULL) );
    175179  //OutputTestMolecule(TestMolecule2, "testmolecule2-3.xyz");
    176180  Translator = Vector(0,3,0);
     
    181185  Translator = Vector(2,1,0);
    182186  TestMolecule2->Translate(&Translator);
    183   CPPUNIT_ASSERT_EQUAL( 1 , CountHydrogenBridgeBonds(molecules, NULL, NULL) );
     187  CPPUNIT_ASSERT_EQUAL( 1 , CountHydrogenBridgeBonds(molecules, NULL) );
    184188  //OutputTestMolecule(TestMolecule2, "testmolecule2-4.xyz");
    185189  Translator = Vector(-2,-1,0);
     
    189193  Translator = Vector(0,0,3);
    190194  TestMolecule2->Translate(&Translator);
    191   CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, NULL, NULL) );
     195  CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, NULL) );
    192196  //OutputTestMolecule(TestMolecule2, "testmolecule2-5.xyz");
    193197  Translator = Vector(0,0,-3);
     
    198202  TestMolecule2->Scale((const double ** const)&mirror);
    199203  TestMolecule2->Translate(&Translator);
    200   CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, NULL, NULL) );
     204  CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, NULL) );
    201205  //OutputTestMolecule(TestMolecule2, "testmolecule2-6.xyz");
    202206  Translator = Vector(3,0,0);
     
    208212  TestMolecule2->Scale((const double ** const)&mirror);
    209213  TestMolecule2->Translate(&Translator);
    210   CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, NULL, NULL) );
     214  CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, NULL) );
    211215  //OutputTestMolecule(TestMolecule2, "testmolecule2-7.xyz");
    212216  Translator = Vector(-3,0,0);
     
    219223  TestMolecule2->Translate(&Translator);
    220224  //OutputTestMolecule(TestMolecule2, "testmolecule2-8.xyz");
    221   CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, NULL, NULL) );
     225  CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, NULL) );
    222226  Translator = Vector(0,-3,0);
    223227  TestMolecule2->Translate(&Translator);
Note: See TracChangeset for help on using the changeset viewer.