Changeset 228:b6732e0d38c5 in lemon for test/digraph_test.cc
- Timestamp:
- 07/21/08 16:30:28 (16 years ago)
- Branch:
- default
- Children:
- 229:aebc0161f6e5, 230:af4e8ba94294
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/digraph_test.cc
r209 r228 25 25 #include "test_tools.h" 26 26 #include "graph_test.h" 27 #include "graph_maps_test.h"28 27 29 28 using namespace lemon; 30 29 using namespace lemon::concepts; 31 30 32 void check_concepts() { 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() { 33 84 { // Checking digraph components 34 85 checkConcept<BaseDigraphComponent, BaseDigraphComponent >(); … … 52 103 checkConcept<ClearableDigraphComponent<>, ListDigraph>(); 53 104 checkConcept<ErasableDigraphComponent<>, ListDigraph>(); 54 checkDigraphIterators<ListDigraph>();55 105 } 56 106 { // Checking SmartDigraph … … 59 109 checkConcept<ExtendableDigraphComponent<>, SmartDigraph>(); 60 110 checkConcept<ClearableDigraphComponent<>, SmartDigraph>(); 61 checkDigraphIterators<SmartDigraph>();62 111 } 63 112 // { // Checking FullDigraph 64 113 // checkConcept<Digraph, FullDigraph>(); 65 // checkDigraphIterators<FullDigraph>();66 114 // } 67 115 // { // Checking HyperCubeDigraph 68 116 // checkConcept<Digraph, HyperCubeDigraph>(); 69 // checkDigraphIterators<HyperCubeDigraph>();70 117 // } 71 118 } 72 119 73 120 template <typename Digraph> 74 void check _graph_validity() {121 void checkDigraphValidity() { 75 122 TEMPLATE_DIGRAPH_TYPEDEFS(Digraph); 76 123 Digraph g; … … 93 140 94 141 template <typename Digraph> 95 void check _graph_validity_erase() {142 void checkDigraphValidityErase() { 96 143 TEMPLATE_DIGRAPH_TYPEDEFS(Digraph); 97 144 Digraph g; … … 121 168 } 122 169 123 void check _digraphs() {170 void checkDigraphs() { 124 171 { // Checking ListDigraph 125 172 checkDigraph<ListDigraph>(); 126 checkGraphNodeMap<ListDigraph>(); 127 checkGraphArcMap<ListDigraph>(); 128 129 check_graph_validity_erase<ListDigraph>(); 173 checkDigraphValidityErase<ListDigraph>(); 130 174 } 131 175 { // Checking SmartDigraph 132 176 checkDigraph<SmartDigraph>(); 133 checkGraphNodeMap<SmartDigraph>(); 134 checkGraphArcMap<SmartDigraph>(); 135 136 check_graph_validity<SmartDigraph>(); 177 checkDigraphValidity<SmartDigraph>(); 137 178 } 138 179 } 139 180 140 181 int main() { 141 check _concepts();142 check _digraphs();182 checkDigraphs(); 183 checkConcepts(); 143 184 return 0; 144 185 }
Note: See TracChangeset
for help on using the changeset viewer.