Index: src/test/path_test.cc
===================================================================
--- src/test/path_test.cc	(revision 823)
+++ src/test/path_test.cc	(revision 831)
@@ -1,190 +1,84 @@
 #include <string>
 #include <iostream>
-//#include <hugo/path.h>
 #include <hugo/skeletons/path.h>
+#include <hugo/path.h>
 #include <hugo/list_graph.h>
 
 using namespace std;
 using namespace hugo;
-#ifdef SKELETON
 using namespace skeleton;
-#endif
 
-bool passed = true;
+template<class Path> void checkCompilePath(Path &P) 
+{
+  typedef typename Path::EdgeIt EdgeIt;
+  typedef typename Path::NodeIt NodeIt;
+  typedef typename Path::GraphNode GraphNode;
+  typedef typename Path::GraphEdge GraphEdge;
+  //typedef typename Path::Builder Builder;
+  //??? ha csinalok ilyet es siman Builderrel peldanyositok, akkor warningol. Talan friend miatt? De ki az?
 
-void check(bool rc) {
-  passed = passed && rc;
-  if(!rc) {
-    cout << "Test failed!" << endl;
-  }
+  EdgeIt ei;
+  NodeIt ni;
+  GraphNode gn;
+  GraphEdge ge;
+
+  size_t st;
+  bool b;
+
+  //Path(const Graph &_G) {}      //the constructor has been already called
+
+  st=P.length();                  //size_t length() const {return 0;}
+  b=P.empty();                    //bool empty() const {}
+  P.clear();                      //void clear() {}
+
+  gn=P.head();                    //GraphNode/*It*/ head() const {return INVALID;}
+  gn=P.tail();                    //GraphNode/*It*/ tail() const {return INVALID;}
+
+  ei=P.first(ei);                 //It& first(It &i) const { return i=It(*this); }
+
+  ni=P.head(ei);                  //NodeIt head(const EdgeIt& e) const {}
+  ni=P.tail(ei);                  //NodeIt tail(const EdgeIt& e) const {}
+
+
+  ListGraph lg;
+  Path p(lg);
+
+  EdgeIt i;	                  //EdgeIt() {}
+  EdgeIt j(INVALID);	          //EdgeIt(Invalid) {}
+  EdgeIt k(p);	                  //EdgeIt(const Path &_p) {}
+
+  //??? operator GraphEdge () const {}
+
+  //INVALIDra megy a ++????
+  i=++j;	                  //EdgeIt& operator++() {}
+  b=(i==j);	                  //bool operator==(const EdgeIt& e) const {return true;}
+  b=(i!=j);	                  //bool operator!=(const EdgeIt& e) const {return true;}
+
+
+  NodeIt l;                       //NodeIt() {}
+  NodeIt m(INVALID);	          //NodeIt(Invalid) {}
+  NodeIt n(p);	                  //NodeIt(const Path &_p) {}
+
+  //operator const GraphNode& () const {}
+
+  l=++m;                          //NodeIt& operator++() {}
+  b=(m==n);                       //bool operator==(const NodeIt& e) const {}
+  b=(m!=n);                   	  //bool operator!=(const NodeIt& e) const {}
+
+  typename Path::Builder builder(p);     //Builder(Path &_P) : P(_P) {}
+  builder.setStartNode(gn);     	 //void setStartNode(const GraphNode &) {}
+  builder.pushFront(ge);	         //void pushFront(const GraphEdge& e) {}
+  builder.pushBack(ge);	                 //void pushBack(const GraphEdge& e) {}
+  builder.commit();	                 //void commit() {}
+  builder.reserveFront(st);	         //void reserveFront(size_t r) {}
+  builder.reserveBack(st);	         //void reserveBack(size_t r) {}
+
 }
 
-#ifdef DEBUG
-const bool debug = true;
-#else
-const bool debug = false;
-#endif
+template void checkCompilePath< skeleton::Path<ListGraph> >(skeleton::Path<ListGraph> &);
+template void checkCompilePath< DirPath<ListGraph> >(DirPath<ListGraph> &);
+template void checkCompilePath< UndirPath<ListGraph> >(UndirPath<ListGraph> &);
 
-
-int main() {
-
-  try {
-
-    typedef ListGraph::Node Node;
-    typedef ListGraph::Edge Edge;
-
-    ListGraph G;
-
-    Node s=G.addNode();
-    Node v1=G.addNode();
-    Node v2=G.addNode();
-    Node v3=G.addNode();
-    Node v4=G.addNode();
-    Node t=G.addNode();
-  
-    Edge e1 = G.addEdge(s, v1);
-    Edge e2 = G.addEdge(s, v2);
-    Edge e3 = G.addEdge(v1, v2);
-    Edge e4 = G.addEdge(v2, v1);
-    Edge e5 = G.addEdge(v1, v3);
-    Edge e6 = G.addEdge(v3, v2);
-    Edge e7 = G.addEdge(v2, v4);
-    Edge e8 = G.addEdge(v4, v3);
-    Edge e9 = G.addEdge(v3, t);
-    Edge e10 = G.addEdge(v4, t);
-
-#ifdef DEBUG
-    bool rc;
-#endif
-
-    {
-      cout << "\n\n\nDirPath tesztelese...\n";
-
-
-      cout << "Ures path letrehozasa" << endl;
-#ifdef SKELETON
-      typedef Path <ListGraph> DPath;
-#else
-      typedef DirPath<ListGraph> DPath;
-#endif
-      DPath P(G);
-
-      cout << "P.length() == " << P.length() << endl;
-      check(P.length() == 0);
-
-#ifdef SKELETON
-      cout << "P.tail() valid? " << (P.tail()!=INVALID) << endl;
-      check(! (P.tail()!=INVALID));
-#else
-      cout << "P.tail() valid? " << (P.from()!=INVALID) << endl;
-      check(! (P.to()!=INVALID));
-#endif
-      {
-	cout << "Builder objektum letrehozasa" << endl;
-	DPath::Builder B(P);
-
-	cout << "Hozzaadunk az elejehez ket elet..." << endl;
-	B.pushFront(e6);
-	B.pushFront(e5);
-	cout << "P.length() == " << P.length() << endl;
-	check(P.length() == 0);
-      
-	cout << "Commitolunk..." << endl;
-	B.commit();
-
-	cout << "P.length() == " << P.length() << endl;
-	check(P.length() == 2);
-
-#ifdef SKELETON
-	cout << "P.tail() valid? " << (P.tail()!=INVALID) << endl;
-	check(P.tail()!=INVALID);
-	cout << "P.tail()==v1 ? " << (P.tail()==v1) << endl;
-	check(P.tail() == v1);
-#else
-	cout << "P.tail() valid? " << (P.from()!=INVALID) << endl;
-	check(P.from()!=INVALID);
-	cout << "P.tail()==v1 ? " << (P.from()==v1) << endl;
-	check(P.from() == v1);
-#endif
-
-	// Na ja, ez igy nem igazi, mindket esetet le kene tesztelni,
-	// de legalabb valami:
-#ifdef DEBUG
-	cout << "Hozzaadunk az elejehez egy nem illeszkedo elet..." << endl;
-	rc = false;
-	try {
-	  B.pushFront(e3);
-	}
-	catch(const Exception &e) {
-	  cout << "E: " << e.what() << endl;
-	  rc = true;
-	}
-	check(rc);
-#endif
-
-	cout << "Hozzaadunk a vegehez ket elet..." << endl;
-	B.pushBack(e7);
-	B.pushBack(e8);
-	cout << "P.length() == " << P.length() << endl;
-	check(P.length() == 2);
-      
-	cout << "Es commitolunk...\n";
-	B.commit();
-      }
-      cout << "P.length() == " << P.length() << endl;
-      check(P.length() == 4);
-
-#ifdef SKELETON
-      cout << "P.head()==v3 ? " << (P.head()==v3) << endl;
-      check(P.head() == v3);
-#else
-      cout << "P.head()==v3 ? " << (P.to()==v3) << endl;
-      check(P.to() == v3);
-#endif
-
-#ifndef SKELETON
-      cout << "Vegigiteralunk az eleken." << endl;
-      typedef DPath::NodeIt NodeIt;
-      typedef DPath::EdgeIt EdgeIt;
-      EdgeIt e;
-      int i=1;
-      for(P.first(e); e!=INVALID; ++e, ++i) {
-	cout << i << ". el: " <</* e << */endl;
-      }
-#endif
-
-      // Na ja, ez igy nem igazi, mindket esetet le kene tesztelni,
-      // de legalabb valami:
-
-#ifdef DEBUG
-      rc = false;
-      try {
-	cout << "Setting an edgeiter to a nonexistant edge." << endl;
-	//P.nth(e,134);
-	rc = !debug;
-      }
-      catch(const Exception &e) {
-	cout << "E: " << e.what() << endl;
-	rc = debug;
-      }
-      check(rc);
-#endif
-    }
-
-  }
-  catch(const std::exception &e) {
-    cout << "Uncaught exception: " << e.what() << endl;
-    return 1;
-  }
-  catch(...) {
-    cout << "Something horrible happened: an exception which isn't "
-	 << "std::exception" << endl;
-    return 2;
-  }
-
-
-  cout << (passed ? "All tests passed." : "Some of the tests failed!!!")
-       << endl;
-
-  return passed ? 0 : 1;
+int main() 
+{
 }
