test/graph_utils_test.cc
changeset 1681 84e43c7ca1e3
parent 1459 2ee881cf30a8
child 1728 eb8bb91ba9e2
equal deleted inserted replaced
1:4fc3f0e8586d 2:aca35f221c86
    48 
    48 
    49 int main() {
    49 int main() {
    50   ///\file
    50   ///\file
    51   { // checking list graph
    51   { // checking list graph
    52     checkGraphCounters<ListGraph>();
    52     checkGraphCounters<ListGraph>();
       
    53     checkFindEdge<ListGraph>();
    53   }
    54   }
    54   { // checking smart graph
    55   { // checking smart graph
    55     checkGraphCounters<SmartGraph>();
    56     checkGraphCounters<SmartGraph>();
       
    57     checkFindEdge<SmartGraph>();
    56   }
    58   }
    57   {
    59   {
    58     int num = 5;
    60     int num = 5;
    59     FullGraph fg(num);
    61     FullGraph fg(num);
    60     check(countNodes(fg) == num, "FullGraph: wrong node number.");
    62     check(countNodes(fg) == num, "FullGraph: wrong node number.");
    61     check(countEdges(fg) == num*num, "FullGraph: wrong edge number.");    
    63     check(countEdges(fg) == num*num, "FullGraph: wrong edge number.");
       
    64     for (FullGraph::NodeIt src(fg); src != INVALID; ++src) {
       
    65       for (FullGraph::NodeIt trg(fg); trg != INVALID; ++trg) {
       
    66 	ConEdgeIt<FullGraph> con(fg, src, trg);
       
    67 	check(con != INVALID, "There is no connecting edge.");
       
    68 	check(fg.source(con) == src, "Wrong source.");
       
    69 	check(fg.target(con) == trg, "Wrong target.");
       
    70 	check(++con == INVALID, "There is more connecting edge.");
       
    71       }
       
    72     }
    62   }
    73   }
    63 
    74 
    64   //check In/OutDegMap (and SnapShot feature)
    75   //check In/OutDegMap (and SnapShot feature)
    65 
    76 
    66   checkSnapDeg<ListGraph>();
    77   checkSnapDeg<ListGraph>();