1.1 --- a/doc/Doxyfile Fri May 07 06:35:02 2004 +0000
1.2 +++ b/doc/Doxyfile Fri May 07 06:57:50 2004 +0000
1.3 @@ -399,7 +399,8 @@
1.4 ../src/work/alpar/list_graph.h \
1.5 ../src/work/athos/minlengthpaths.h \
1.6 ../src/work/klao/path.h \
1.7 - ../src/work/jacint/max_flow.h
1.8 + ../src/work/jacint/max_flow.h \
1.9 + ../src/test/test_tools.h
1.10
1.11 # If the value of the INPUT tag contains directories, you can use the
1.12 # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
2.1 --- a/src/test/Makefile.am Fri May 07 06:35:02 2004 +0000
2.2 +++ b/src/test/Makefile.am Fri May 07 06:57:50 2004 +0000
2.3 @@ -1,9 +1,10 @@
2.4 AM_CPPFLAGS = -I$(top_srcdir)/src
2.5
2.6 -check_PROGRAMS = graph_test time_measure
2.7 +check_PROGRAMS = graph_test dijkstra_test time_measure_test
2.8
2.9 TESTS = $(check_PROGRAMS)
2.10 XFAIL_TESTS =
2.11
2.12 -graph_test_SOURCES = graph_test.cc
2.13 -time_measure_SOURCES = time_measure.cc
2.14 \ No newline at end of file
2.15 +graph_test_SOURCES = graph_test.cc test_tools.h
2.16 +dijkstra_test_SOURCES = dijkstra_test.cc test_tools.h
2.17 +time_measure_test_SOURCES = time_measure_test.cc
2.18 \ No newline at end of file
3.1 --- a/src/test/graph_test.cc Fri May 07 06:35:02 2004 +0000
3.2 +++ b/src/test/graph_test.cc Fri May 07 06:57:50 2004 +0000
3.3 @@ -1,6 +1,8 @@
3.4 #include<iostream>
3.5 #include<hugo/smart_graph.h>
3.6 #include<hugo/skeletons/graph.h>
3.7 +#include"test_tools.h"
3.8 +
3.9 //#include<../work/alpar/list_graph.h>
3.10
3.11 /*
3.12 @@ -12,20 +14,6 @@
3.13
3.14 using namespace hugo;
3.15
3.16 -// void check(bool rc, const char *msg) {
3.17 -// if(!rc) {
3.18 -// std::cerr << msg << std::endl;
3.19 -// exit(1);
3.20 -// }
3.21 -// }
3.22 -
3.23 -#define check(rc, msg) \
3.24 - if(!rc) { \
3.25 - std::cerr << __FILE__ ":" << __LINE__ << ": error: " << msg << std::endl; \
3.26 - exit(1); \
3.27 - } else { } \
3.28 -
3.29 -
3.30 template<class Graph> void checkCompile(Graph &G)
3.31 {
3.32 typedef typename Graph::Node Node;
3.33 @@ -172,31 +160,6 @@
3.34
3.35 }
3.36
3.37 -template<class Graph> struct PetNodes
3.38 -{
3.39 - std::vector<typename Graph::Node> outer, inner;
3.40 - std::vector<typename Graph::Edge> outcir, incir, cons;
3.41 -};
3.42 -
3.43 -template<class Graph> PetNodes<Graph> addPetersen(Graph &G,int num=5)
3.44 -{
3.45 - //std::vector<typename Graph::Node> outer, inner;
3.46 -
3.47 - PetNodes<Graph> n;
3.48 -
3.49 - for(int i=0;i<num;i++) {
3.50 - n.outer.push_back(G.addNode());
3.51 - n.inner.push_back(G.addNode());
3.52 - }
3.53 -
3.54 - for(int i=0;i<num;i++) {
3.55 - n.cons.push_back(G.addEdge(n.outer[i],n.inner[i]));
3.56 - n.outcir.push_back(G.addEdge(n.outer[i],n.outer[(i+1)%5]));
3.57 - n.incir.push_back(G.addEdge(n.inner[i],n.inner[(i+2)%5]));
3.58 - }
3.59 - return n;
3.60 -}
3.61 -
3.62 template<class Graph> void checkNodeList(Graph &G, int nn)
3.63 {
3.64 typename Graph::NodeIt n(G);
4.1 --- a/src/test/time_measure.cc Fri May 07 06:35:02 2004 +0000
4.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
4.3 @@ -1,21 +0,0 @@
4.4 -#include <hugo/time_measure.h>
4.5 -
4.6 -///\file \brief Test cases for time_measure.h
4.7 -///
4.8 -///\todo To be extended
4.9 -
4.10 -
4.11 -using namespace hugo;
4.12 -
4.13 -int main()
4.14 -{
4.15 - int j=0;
4.16 - Timer T;
4.17 - for(int i=0;i++;i<100) j+=2;
4.18 - std::cout << T << '\n';
4.19 - T.reset();
4.20 - for(int i=0;i++;i<100) j+=2;
4.21 - std::cout << T << '\n';
4.22 -
4.23 - return 0;
4.24 -}
5.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
5.2 +++ b/src/test/time_measure_test.cc Fri May 07 06:57:50 2004 +0000
5.3 @@ -0,0 +1,21 @@
5.4 +#include <hugo/time_measure.h>
5.5 +
5.6 +///\file \brief Test cases for time_measure.h
5.7 +///
5.8 +///\todo To be extended
5.9 +
5.10 +
5.11 +using namespace hugo;
5.12 +
5.13 +int main()
5.14 +{
5.15 + int j=0;
5.16 + Timer T;
5.17 + for(int i=0;i<100;i++) j+=2;
5.18 + std::cout << T << '\n';
5.19 + T.reset();
5.20 + for(int i=0;i<100;i++) j+=2;
5.21 + std::cout << T << '\n';
5.22 +
5.23 + return 0;
5.24 +}