Changeset 1909:2d806130e700 in lemon-0.x for test
- Timestamp:
- 01/26/06 16:42:13 (18 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2484
- Location:
- test
- Files:
-
- 5 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
test/Makefile.am
r1901 r1909 34 34 time_measure_test \ 35 35 unionfind_test \ 36 u ndir_graph_test \36 ugraph_test \ 37 37 xy_test \ 38 38 heap_test … … 71 71 unionfind_test_SOURCES = unionfind_test.cc 72 72 xy_test_SOURCES = xy_test.cc 73 u ndir_graph_test_SOURCES = undir_graph_test.cc73 ugraph_test_SOURCES = ugraph_test.cc 74 74 heap_test_SOURCES = heap_test.cc 75 75 -
test/graph_adaptor_test.cc
r1875 r1909 20 20 #include<lemon/smart_graph.h> 21 21 #include<lemon/concept/graph.h> 22 #include<lemon/concept/u ndir_graph.h>22 #include<lemon/concept/ugraph.h> 23 23 24 24 #include<lemon/list_graph.h> … … 66 66 67 67 /// \bug why does not compile with StaticGraph 68 checkConcept<BaseIterableU ndirGraphConcept, UndirGraphAdaptor<ListGraph> >();69 checkConcept<IterableU ndirGraphConcept, UndirGraphAdaptor<ListGraph> >();70 checkConcept<MappableU ndirGraphConcept, UndirGraphAdaptor<ListGraph> >();68 checkConcept<BaseIterableUGraphConcept, UGraphAdaptor<ListGraph> >(); 69 checkConcept<IterableUGraphConcept, UGraphAdaptor<ListGraph> >(); 70 checkConcept<MappableUGraphConcept, UGraphAdaptor<ListGraph> >(); 71 71 } 72 72 std::cout << __FILE__ ": All tests passed.\n"; -
test/max_matching_test.cc
r1875 r1909 32 32 int main() { 33 33 34 typedef UndirListGraph Graph;34 typedef ListUGraph Graph; 35 35 36 36 typedef Graph::Edge Edge; 37 typedef Graph::U ndirEdgeIt UndirEdgeIt;37 typedef Graph::UEdgeIt UEdgeIt; 38 38 typedef Graph::IncEdgeIt IncEdgeIt; 39 39 typedef Graph::NodeIt NodeIt; … … 139 139 140 140 bool noedge=true; 141 for(U ndirEdgeIt e(g); e!=INVALID; ++e) {141 for(UEdgeIt e(g); e!=INVALID; ++e) { 142 142 if ( (pos[g.target(e)]==max_matching.C && pos[g.source(e)]==max_matching.D) || 143 143 (pos[g.target(e)]==max_matching.D && pos[g.source(e)]==max_matching.C) ) -
test/path_test.cc
r1875 r1909 90 90 template void checkCompilePath< concept::Path<ListGraph> >(concept::Path<ListGraph> &); 91 91 template void checkCompilePath< DirPath<ListGraph> >(DirPath<ListGraph> &); 92 template void checkCompilePath< U ndirPath<ListGraph> >(UndirPath<ListGraph> &);92 template void checkCompilePath< UPath<ListGraph> >(UPath<ListGraph> &); 93 93 94 94 int main() -
test/test_tools.h
r1875 r1909 134 134 } 135 135 136 ///Structure returned by \ref addU ndirPetersen().136 ///Structure returned by \ref addUPetersen(). 137 137 138 ///Structure returned by \ref addU ndirPetersen().138 ///Structure returned by \ref addUPetersen(). 139 139 /// 140 template<class Graph> struct U ndirPetStruct140 template<class Graph> struct UPetStruct 141 141 { 142 142 ///Vector containing the outer nodes. … … 145 145 std::vector<typename Graph::Node> inner; 146 146 ///Vector containing the edges of the inner circle. 147 std::vector<typename Graph::U ndirEdge> incir;147 std::vector<typename Graph::UEdge> incir; 148 148 ///Vector containing the edges of the outer circle. 149 std::vector<typename Graph::U ndirEdge> outcir;149 std::vector<typename Graph::UEdge> outcir; 150 150 ///Vector containing the chord edges. 151 std::vector<typename Graph::U ndirEdge> chords;151 std::vector<typename Graph::UEdge> chords; 152 152 }; 153 153 … … 158 158 159 159 template<typename Graph> 160 U ndirPetStruct<Graph> addUndirPetersen(Graph &G,int num=5)160 UPetStruct<Graph> addUPetersen(Graph &G,int num=5) 161 161 { 162 U ndirPetStruct<Graph> n;162 UPetStruct<Graph> n; 163 163 164 164 for(int i=0;i<num;i++) { -
test/ugraph_test.cc
r1795 r1909 2 2 3 3 #include <lemon/bits/graph_extender.h> 4 #include <lemon/concept/u ndir_graph.h>4 #include <lemon/concept/ugraph.h> 5 5 #include <lemon/list_graph.h> 6 6 #include <lemon/smart_graph.h> … … 17 17 18 18 void check_concepts() { 19 typedef U ndirGraphExtender<ListGraphBase> UndirListGraphBase;20 21 typedef IterableU ndirGraphExtender<22 AlterableU ndirGraphExtender<UndirListGraphBase> > IterableUndirListGraph;23 24 typedef MappableU ndirGraphExtender<IterableUndirListGraph>25 Mappable UndirListGraph;26 27 typedef ErasableU ndirGraphExtender<28 ClearableU ndirGraphExtender<29 ExtendableU ndirGraphExtender<MappableUndirListGraph> > > Graph;30 31 checkConcept<BaseIterableU ndirGraphConcept, Graph>();32 checkConcept<IterableU ndirGraphConcept, Graph>();33 checkConcept<MappableU ndirGraphConcept, Graph>();34 35 checkConcept<U ndirGraph, Graph>();36 checkConcept<ErasableU ndirGraph, Graph>();37 38 checkConcept<U ndirGraph, UndirListGraph>();39 checkConcept<ErasableU ndirGraph, UndirListGraph>();40 41 checkConcept<U ndirGraph, UndirSmartGraph>();42 checkConcept<ExtendableU ndirGraph, UndirSmartGraph>();43 44 checkConcept<U ndirGraph, UndirFullGraph>();45 46 checkConcept<U ndirGraph, UndirGraph>();47 48 checkConcept<U ndirGraph, GridGraph>();19 typedef UGraphExtender<ListGraphBase> ListUGraphBase; 20 21 typedef IterableUGraphExtender< 22 AlterableUGraphExtender<ListUGraphBase> > IterableListUGraph; 23 24 typedef MappableUGraphExtender<IterableListUGraph> 25 MappableListUGraph; 26 27 typedef ErasableUGraphExtender< 28 ClearableUGraphExtender< 29 ExtendableUGraphExtender<MappableListUGraph> > > Graph; 30 31 checkConcept<BaseIterableUGraphConcept, Graph>(); 32 checkConcept<IterableUGraphConcept, Graph>(); 33 checkConcept<MappableUGraphConcept, Graph>(); 34 35 checkConcept<UGraph, Graph>(); 36 checkConcept<ErasableUGraph, Graph>(); 37 38 checkConcept<UGraph, ListUGraph>(); 39 checkConcept<ErasableUGraph, ListUGraph>(); 40 41 checkConcept<UGraph, SmartUGraph>(); 42 checkConcept<ExtendableUGraph, SmartUGraph>(); 43 44 checkConcept<UGraph, FullUGraph>(); 45 46 checkConcept<UGraph, UGraph>(); 47 48 checkConcept<UGraph, GridGraph>(); 49 49 } 50 50 … … 68 68 69 69 int uee = 0; 70 for (typename Graph::U ndirEdgeIt it(g); it != INVALID; ++it) {70 for (typename Graph::UEdgeIt it(g); it != INVALID; ++it) { 71 71 ++uee; 72 72 } 73 73 74 check(uee == e, "Wrong u ndiredge number.");75 check(countU ndirEdges(g) == e, "Wrong undiredge number.");74 check(uee == e, "Wrong uedge number."); 75 check(countUEdges(g) == e, "Wrong uedge number."); 76 76 } 77 77 … … 80 80 81 81 typedef typename Graph::NodeIt NodeIt; 82 typedef typename Graph::U ndirEdgeIt UEdgeIt;82 typedef typename Graph::UEdgeIt UEdgeIt; 83 83 typedef typename Graph::EdgeIt EdgeIt; 84 84 … … 89 89 } 90 90 91 std::cout << "U ndirEdge" << std::endl;91 std::cout << "UEdge" << std::endl; 92 92 i=0; 93 93 for(UEdgeIt it(g); it!=INVALID; ++it, ++i) { … … 111 111 112 112 typedef typename Graph::Node Node; 113 typedef typename Graph::U ndirEdge UEdge;113 typedef typename Graph::UEdge UEdge; 114 114 typedef typename Graph::Edge Edge; 115 115 typedef typename Graph::NodeIt NodeIt; 116 typedef typename Graph::U ndirEdgeIt UEdgeIt;116 typedef typename Graph::UEdgeIt UEdgeIt; 117 117 typedef typename Graph::EdgeIt EdgeIt; 118 118 … … 182 182 check_concepts(); 183 183 184 check_graph< UndirListGraph>();185 check_graph< UndirSmartGraph>();184 check_graph<ListUGraph>(); 185 check_graph<SmartUGraph>(); 186 186 187 187 { 188 UndirFullGraph g(5);188 FullUGraph g(5); 189 189 check_item_counts(g, 5, 10); 190 190 }
Note: See TracChangeset
for help on using the changeset viewer.