Index: src/work/klao/path_test.cc
===================================================================
--- src/work/klao/path_test.cc	(revision 227)
+++ src/work/klao/path_test.cc	(revision 369)
@@ -44,135 +44,204 @@
   bool rc;
 
-  cout << "Ures path letrehozasa" << endl;
-  typedef Path<ListGraph> LPath;
-  LPath P(G);
-
-  cout << "P.length() == " << P.length() << endl;
-  check(P.length() == 0);
-
-  cout << "P.from() valid? " << G.valid(P.from()) << endl;
-  check(! G.valid(P.from()));
-
-  cout << "Hozzaadunk ket elet..." << endl;
-  check(P.pushBack(e1));
-  check(P.pushBack(e3));
-  cout << "P.length() == " << P.length() << endl;
-  check(P.length() == 2);
-
-  cout << "P.from() valid? " << G.valid(P.from()) << endl;
-  check(G.valid(P.from()));
+  {
+    cout << "DynamicPath tesztelese...\n";
+
+    cout << "Ures path letrehozasa" << endl;
+    typedef DynamicPath<ListGraph> LPath;
+    LPath P(G);
+
+    cout << "P.length() == " << P.length() << endl;
+    check(P.length() == 0);
+
+    cout << "P.from() valid? " << G.valid(P.from()) << endl;
+    check(! G.valid(P.from()));
+
+    cout << "Hozzaadunk ket elet..." << endl;
+    check(P.pushBack(e1));
+    check(P.pushBack(e3));
+    cout << "P.length() == " << P.length() << endl;
+    check(P.length() == 2);
+
+    cout << "P.from() valid? " << G.valid(P.from()) << endl;
+    check(G.valid(P.from()));
   
-  cout << "P.from()==s ? " << (P.from()==s) << endl;
-  check(P.from() == s);
-
-  cout << "Hozzaadunk egy nem illeszkedo elt." << endl;
-  rc = P.pushBack(e8);
-  cout << "Sukerult: " << rc << endl;
-  check(!rc);
-
-  cout << "Meg 3 el hozzaadasa, nem mind elore iranyu..." << endl;
-  check(P.pushBack(e6));
-  check(P.pushBack(e8));
-  check(P.pushBack(e10));
-
-  cout << "P.length() == " << P.length() << endl;
-  check(P.length() == 5);
-
-  cout << "P.from()==s ? " << (P.from()==s) << endl;
-  check(P.from() == s);
-  cout << "P.to()==t ? " << (P.to()==t) << endl;
-  check(P.to() == t);
-
-  cout << "Vegpont bellitasa: " << endl;
-  rc = P.setTo(v2);
-  cout << "Hibasra: " << rc << endl;
-  check(!rc);
-  rc = P.setTo(t);
-  cout << "Helyesre: " << rc << endl;
-  check(rc);
-
-  cout << "Elek iranyitasanak ellenorzese." << endl;
-  cout << "El: " << e1 << ", G.tail(el): " << G.head(e1) << endl;
-  check(G.tail(e1)==s);
-
-  cout << "Vegigiteralunk az eleken." << endl;
-  typedef LPath::NodeIt NodeIt;
-  typedef LPath::EdgeIt EdgeIt;
-  EdgeIt e = P.first<EdgeIt>();
-  int i=1;
-  for(; P.valid(e); P.next(e), ++i) {
-    cout << i << ". el: " << P.graphEdge(e)
-	 << ", elore el? " << P.isForward(e) << endl;
-    if(i>=3 && i<5) 
-      check(!P.isForward(e));
-    else
-      check(P.isForward(e));
+    cout << "P.from()==s ? " << (P.from()==s) << endl;
+    check(P.from() == s);
+
+    cout << "Hozzaadunk egy nem illeszkedo elt." << endl;
+    rc = P.pushBack(e8);
+    cout << "Sukerult: " << rc << endl;
+    check(!rc);
+
+    cout << "Meg 3 el hozzaadasa, nem mind elore iranyu..." << endl;
+    check(P.pushBack(e6));
+    check(P.pushBack(e8));
+    check(P.pushBack(e10));
+
+    cout << "P.length() == " << P.length() << endl;
+    check(P.length() == 5);
+
+    cout << "P.from()==s ? " << (P.from()==s) << endl;
+    check(P.from() == s);
+    cout << "P.to()==t ? " << (P.to()==t) << endl;
+    check(P.to() == t);
+
+    cout << "Vegpont bellitasa: " << endl;
+    rc = P.setTo(v2);
+    cout << "Hibasra: " << rc << endl;
+    check(!rc);
+    rc = P.setTo(t);
+    cout << "Helyesre: " << rc << endl;
+    check(rc);
+
+    cout << "Elek iranyitasanak ellenorzese." << endl;
+    cout << "El: " << e1 << ", G.tail(el): " << G.head(e1) << endl;
+    check(G.tail(e1)==s);
+
+    cout << "Vegigiteralunk az eleken." << endl;
+    typedef LPath::NodeIt NodeIt;
+    typedef LPath::EdgeIt EdgeIt;
+    EdgeIt e = P.first<EdgeIt>();
+    int i=1;
+    for(; P.valid(e); P.next(e), ++i) {
+      cout << i << ". el: " << P.graphEdge(e)
+	   << ", elore el? " << P.isForward(e) << endl;
+      if(i>=3 && i<5) 
+	check(!P.isForward(e));
+      else
+	check(P.isForward(e));
+    }
+
+    {
+      cout << "Reszut letrehozasa: [2. el, 4. el)..." << endl;
+      LPath P2(P, P.nth<EdgeIt>(1), P.nth<EdgeIt>(3));
+
+      cout << "P2.length() == " << P2.length() << endl;
+      check(P2.length() == 2);
+    
+      cout << "P2.from()==v1 ? " << (P2.from()==v1) << endl;
+      check(P2.from() == v1);
+      cout << "P2.to()==v3 ? " << (P2.to()==v3) << endl;
+      check(P2.to() == v3);
+    }
+    {
+      cout << "Reszut letrehozasa: [1. el, 6. el)..." << endl;
+      LPath P2(P, P.nth<EdgeIt>(0), P.nth<EdgeIt>(5));
+
+      cout << "P2.length() == " << P2.length() << endl;
+      check(P2.length() == 5);
+    
+      cout << "P2.from()==s ? " << (P2.from()==s) << endl;
+      check(P2.from() == s);
+      cout << "P2.to()==t ? " << (P2.to()==t) << endl;
+      check(P2.to() == t);
+    }
+
+    {
+      cout << "Ket pont altal megadott reszut letrehozasa: [2. pont, 4. pont]..."
+	   << endl;
+      LPath P2(P, P.nth<NodeIt>(1), P.nth<NodeIt>(3));
+
+      cout << "P2.length() == " << P2.length() << endl;
+      check(P2.length() == 2);
+    
+      cout << "P2.from()==v1 ? " << (P2.from()==v1) << endl;
+      check(P2.from() == v1);
+      cout << "P2.to()==v3 ? " << (P2.to()==v3) << endl;
+      check(P2.to() == v3);
+    }
+    {
+      cout << "Egy pontu reszut letrehozasa: [4. pont, 4. pont]..."
+	   << endl;
+      LPath P2(P, P.nth<NodeIt>(3), P.nth<NodeIt>(3));
+
+      cout << "P2.length() == " << P2.length() << endl;
+      check(P2.length() == 0);
+    
+      cout << "P2.from()==v3 ? " << (P2.from()==v3) << endl;
+      check(P2.from() == v3);
+      cout << "P2.to()==v3 ? " << (P2.to()==v3) << endl;
+      check(P2.to() == v3);
+    }
+    {
+      cout << "Forditott ut letrehozasa: [6. pont, 1. pont]..."
+	   << endl;
+      LPath P2(P, P.nth<NodeIt>(5), P.nth<NodeIt>(0));
+
+      cout << "P2.length() == " << P2.length() << endl;
+      check(P2.length() == 5);
+    
+      cout << "P2.from()==t ? " << (P2.from()==t) << endl;
+      check(P2.from() == t);
+      cout << "P2.to()==s ? " << (P2.to()==s) << endl;
+      check(P2.to() == s);
+    }
+
   }
 
   {
-    cout << "Reszut letrehozasa: [2. el, 4. el)..." << endl;
-    LPath P2(P, P.nth<EdgeIt>(1), P.nth<EdgeIt>(3));
-
-    cout << "P2.length() == " << P2.length() << endl;
-    check(P2.length() == 2);
-    
-    cout << "P2.from()==v1 ? " << (P2.from()==v1) << endl;
-    check(P2.from() == v1);
-    cout << "P2.to()==v3 ? " << (P2.to()==v3) << endl;
-    check(P2.to() == v3);
+    cout << "\n\n\nDirPath tesztelese...\n";
+
+
+    cout << "Ures path letrehozasa" << endl;
+    typedef DirPath<ListGraph> DPath;
+    DPath P(G);
+
+    cout << "P.length() == " << P.length() << endl;
+    check(P.length() == 0);
+
+    cout << "P.from() valid? " << G.valid(P.from()) << endl;
+    check(! G.valid(P.from()));
+
+    {
+      cout << "Builder objektum letrehozasa" << endl;
+      DPath::Builder B(P);
+
+      cout << "Hozzaadunk az elejehez ket elet..." << endl;
+      check(B.pushFront(e6));
+      check(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);
+      cout << "P.from() valid? " << G.valid(P.from()) << endl;
+      check(G.valid(P.from()));
+      cout << "P.from()==v1 ? " << (P.from()==v1) << endl;
+      check(P.from() == v1);
+
+      cout << "Hozzaadunk az elejehez egy nem illeszkedo elet..." << endl;
+      check(!B.pushFront(e3));
+    
+      cout << "Hozzaadunk a vegehez ket elet..." << endl;
+      check(B.pushBack(e7));
+      check(B.pushBack(e8));
+      cout << "P.length() == " << P.length() << endl;
+      check(P.length() == 4);
+
+      cout << "Hozzaadunk az elejehez meg egy elet..." << endl;
+      check(B.pushFront(e4));
+      cout << "P.length() == " << P.length() << endl;
+      check(P.length() == 4);
+      
+      cout << "Es megvarjuk, amig megszunik a Builder...\n";
+    }
+    cout << "P.length() == " << P.length() << endl;
+    check(P.length() == 5);
+    cout << "P.from()==v2 ? " << (P.from()==v2) << endl;
+    check(P.from() == v2);
+
+    cout << "Vegigiteralunk az eleken." << endl;
+    typedef DPath::NodeIt NodeIt;
+    typedef DPath::EdgeIt EdgeIt;
+    EdgeIt e;
+    int i=1;
+    for(P.first(e); P.valid(e); P.next(e), ++i) {
+      cout << i << ". el: " << e << endl;
+    }
   }
-  {
-    cout << "Reszut letrehozasa: [1. el, 6. el)..." << endl;
-    LPath P2(P, P.nth<EdgeIt>(0), P.nth<EdgeIt>(5));
-
-    cout << "P2.length() == " << P2.length() << endl;
-    check(P2.length() == 5);
-    
-    cout << "P2.from()==s ? " << (P2.from()==s) << endl;
-    check(P2.from() == s);
-    cout << "P2.to()==t ? " << (P2.to()==t) << endl;
-    check(P2.to() == t);
-  }
-
-  {
-    cout << "Ket pont altal megadott reszut letrehozasa: [2. pont, 4. pont]..."
-	 << endl;
-    LPath P2(P, P.nth<NodeIt>(1), P.nth<NodeIt>(3));
-
-    cout << "P2.length() == " << P2.length() << endl;
-    check(P2.length() == 2);
-    
-    cout << "P2.from()==v1 ? " << (P2.from()==v1) << endl;
-    check(P2.from() == v1);
-    cout << "P2.to()==v3 ? " << (P2.to()==v3) << endl;
-    check(P2.to() == v3);
-  }
-  {
-    cout << "Egy pontu reszut letrehozasa: [4. pont, 4. pont]..."
-	 << endl;
-    LPath P2(P, P.nth<NodeIt>(3), P.nth<NodeIt>(3));
-
-    cout << "P2.length() == " << P2.length() << endl;
-    check(P2.length() == 0);
-    
-    cout << "P2.from()==v3 ? " << (P2.from()==v3) << endl;
-    check(P2.from() == v3);
-    cout << "P2.to()==v3 ? " << (P2.to()==v3) << endl;
-    check(P2.to() == v3);
-  }
-  {
-    cout << "Forditott ut letrehozasa: [6. pont, 1. pont]..."
-	 << endl;
-    LPath P2(P, P.nth<NodeIt>(5), P.nth<NodeIt>(0));
-
-    cout << "P2.length() == " << P2.length() << endl;
-    check(P2.length() == 5);
-    
-    cout << "P2.from()==t ? " << (P2.from()==t) << endl;
-    check(P2.from() == t);
-    cout << "P2.to()==s ? " << (P2.to()==s) << endl;
-    check(P2.to() == s);
-  }
-
 
   cout << (passed ? "All tests passed." : "Some of the tests failed!!!")
