Changes in test/digraph_test.cc [228:b6732e0d38c5:209:765619b7cbb2] in lemon-main
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/digraph_test.cc
r228 r209 25 25 #include "test_tools.h" 26 26 #include "graph_test.h" 27 #include "graph_maps_test.h" 27 28 28 29 using namespace lemon; 29 30 using namespace lemon::concepts; 30 31 31 template <class Digraph> 32 void checkDigraph() { 33 TEMPLATE_DIGRAPH_TYPEDEFS(Digraph); 34 Digraph G; 35 36 checkGraphNodeList(G, 0); 37 checkGraphArcList(G, 0); 38 39 Node 40 n1 = G.addNode(), 41 n2 = G.addNode(), 42 n3 = G.addNode(); 43 checkGraphNodeList(G, 3); 44 checkGraphArcList(G, 0); 45 46 Arc a1 = G.addArc(n1, n2); 47 check(G.source(a1) == n1 && G.target(a1) == n2, "Wrong arc"); 48 checkGraphNodeList(G, 3); 49 checkGraphArcList(G, 1); 50 51 checkGraphOutArcList(G, n1, 1); 52 checkGraphOutArcList(G, n2, 0); 53 checkGraphOutArcList(G, n3, 0); 54 55 checkGraphInArcList(G, n1, 0); 56 checkGraphInArcList(G, n2, 1); 57 checkGraphInArcList(G, n3, 0); 58 59 checkGraphConArcList(G, 1); 60 61 Arc a2 = G.addArc(n2, n1), a3 = G.addArc(n2, n3), a4 = G.addArc(n2, n3); 62 checkGraphNodeList(G, 3); 63 checkGraphArcList(G, 4); 64 65 checkGraphOutArcList(G, n1, 1); 66 checkGraphOutArcList(G, n2, 3); 67 checkGraphOutArcList(G, n3, 0); 68 69 checkGraphInArcList(G, n1, 1); 70 checkGraphInArcList(G, n2, 1); 71 checkGraphInArcList(G, n3, 2); 72 73 checkGraphConArcList(G, 4); 74 75 checkNodeIds(G); 76 checkArcIds(G); 77 checkGraphNodeMap(G); 78 checkGraphArcMap(G); 79 80 } 81 82 83 void checkConcepts() { 32 void check_concepts() { 84 33 { // Checking digraph components 85 34 checkConcept<BaseDigraphComponent, BaseDigraphComponent >(); … … 103 52 checkConcept<ClearableDigraphComponent<>, ListDigraph>(); 104 53 checkConcept<ErasableDigraphComponent<>, ListDigraph>(); 54 checkDigraphIterators<ListDigraph>(); 105 55 } 106 56 { // Checking SmartDigraph … … 109 59 checkConcept<ExtendableDigraphComponent<>, SmartDigraph>(); 110 60 checkConcept<ClearableDigraphComponent<>, SmartDigraph>(); 61 checkDigraphIterators<SmartDigraph>(); 111 62 } 112 63 // { // Checking FullDigraph 113 64 // checkConcept<Digraph, FullDigraph>(); 65 // checkDigraphIterators<FullDigraph>(); 114 66 // } 115 67 // { // Checking HyperCubeDigraph 116 68 // checkConcept<Digraph, HyperCubeDigraph>(); 69 // checkDigraphIterators<HyperCubeDigraph>(); 117 70 // } 118 71 } 119 72 120 73 template <typename Digraph> 121 void check DigraphValidity() {74 void check_graph_validity() { 122 75 TEMPLATE_DIGRAPH_TYPEDEFS(Digraph); 123 76 Digraph g; … … 140 93 141 94 template <typename Digraph> 142 void check DigraphValidityErase() {95 void check_graph_validity_erase() { 143 96 TEMPLATE_DIGRAPH_TYPEDEFS(Digraph); 144 97 Digraph g; … … 168 121 } 169 122 170 void check Digraphs() {123 void check_digraphs() { 171 124 { // Checking ListDigraph 172 125 checkDigraph<ListDigraph>(); 173 checkDigraphValidityErase<ListDigraph>(); 126 checkGraphNodeMap<ListDigraph>(); 127 checkGraphArcMap<ListDigraph>(); 128 129 check_graph_validity_erase<ListDigraph>(); 174 130 } 175 131 { // Checking SmartDigraph 176 132 checkDigraph<SmartDigraph>(); 177 checkDigraphValidity<SmartDigraph>(); 133 checkGraphNodeMap<SmartDigraph>(); 134 checkGraphArcMap<SmartDigraph>(); 135 136 check_graph_validity<SmartDigraph>(); 178 137 } 179 138 } 180 139 181 140 int main() { 182 check Digraphs();183 check Concepts();141 check_concepts(); 142 check_digraphs(); 184 143 return 0; 185 144 }
Note: See TracChangeset
for help on using the changeset viewer.