src/test/graph_wrapper_test.cc
changeset 882 46974f296c4a
parent 873 f3a30fda2e49
child 891 74589d20dbc3
equal deleted inserted replaced
2:f9db21aca322 1:36cdc148dcbb
     8 #include"test/test_tools.h"
     8 #include"test/test_tools.h"
     9 #include"test/graph_test.h"
     9 #include"test/graph_test.h"
    10 
    10 
    11 /**
    11 /**
    12 \file
    12 \file
    13 This test makes consistency checks of list graph structures.
    13 This test makes consistency checks of graph wrappers.
    14 
    14 
    15 G.addNode(), G.addEdge(), G.tail(), G.head()
    15 \todo More extensive tests are needed 
    16 
       
    17 \todo Checks for empty graphs and isolated points.
       
    18 conversion.
       
    19 */
    16 */
    20 
    17 
    21 using namespace hugo;
    18 using namespace hugo;
    22 
    19 
    23 // template<class Graph> void bidirPetersen(Graph &G)
       
    24 // {
       
    25 //   typedef typename Graph::Edge Edge;
       
    26 //   typedef typename Graph::EdgeIt EdgeIt;
       
    27   
       
    28 //   checkGraphEdgeList(G,15);
       
    29   
       
    30 //   std::vector<Edge> ee;
       
    31   
       
    32 //   for(EdgeIt e(G);e!=INVALID;++e) ee.push_back(e);
       
    33 
       
    34 //   for(typename std::vector<Edge>::iterator p=ee.begin();p!=ee.end();p++)
       
    35 //     G.addEdge(G.head(*p),G.tail(*p));
       
    36 // }
       
    37 
       
    38 // template<class Graph> void checkPetersen(Graph &G)
       
    39 // {
       
    40 //   typedef typename Graph::Node Node;
       
    41 
       
    42 //   typedef typename Graph::EdgeIt EdgeIt;
       
    43 //   typedef typename Graph::NodeIt NodeIt;
       
    44 
       
    45 //   checkGraphNodeList(G,10);
       
    46 //   checkGraphEdgeList(G,30);
       
    47 
       
    48 //   for(NodeIt n(G);n!=INVALID;++n) {
       
    49 //     checkGraphInEdgeList(G,n,3);
       
    50 //     checkGraphOutEdgeList(G,n,3);
       
    51 //     ++n;
       
    52 //   }  
       
    53 // }
       
    54 
       
    55 // //Compile GraphSkeleton
       
    56 // template void checkCompileStaticGraph<skeleton::StaticGraphSkeleton>
       
    57 // (skeleton::StaticGraphSkeleton &);
       
    58 
       
    59 // template void checkCompileGraph<skeleton::ExtendableGraphSkeleton>
       
    60 // (skeleton::ExtendableGraphSkeleton &);
       
    61 
       
    62 // template void checkCompileErasableGraph<skeleton::ErasableGraphSkeleton>
       
    63 // (skeleton::ErasableGraphSkeleton &);
       
    64 
    20 
    65 //Compile SmartGraph
    21 //Compile SmartGraph
    66 typedef SmartGraph Graph;
    22 typedef SmartGraph Graph;
    67 typedef GraphWrapper<Graph> GW;
    23 typedef GraphWrapper<Graph> GW;
    68 template void checkCompileStaticGraph<GW>(GW &);
    24 template void checkCompileStaticGraph<GW>(GW &);
    71 //Compile SymSmartGraph
    27 //Compile SymSmartGraph
    72 typedef RevGraphWrapper<Graph> RevGW;
    28 typedef RevGraphWrapper<Graph> RevGW;
    73 template void checkCompileStaticGraph<RevGW>(RevGW &);
    29 template void checkCompileStaticGraph<RevGW>(RevGW &);
    74 //template void checkCompileGraphFindEdge<SymSmartGraph>(SymSmartGraph &);
    30 //template void checkCompileGraphFindEdge<SymSmartGraph>(SymSmartGraph &);
    75 
    31 
    76 // //Compile ListGraph
       
    77 // template void checkCompileGraph<ListGraph>(ListGraph &);
       
    78 // template void checkCompileErasableGraph<ListGraph>(ListGraph &);
       
    79 // template void checkCompileGraphFindEdge<ListGraph>(ListGraph &);
       
    80 
       
    81 
       
    82 // //Compile SymListGraph
       
    83 // template void checkCompileGraph<SymListGraph>(SymListGraph &);
       
    84 // template void checkCompileErasableGraph<SymListGraph>(SymListGraph &);
       
    85 // template void checkCompileGraphFindEdge<SymListGraph>(SymListGraph &);
       
    86 
       
    87 // //Compile FullGraph
       
    88 // template void checkCompileStaticGraph<FullGraph>(FullGraph &);
       
    89 // template void checkCompileGraphFindEdge<FullGraph>(FullGraph &);
       
    90 
       
    91 // //Compile EdgeSet <ListGraph>
       
    92 // template void checkCompileGraph<EdgeSet <ListGraph> >(EdgeSet <ListGraph> &);
       
    93 // template void checkCompileGraphEraseEdge<EdgeSet <ListGraph> >
       
    94 // (EdgeSet <ListGraph> &);
       
    95 // template void checkCompileGraphFindEdge<EdgeSet <ListGraph> >
       
    96 // (EdgeSet <ListGraph> &);
       
    97 
       
    98 // //Compile EdgeSet <NodeSet>
       
    99 // template void checkCompileGraph<EdgeSet <NodeSet> >(EdgeSet <NodeSet> &);
       
   100 // template void checkCompileGraphEraseEdge<EdgeSet <NodeSet> >
       
   101 // (EdgeSet <NodeSet> &);
       
   102 // template void checkCompileGraphFindEdge<EdgeSet <NodeSet> >
       
   103 // (EdgeSet <NodeSet> &);
       
   104 
       
   105 
    32 
   106 int main() 
    33 int main() 
   107 {
    34 {
   108  //  {
       
   109 //     SmartGraph G;
       
   110 //     addPetersen(G);
       
   111 //     bidirPetersen(G);
       
   112 //     checkPetersen(G);
       
   113 //   }
       
   114 //   {
       
   115 //     ListGraph G;
       
   116 //     addPetersen(G);
       
   117 //     bidirPetersen(G);
       
   118 //     checkPetersen(G);
       
   119 //   }
       
   120 //   {
       
   121 //     SymSmartGraph G;
       
   122 //     addPetersen(G);
       
   123 //     checkPetersen(G);
       
   124 //   }
       
   125 //   {
       
   126 //     SymListGraph G;
       
   127 //     addPetersen(G);
       
   128 //     checkPetersen(G);
       
   129 //   }
       
   130 
       
   131   ///\file
       
   132   ///\todo map tests.
       
   133   ///\todo copy constr tests.
       
   134 
       
   135   std::cout << __FILE__ ": All tests passed.\n";
    35   std::cout << __FILE__ ": All tests passed.\n";
   136 
    36 
   137   return 0;
    37   return 0;
   138 }
    38 }