Changeset 171:02f4d5d9bfd7 in lemon for test/unionfind_test.cc
- Timestamp:
- 06/15/08 22:05:23 (16 years ago)
- Branch:
- default
- Children:
- 172:c94a80f38d7f, 173:b026e9779b28, 175:4eb8900a865c
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/unionfind_test.cc
r105 r171 16 16 * 17 17 */ 18 19 #include <iostream>20 18 21 19 #include <lemon/list_graph.h> … … 40 38 U.insert(n[2]); 41 39 42 check(U.join(n[1],n[2]) != -1, "Test failed.");40 check(U.join(n[1],n[2]) != -1, "Something is wrong with UnionFindEnum"); 43 41 44 42 U.insert(n[3]); … … 49 47 50 48 51 check(U.join(n[1],n[4]) != -1, "Test failed.");52 check(U.join(n[2],n[4]) == -1, "Test failed.");53 check(U.join(n[3],n[5]) != -1, "Test failed.");49 check(U.join(n[1],n[4]) != -1, "Something is wrong with UnionFindEnum"); 50 check(U.join(n[2],n[4]) == -1, "Something is wrong with UnionFindEnum"); 51 check(U.join(n[3],n[5]) != -1, "Something is wrong with UnionFindEnum"); 54 52 55 53 … … 57 55 58 56 59 check(U.size(U.find(n[4])) == 3, "Test failed.");60 check(U.size(U.find(n[5])) == 3, "Test failed.");61 check(U.size(U.find(n[6])) == 1, "Test failed.");62 check(U.size(U.find(n[2])) == 3, "Test failed.");57 check(U.size(U.find(n[4])) == 3, "Something is wrong with UnionFindEnum"); 58 check(U.size(U.find(n[5])) == 3, "Something is wrong with UnionFindEnum"); 59 check(U.size(U.find(n[6])) == 1, "Something is wrong with UnionFindEnum"); 60 check(U.size(U.find(n[2])) == 3, "Something is wrong with UnionFindEnum"); 63 61 64 62 … … 67 65 68 66 69 check(U.join(n[8],n[10]) != -1,"Test failed.");67 check(U.join(n[8],n[10]) != -1, "Something is wrong with UnionFindEnum"); 70 68 71 69 72 check(U.size(U.find(n[4])) == 3, "Test failed.");73 check(U.size(U.find(n[9])) == 5, "Test failed.");70 check(U.size(U.find(n[4])) == 3, "Something is wrong with UnionFindEnum"); 71 check(U.size(U.find(n[9])) == 5, "Something is wrong with UnionFindEnum"); 74 72 75 check(U.size(U.find(n[8])) == 5, "Test failed.");73 check(U.size(U.find(n[8])) == 5, "Something is wrong with UnionFindEnum"); 76 74 77 75 U.erase(n[9]); 78 76 U.erase(n[1]); 79 77 80 check(U.size(U.find(n[10])) == 4, "Test failed.");81 check(U.size(U.find(n[2])) == 2,"Test failed.");78 check(U.size(U.find(n[10])) == 4, "Something is wrong with UnionFindEnum"); 79 check(U.size(U.find(n[2])) == 2, "Something is wrong with UnionFindEnum"); 82 80 83 81 U.erase(n[6]); … … 85 83 86 84 87 check(U.size(U.find(n[4])) == 2, "Test failed.");88 check(U.size(U.find(n[3])) == 1, "Test failed.");89 check(U.size(U.find(n[2])) == 2, "Test failed.");85 check(U.size(U.find(n[4])) == 2, "Something is wrong with UnionFindEnum"); 86 check(U.size(U.find(n[3])) == 1, "Something is wrong with UnionFindEnum"); 87 check(U.size(U.find(n[2])) == 2, "Something is wrong with UnionFindEnum"); 90 88 91 89 92 check(U.join(n[3],n[4]) != -1, "Test failed.");93 check(U.join(n[2],n[4]) == -1, "Test failed.");90 check(U.join(n[3],n[4]) != -1, "Something is wrong with UnionFindEnum"); 91 check(U.join(n[2],n[4]) == -1, "Something is wrong with UnionFindEnum"); 94 92 95 93 96 check(U.size(U.find(n[4])) == 3, "Test failed.");97 check(U.size(U.find(n[3])) == 3, "Test failed.");98 check(U.size(U.find(n[2])) == 3, "Test failed.");94 check(U.size(U.find(n[4])) == 3, "Something is wrong with UnionFindEnum"); 95 check(U.size(U.find(n[3])) == 3, "Something is wrong with UnionFindEnum"); 96 check(U.size(U.find(n[2])) == 3, "Something is wrong with UnionFindEnum"); 99 97 100 98 U.eraseClass(U.find(n[4]));
Note: See TracChangeset
for help on using the changeset viewer.