diff --git a/test/unionfind_test.cc b/test/unionfind_test.cc --- a/test/unionfind_test.cc +++ b/test/unionfind_test.cc @@ -16,8 +16,6 @@ * */ -#include - #include #include #include @@ -39,7 +37,7 @@ U.insert(n[1]); U.insert(n[2]); - check(U.join(n[1],n[2]) != -1,"Test failed."); + check(U.join(n[1],n[2]) != -1, "Something is wrong with UnionFindEnum"); U.insert(n[3]); U.insert(n[4]); @@ -48,54 +46,54 @@ U.insert(n[7]); - check(U.join(n[1],n[4]) != -1,"Test failed."); - check(U.join(n[2],n[4]) == -1,"Test failed."); - check(U.join(n[3],n[5]) != -1,"Test failed."); + check(U.join(n[1],n[4]) != -1, "Something is wrong with UnionFindEnum"); + check(U.join(n[2],n[4]) == -1, "Something is wrong with UnionFindEnum"); + check(U.join(n[3],n[5]) != -1, "Something is wrong with UnionFindEnum"); U.insert(n[8],U.find(n[5])); - check(U.size(U.find(n[4])) == 3,"Test failed."); - check(U.size(U.find(n[5])) == 3,"Test failed."); - check(U.size(U.find(n[6])) == 1,"Test failed."); - check(U.size(U.find(n[2])) == 3,"Test failed."); + check(U.size(U.find(n[4])) == 3, "Something is wrong with UnionFindEnum"); + check(U.size(U.find(n[5])) == 3, "Something is wrong with UnionFindEnum"); + check(U.size(U.find(n[6])) == 1, "Something is wrong with UnionFindEnum"); + check(U.size(U.find(n[2])) == 3, "Something is wrong with UnionFindEnum"); U.insert(n[9]); U.insert(n[10],U.find(n[9])); - check(U.join(n[8],n[10]) != -1,"Test failed."); + check(U.join(n[8],n[10]) != -1, "Something is wrong with UnionFindEnum"); - check(U.size(U.find(n[4])) == 3,"Test failed."); - check(U.size(U.find(n[9])) == 5,"Test failed."); + check(U.size(U.find(n[4])) == 3, "Something is wrong with UnionFindEnum"); + check(U.size(U.find(n[9])) == 5, "Something is wrong with UnionFindEnum"); - check(U.size(U.find(n[8])) == 5,"Test failed."); + check(U.size(U.find(n[8])) == 5, "Something is wrong with UnionFindEnum"); U.erase(n[9]); U.erase(n[1]); - check(U.size(U.find(n[10])) == 4,"Test failed."); - check(U.size(U.find(n[2])) == 2,"Test failed."); + check(U.size(U.find(n[10])) == 4, "Something is wrong with UnionFindEnum"); + check(U.size(U.find(n[2])) == 2, "Something is wrong with UnionFindEnum"); U.erase(n[6]); U.split(U.find(n[8])); - check(U.size(U.find(n[4])) == 2,"Test failed."); - check(U.size(U.find(n[3])) == 1,"Test failed."); - check(U.size(U.find(n[2])) == 2,"Test failed."); + check(U.size(U.find(n[4])) == 2, "Something is wrong with UnionFindEnum"); + check(U.size(U.find(n[3])) == 1, "Something is wrong with UnionFindEnum"); + check(U.size(U.find(n[2])) == 2, "Something is wrong with UnionFindEnum"); - check(U.join(n[3],n[4]) != -1,"Test failed."); - check(U.join(n[2],n[4]) == -1,"Test failed."); + check(U.join(n[3],n[4]) != -1, "Something is wrong with UnionFindEnum"); + check(U.join(n[2],n[4]) == -1, "Something is wrong with UnionFindEnum"); - check(U.size(U.find(n[4])) == 3,"Test failed."); - check(U.size(U.find(n[3])) == 3,"Test failed."); - check(U.size(U.find(n[2])) == 3,"Test failed."); + check(U.size(U.find(n[4])) == 3, "Something is wrong with UnionFindEnum"); + check(U.size(U.find(n[3])) == 3, "Something is wrong with UnionFindEnum"); + check(U.size(U.find(n[2])) == 3, "Something is wrong with UnionFindEnum"); U.eraseClass(U.find(n[4])); U.eraseClass(U.find(n[7]));