[Lemon-commits] [lemon_svn] alpar: r1087 - hugo/trunk/src/test

Lemon SVN svn at lemon.cs.elte.hu
Mon Nov 6 20:43:10 CET 2006


Author: alpar
Date: Fri Sep  3 11:41:50 2004
New Revision: 1087

Modified:
   hugo/trunk/src/test/bfs_test.cc
   hugo/trunk/src/test/dfs_test.cc
   hugo/trunk/src/test/dijkstra_test.cc
   hugo/trunk/src/test/graph_test.cc
   hugo/trunk/src/test/unionfind_test.cc

Log:
- BFD/DFS/Dijkstra compile test is done with skeleton::GraphSkeleton graph
  and skeleton::ReadMap.
- 'skeleton::' is explicitely written instead of 'using namespace ...'
  in graph_test.cc
- Output messages of type "makeRep(3)..." in unionfind_test.cc have been
  changed in order not to confuse compiler output parsers.


Modified: hugo/trunk/src/test/bfs_test.cc
==============================================================================
--- hugo/trunk/src/test/bfs_test.cc	(original)
+++ hugo/trunk/src/test/bfs_test.cc	Fri Sep  3 11:41:50 2004
@@ -1,34 +1,32 @@
 #include "test_tools.h"
 #include <hugo/smart_graph.h>
 #include <hugo/bfs.h>
+#include<hugo/skeletons/graph.h>
 
 using namespace hugo;
 
 const int PET_SIZE =5;
 
 
-void check_Bfs_SmartGraph_Compile() 
+void check_Bfs_Compile() 
 {
-  typedef int VType;
-  typedef SmartGraph Graph;
+  typedef skeleton::StaticGraphSkeleton Graph;
 
   typedef Graph::Edge Edge;
   typedef Graph::Node Node;
   typedef Graph::EdgeIt EdgeIt;
   typedef Graph::NodeIt NodeIt;
-  typedef Graph::EdgeMap<VType> LengthMap;
  
   typedef Bfs<Graph> BType;
   
   Graph G;
   Node n;
   Edge e;
-  VType l;
+  int l;
   bool b;
   BType::DistMap d(G);
   BType::PredMap p(G);
   BType::PredNodeMap pn(G);
-  LengthMap cap(G);
   
   BType bfs_test(G);
   

Modified: hugo/trunk/src/test/dfs_test.cc
==============================================================================
--- hugo/trunk/src/test/dfs_test.cc	(original)
+++ hugo/trunk/src/test/dfs_test.cc	Fri Sep  3 11:41:50 2004
@@ -1,6 +1,7 @@
 #include "test_tools.h"
 #include <hugo/smart_graph.h>
 #include <hugo/dfs.h>
+#include<hugo/skeletons/graph.h>
 
 using namespace hugo;
 
@@ -9,28 +10,25 @@
 
 void check_Dfs_SmartGraph_Compile() 
 {
-  typedef int VType;
-  typedef SmartGraph Graph;
+  typedef skeleton::StaticGraphSkeleton Graph;
 
   typedef Graph::Edge Edge;
   typedef Graph::Node Node;
   typedef Graph::EdgeIt EdgeIt;
   typedef Graph::NodeIt NodeIt;
-  typedef Graph::EdgeMap<VType> LengthMap;
  
-  typedef Dfs<Graph> BType;
+  typedef Dfs<Graph> DType;
   
   Graph G;
   Node n;
   Edge e;
-  VType l;
+  int l;
   bool b;
-  BType::DistMap d(G);
-  BType::PredMap p(G);
-  BType::PredNodeMap pn(G);
-  LengthMap cap(G);
+  DType::DistMap d(G);
+  DType::PredMap p(G);
+  DType::PredNodeMap pn(G);
   
-  BType dfs_test(G);
+  DType dfs_test(G);
   
   dfs_test.run(n);
   

Modified: hugo/trunk/src/test/dijkstra_test.cc
==============================================================================
--- hugo/trunk/src/test/dijkstra_test.cc	(original)
+++ hugo/trunk/src/test/dijkstra_test.cc	Fri Sep  3 11:41:50 2004
@@ -1,22 +1,23 @@
 #include "test_tools.h"
 #include <hugo/smart_graph.h>
 #include <hugo/dijkstra.h>
-
+#include<hugo/skeletons/graph.h>
+#include<hugo/skeletons/maps.h>
 using namespace hugo;
 
 const int PET_SIZE =5;
 
 
-void check_Dijkstra_SmartGraph_BinHeap_Compile() 
+void check_Dijkstra_BinHeap_Compile() 
 {
   typedef int VType;
-  typedef SmartGraph Graph;
+  typedef skeleton::StaticGraphSkeleton Graph;
 
   typedef Graph::Edge Edge;
   typedef Graph::Node Node;
   typedef Graph::EdgeIt EdgeIt;
   typedef Graph::NodeIt NodeIt;
-  typedef Graph::EdgeMap<VType> LengthMap;
+  typedef skeleton::ReadMap<Edge,VType> LengthMap;
  
   typedef Dijkstra<Graph, LengthMap> DType;
   
@@ -28,7 +29,7 @@
   DType::DistMap d(G);
   DType::PredMap p(G);
   DType::PredNodeMap pn(G);
-  LengthMap cap(G);
+  LengthMap cap;
 
   DType dijkstra_test(G,cap);
 

Modified: hugo/trunk/src/test/graph_test.cc
==============================================================================
--- hugo/trunk/src/test/graph_test.cc	(original)
+++ hugo/trunk/src/test/graph_test.cc	Fri Sep  3 11:41:50 2004
@@ -18,7 +18,6 @@
 */
 
 using namespace hugo;
-using namespace hugo::skeleton;
 
 template<class Graph> void checkCompileStaticGraph(Graph &G) 
 {
@@ -341,11 +340,13 @@
 }
 
 //Compile GraphSkeleton
-template 
-void checkCompileStaticGraph<StaticGraphSkeleton>(StaticGraphSkeleton &);
-template void checkCompile<GraphSkeleton>(GraphSkeleton &);
-template
-void checkCompileErase<EraseableGraphSkeleton>(EraseableGraphSkeleton &);
+template void checkCompileStaticGraph<skeleton::StaticGraphSkeleton>
+(skeleton::StaticGraphSkeleton &);
+
+template void checkCompile<skeleton::GraphSkeleton>(skeleton::GraphSkeleton &);
+
+template void checkCompileErase<skeleton::EraseableGraphSkeleton>
+(skeleton::EraseableGraphSkeleton &);
 
 //Compile SmartGraph
 template void checkCompile<SmartGraph>(SmartGraph &);

Modified: hugo/trunk/src/test/unionfind_test.cc
==============================================================================
--- hugo/trunk/src/test/unionfind_test.cc	(original)
+++ hugo/trunk/src/test/unionfind_test.cc	Fri Sep  3 11:41:50 2004
@@ -162,13 +162,13 @@
   cout << "Size of the class of 2: " << U.size(2) << endl;
   check(U.size(2) == 3,"Test failed.");
 
-  cout << "makeRep(4)..." << endl;
+  cout << "Calling makeRep(4)..." << endl;
   U.makeRep(4);
 //   print(U);
-  cout << "makeRep(3)..." << endl;
+  cout << "Calling makeRep(3)..." << endl;
   U.makeRep(3);
 //   print(U);
-  cout << "makeRep(2)..." << endl;
+  cout << "Calling makeRep(2)..." << endl;
   U.makeRep(2);
 //   print(U);
 



More information about the Lemon-commits mailing list