Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/unittests/CountBondsUnitTest.cpp

    r920c70 rd74077  
    5454  Walker = World::getInstance().createAtom();
    5555  CPPUNIT_ASSERT(Walker != NULL && "could not create atom");
    56   Walker->type = hydrogen;
    57   *Walker->node = Vector(-0.2418, 0.9350, 0. );
     56  Walker->setType(hydrogen);
     57  Walker->setPosition(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->type = hydrogen;
    62   *Walker->node = Vector(0.9658, 0., 0. );
     61  Walker->setType(hydrogen);
     62  Walker->setPosition(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->type = oxygen;
    67   *Walker->node = Vector(0., 0., 0. );
     66  Walker->setType(oxygen);
     67  Walker->setPosition(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->type = hydrogen;
    75   *Walker->node = Vector(-0.2418, 0.9350, 0. );
     74  Walker->setType(hydrogen);
     75  Walker->setPosition(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->type = hydrogen;
    80   *Walker->node = Vector(0.9658, 0., 0. );
     79  Walker->setType(hydrogen);
     80  Walker->setPosition(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->type = oxygen;
    85   *Walker->node = Vector(0., 0., 0. );
     84  Walker->setType(oxygen);
     85  Walker->setPosition(Vector(0., 0., 0. ));
    8686  TestMolecule2->AddAtom(Walker);
    8787
     
    9292
    9393  // check that TestMolecule was correctly constructed
    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 );
     94  CPPUNIT_ASSERT_EQUAL( TestMolecule1->getAtomCount(), 3 );
     95  CPPUNIT_ASSERT_EQUAL( TestMolecule2->getAtomCount(), 3 );
    10096
    10197  // create a small file with table
     
    158154  Translator  = Vector(3,0,0);
    159155  TestMolecule2->Translate(&Translator);
    160   CPPUNIT_ASSERT_EQUAL( 1 , CountHydrogenBridgeBonds(molecules, NULL) );
    161   CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, oxygen) );
     156  CPPUNIT_ASSERT_EQUAL( 1 , CountHydrogenBridgeBonds(molecules, NULL, NULL) );
     157  CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, oxygen, NULL) );
    162158  //OutputTestMolecule(TestMolecule2, "testmolecule2-1.xyz");
    163159  Translator = Vector(-3,0,0);
     
    167163  Translator = Vector(0,3,0);
    168164  TestMolecule2->Translate(&Translator);
    169   CPPUNIT_ASSERT_EQUAL( 1 , CountHydrogenBridgeBonds(molecules, NULL) );
     165  CPPUNIT_ASSERT_EQUAL( 1 , CountHydrogenBridgeBonds(molecules, NULL, NULL) );
    170166  //OutputTestMolecule(TestMolecule2, "testmolecule2-2.xyz");
    171167  Translator = Vector(0,-3,0);
     
    176172  TestMolecule2->Scale((const double ** const)&mirror);
    177173  TestMolecule2->Translate(&Translator);
    178   CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, NULL) );
     174  CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, NULL, NULL) );
    179175  //OutputTestMolecule(TestMolecule2, "testmolecule2-3.xyz");
    180176  Translator = Vector(0,3,0);
     
    185181  Translator = Vector(2,1,0);
    186182  TestMolecule2->Translate(&Translator);
    187   CPPUNIT_ASSERT_EQUAL( 1 , CountHydrogenBridgeBonds(molecules, NULL) );
     183  CPPUNIT_ASSERT_EQUAL( 1 , CountHydrogenBridgeBonds(molecules, NULL, NULL) );
    188184  //OutputTestMolecule(TestMolecule2, "testmolecule2-4.xyz");
    189185  Translator = Vector(-2,-1,0);
     
    193189  Translator = Vector(0,0,3);
    194190  TestMolecule2->Translate(&Translator);
    195   CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, NULL) );
     191  CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, NULL, NULL) );
    196192  //OutputTestMolecule(TestMolecule2, "testmolecule2-5.xyz");
    197193  Translator = Vector(0,0,-3);
     
    202198  TestMolecule2->Scale((const double ** const)&mirror);
    203199  TestMolecule2->Translate(&Translator);
    204   CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, NULL) );
     200  CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, NULL, NULL) );
    205201  //OutputTestMolecule(TestMolecule2, "testmolecule2-6.xyz");
    206202  Translator = Vector(3,0,0);
     
    212208  TestMolecule2->Scale((const double ** const)&mirror);
    213209  TestMolecule2->Translate(&Translator);
    214   CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, NULL) );
     210  CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, NULL, NULL) );
    215211  //OutputTestMolecule(TestMolecule2, "testmolecule2-7.xyz");
    216212  Translator = Vector(-3,0,0);
     
    223219  TestMolecule2->Translate(&Translator);
    224220  //OutputTestMolecule(TestMolecule2, "testmolecule2-8.xyz");
    225   CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, NULL) );
     221  CPPUNIT_ASSERT_EQUAL( 0 , CountHydrogenBridgeBonds(molecules, NULL, NULL) );
    226222  Translator = Vector(0,-3,0);
    227223  TestMolecule2->Translate(&Translator);
Note: See TracChangeset for help on using the changeset viewer.