test/unionfind_test.cc
 changeset 171 02f4d5d9bfd7 parent 105 e4948ef6a4ca child 209 765619b7cbb2
```     1.1 --- a/test/unionfind_test.cc	Sun Jun 15 22:03:33 2008 +0200
1.2 +++ b/test/unionfind_test.cc	Sun Jun 15 22:05:23 2008 +0200
1.3 @@ -16,8 +16,6 @@
1.4   *
1.5   */
1.6
1.7 -#include <iostream>
1.8 -
1.9  #include <lemon/list_graph.h>
1.10  #include <lemon/maps.h>
1.11  #include <lemon/unionfind.h>
1.12 @@ -39,7 +37,7 @@
1.13    U.insert(n[1]);
1.14    U.insert(n[2]);
1.15
1.16 -  check(U.join(n[1],n[2]) != -1,"Test failed.");
1.17 +  check(U.join(n[1],n[2]) != -1, "Something is wrong with UnionFindEnum");
1.18
1.19    U.insert(n[3]);
1.20    U.insert(n[4]);
1.21 @@ -48,54 +46,54 @@
1.22    U.insert(n[7]);
1.23
1.24
1.25 -  check(U.join(n[1],n[4]) != -1,"Test failed.");
1.26 -  check(U.join(n[2],n[4]) == -1,"Test failed.");
1.27 -  check(U.join(n[3],n[5]) != -1,"Test failed.");
1.28 +  check(U.join(n[1],n[4]) != -1, "Something is wrong with UnionFindEnum");
1.29 +  check(U.join(n[2],n[4]) == -1, "Something is wrong with UnionFindEnum");
1.30 +  check(U.join(n[3],n[5]) != -1, "Something is wrong with UnionFindEnum");
1.31
1.32
1.33    U.insert(n[8],U.find(n[5]));
1.34
1.35
1.36 -  check(U.size(U.find(n[4])) == 3,"Test failed.");
1.37 -  check(U.size(U.find(n[5])) == 3,"Test failed.");
1.38 -  check(U.size(U.find(n[6])) == 1,"Test failed.");
1.39 -  check(U.size(U.find(n[2])) == 3,"Test failed.");
1.40 +  check(U.size(U.find(n[4])) == 3, "Something is wrong with UnionFindEnum");
1.41 +  check(U.size(U.find(n[5])) == 3, "Something is wrong with UnionFindEnum");
1.42 +  check(U.size(U.find(n[6])) == 1, "Something is wrong with UnionFindEnum");
1.43 +  check(U.size(U.find(n[2])) == 3, "Something is wrong with UnionFindEnum");
1.44
1.45
1.46    U.insert(n[9]);
1.47    U.insert(n[10],U.find(n[9]));
1.48
1.49
1.50 -  check(U.join(n[8],n[10]) != -1,"Test failed.");
1.51 +  check(U.join(n[8],n[10])  != -1, "Something is wrong with UnionFindEnum");
1.52
1.53
1.54 -  check(U.size(U.find(n[4])) == 3,"Test failed.");
1.55 -  check(U.size(U.find(n[9])) == 5,"Test failed.");
1.56 +  check(U.size(U.find(n[4])) == 3, "Something is wrong with UnionFindEnum");
1.57 +  check(U.size(U.find(n[9])) == 5, "Something is wrong with UnionFindEnum");
1.58
1.59 -  check(U.size(U.find(n[8])) == 5,"Test failed.");
1.60 +  check(U.size(U.find(n[8])) == 5, "Something is wrong with UnionFindEnum");
1.61
1.62    U.erase(n[9]);
1.63    U.erase(n[1]);
1.64
1.65 -  check(U.size(U.find(n[10])) == 4,"Test failed.");
1.66 -  check(U.size(U.find(n[2])) == 2,"Test failed.");
1.67 +  check(U.size(U.find(n[10])) == 4, "Something is wrong with UnionFindEnum");
1.68 +  check(U.size(U.find(n[2]))  == 2, "Something is wrong with UnionFindEnum");
1.69
1.70    U.erase(n[6]);
1.71    U.split(U.find(n[8]));
1.72
1.73
1.74 -  check(U.size(U.find(n[4])) == 2,"Test failed.");
1.75 -  check(U.size(U.find(n[3])) == 1,"Test failed.");
1.76 -  check(U.size(U.find(n[2])) == 2,"Test failed.");
1.77 +  check(U.size(U.find(n[4])) == 2, "Something is wrong with UnionFindEnum");
1.78 +  check(U.size(U.find(n[3])) == 1, "Something is wrong with UnionFindEnum");
1.79 +  check(U.size(U.find(n[2])) == 2, "Something is wrong with UnionFindEnum");
1.80
1.81
1.82 -  check(U.join(n[3],n[4]) != -1,"Test failed.");
1.83 -  check(U.join(n[2],n[4]) == -1,"Test failed.");
1.84 +  check(U.join(n[3],n[4]) != -1, "Something is wrong with UnionFindEnum");
1.85 +  check(U.join(n[2],n[4]) == -1, "Something is wrong with UnionFindEnum");
1.86
1.87
1.88 -  check(U.size(U.find(n[4])) == 3,"Test failed.");
1.89 -  check(U.size(U.find(n[3])) == 3,"Test failed.");
1.90 -  check(U.size(U.find(n[2])) == 3,"Test failed.");
1.91 +  check(U.size(U.find(n[4])) == 3, "Something is wrong with UnionFindEnum");
1.92 +  check(U.size(U.find(n[3])) == 3, "Something is wrong with UnionFindEnum");
1.93 +  check(U.size(U.find(n[2])) == 3, "Something is wrong with UnionFindEnum");
1.94
1.95    U.eraseClass(U.find(n[4]));
1.96    U.eraseClass(U.find(n[7]));
```