Changeset 060fc3 for src/Graph/unittests


Ignore:
Timestamp:
May 19, 2017, 9:27:11 AM (8 years ago)
Author:
Frederik Heber <frederik.heber@…>
Branches:
ForceAnnealing_goodresults, ForceAnnealing_tocheck
Children:
adbeca
Parents:
6370f9
Message:

Extended BreadthFirstSearchGatherer to allow BFS with limited discovery horizon.

  • TESTS: extended unit test as well.
Location:
src/Graph/unittests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/Graph/unittests/BreadthFirstSearchGathererUnitTest.cpp

    r6370f9 r060fc3  
    105105  CPPUNIT_ASSERT_EQUAL (compareids, atomids);
    106106};
     107
     108/** Tests whether operator() with limited distance works.
     109 */
     110void BreadthFirstSearchGathererTest::limitedDistanceTest()
     111{
     112  // create linear test graph
     113  prepareLinearGraph();
     114
     115  // call operator
     116  BreadthFirstSearchGatherer gatherer(*BGCreator);
     117  std::vector<atomId_t> atomids = gatherer(0, 3);
     118
     119  // create comparator set
     120  std::vector<atomId_t> compareids;
     121  compareids += 0,1,2,3;
     122  CPPUNIT_ASSERT_EQUAL ((size_t)4, atomids.size());
     123  CPPUNIT_ASSERT_EQUAL (compareids, atomids);
     124};
  • src/Graph/unittests/BreadthFirstSearchGathererUnitTest.hpp

    r6370f9 r060fc3  
    2525    CPPUNIT_TEST_SUITE( BreadthFirstSearchGathererTest) ;
    2626    CPPUNIT_TEST ( operatorTest );
     27    CPPUNIT_TEST ( limitedDistanceTest );
    2728    CPPUNIT_TEST_SUITE_END();
    2829
     
    3132      void tearDown();
    3233      void operatorTest();
     34      void limitedDistanceTest();
    3335
    3436private:
Note: See TracChangeset for help on using the changeset viewer.