test/graph_utils_test.cc
changeset 224 b246072978e8
parent 209 765619b7cbb2
child 220 a5d8c039f218
equal deleted inserted replaced
2:1e2cee98e1f6 3:febf6431087e
    90       for (NodeIt trg(fg); trg != INVALID; ++trg) {
    90       for (NodeIt trg(fg); trg != INVALID; ++trg) {
    91         Arc con1 = al1(src, trg);
    91         Arc con1 = al1(src, trg);
    92         Arc con2 = al2(src, trg);
    92         Arc con2 = al2(src, trg);
    93         Arc con3 = al3(src, trg);
    93         Arc con3 = al3(src, trg);
    94         Arc con4 = findArc(fg, src, trg);
    94         Arc con4 = findArc(fg, src, trg);
    95         check(con1 == con2 && con2 == con3 && con3 == con4, "Different results.")
    95         check(con1 == con2 && con2 == con3 && con3 == con4,
       
    96               "Different results.")
    96         check(con1 != INVALID, "There is no connecting arc.");
    97         check(con1 != INVALID, "There is no connecting arc.");
    97         check(fg.source(con1) == src, "Wrong source.");
    98         check(fg.source(con1) == src, "Wrong source.");
    98         check(fg.target(con1) == trg, "Wrong target.");
    99         check(fg.target(con1) == trg, "Wrong target.");
    99         check(al3(src, trg, con3) == INVALID, "There is more connecting arc.");
   100         check(al3(src, trg, con3) == INVALID,
   100         check(findArc(fg, src, trg, con4) == INVALID, "There is more connecting arc.");
   101               "There is more connecting arc.");
       
   102         check(findArc(fg, src, trg, con4) == INVALID,
       
   103               "There is more connecting arc.");
   101       }
   104       }
   102     }
   105     }
   103   }
   106   }
   104 }
   107 }
   105 
   108 
   121   DescriptorMap<Graph, Edge> edges(graph);
   124   DescriptorMap<Graph, Edge> edges(graph);
   122   for (NodeIt src(graph); src != INVALID; ++src) {
   125   for (NodeIt src(graph); src != INVALID; ++src) {
   123     for (NodeIt trg(graph); trg != INVALID; ++trg) {
   126     for (NodeIt trg(graph); trg != INVALID; ++trg) {
   124       for (ConEdgeIt<Graph> con(graph, src, trg); con != INVALID; ++con) {
   127       for (ConEdgeIt<Graph> con(graph, src, trg); con != INVALID; ++con) {
   125         check( (graph.u(con) == src && graph.v(con) == trg) ||
   128         check( (graph.u(con) == src && graph.v(con) == trg) ||
   126                (graph.v(con) == src && graph.u(con) == trg), "Wrong end nodes.");
   129                (graph.v(con) == src && graph.u(con) == trg),
       
   130                "Wrong end nodes.");
   127         ++found[con];
   131         ++found[con];
   128         check(found[con] <= 2, "The edge found more than twice.");
   132         check(found[con] <= 2, "The edge found more than twice.");
   129       }
   133       }
   130     }
   134     }
   131   }
   135   }