diff -r b72b36a25170 -r 616bc397c83a src/work/klao/path_test.cc --- a/src/work/klao/path_test.cc Sun Mar 21 16:16:08 2004 +0000 +++ b/src/work/klao/path_test.cc Sun Mar 21 17:09:16 2004 +0000 @@ -109,6 +109,70 @@ check(P.isForward(e)); } + { + cout << "Reszut letrehozasa: [2. el, 4. el)..." << endl; + LPath P2(P, P.nth(1), P.nth(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(0), P.nth(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(1), P.nth(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(3), P.nth(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(5), P.nth(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!!!")