Changeset bea9b9


Ignore:
Timestamp:
May 23, 2017, 8:59:33 PM (8 years ago)
Author:
Frederik Heber <frederik.heber@…>
Branches:
ForceAnnealing_tocheck
Children:
06ccac4
Parents:
4daa9c
Message:

tempcommit: Merge with 060fc390

File:
1 edited

Legend:

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

    r4daa9c rbea9b9  
    115115  // call operator
    116116  BreadthFirstSearchGatherer gatherer(*BGCreator);
    117   std::vector<atomId_t> atomids = gatherer(0, 3);
     117  {
     118    std::vector<atomId_t> atomids = gatherer(0, 3);
    118119
    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);
     120    // create comparator set
     121    std::vector<atomId_t> compareids;
     122    compareids += 1,2,3,4;
     123    CPPUNIT_ASSERT_EQUAL ((size_t)4, atomids.size());
     124    CPPUNIT_ASSERT_EQUAL (compareids, atomids);
     125  }
     126  // zero distance means just find the initial node
     127  {
     128    std::vector<atomId_t> atomids = gatherer(0, 0);
     129
     130    // create comparator set
     131    std::vector<atomId_t> compareids;
     132    compareids += 1;
     133    CPPUNIT_ASSERT_EQUAL ((size_t)1, atomids.size());
     134    CPPUNIT_ASSERT_EQUAL (compareids, atomids);
     135  }
     136  // negative distance means find all
     137  {
     138    std::vector<atomId_t> atomids = gatherer(0, -1);
     139
     140    // create comparator set
     141    std::vector<atomId_t> compareids;
     142    compareids += 1,2,3,4,5;
     143    CPPUNIT_ASSERT_EQUAL ((size_t)5, atomids.size());
     144    CPPUNIT_ASSERT_EQUAL (compareids, atomids);
     145  }
    124146};
Note: See TracChangeset for help on using the changeset viewer.