test/max_cardinality_search_test.cc
changeset 1192 b84e68af8248
parent 1020 70bee017b584
child 1270 dceba191c00d
equal deleted inserted replaced
0:06119d97efc5 1:7733f0a4f1e5
   115 
   115 
   116    maxcard.init();
   116    maxcard.init();
   117    maxcard.addSource(s);
   117    maxcard.addSource(s);
   118    maxcard.start(x);
   118    maxcard.start(x);
   119 
   119 
   120    check(maxcard.processed(s) and !maxcard.processed(x) and
   120    check(maxcard.processed(s) && !maxcard.processed(x) &&
   121          !maxcard.processed(y), "Wrong processed()!");
   121          !maxcard.processed(y), "Wrong processed()!");
   122 
   122 
   123    a=maxcard.nextNode();
   123    a=maxcard.nextNode();
   124    check(maxcard.processNextNode()==a,
   124    check(maxcard.processNextNode()==a,
   125          "Wrong nextNode() or processNextNode() return value!");
   125          "Wrong nextNode() or processNextNode() return value!");
   126 
   126 
   127    check(maxcard.processed(a), "Wrong processNextNode()!");
   127    check(maxcard.processed(a), "Wrong processNextNode()!");
   128 
   128 
   129    maxcard.start();
   129    maxcard.start();
   130    check(maxcard.cardinality(x)==2 and maxcard.cardinality(y)>=4,
   130    check(maxcard.cardinality(x)==2 && maxcard.cardinality(y)>=4,
   131          "Wrong cardinalities!");
   131          "Wrong cardinalities!");
   132  }
   132  }
   133 
   133 
   134  void checkWithConst1Map(std::istringstream &input) {
   134  void checkWithConst1Map(std::istringstream &input) {
   135    typedef SmartDigraph Digraph;
   135    typedef SmartDigraph Digraph;