Produce less messages.
authoralpar
Tue, 19 Jul 2005 12:40:23 +0000
changeset 15692a455f46f85a
parent 1568 f694f75de683
child 1570 da93692e6537
Produce less messages.
test/unionfind_test.cc
     1.1 --- a/test/unionfind_test.cc	Mon Jul 18 15:10:22 2005 +0000
     1.2 +++ b/test/unionfind_test.cc	Tue Jul 19 12:40:23 2005 +0000
     1.3 @@ -49,160 +49,77 @@
     1.4    UFE::MapType base;
     1.5    UFE U(base);
     1.6  
     1.7 -//   print(U);
     1.8 +  U.insert(1);
     1.9 +  U.insert(2);
    1.10  
    1.11 -  cout << "Insert 1..." << endl;
    1.12 -  U.insert(1);
    1.13 -//   print(U);
    1.14 -  
    1.15 -  cout << "Insert 2..." << endl;
    1.16 -  U.insert(2);
    1.17 -//   print(U);
    1.18 -  
    1.19 -  cout << "Join 1 and 2..." << endl;
    1.20    check(U.join(1,2),"Test failed.");
    1.21 -//   print(U);
    1.22  
    1.23 -  cout << "Insert 3, 4, 5, 6, 7..." << endl;
    1.24    U.insert(3);
    1.25    U.insert(4);
    1.26    U.insert(5);
    1.27    U.insert(6);
    1.28    U.insert(7);
    1.29 -//   print (U);
    1.30  
    1.31 -  cout << "Join 1 - 4, 2 - 4 and 3 - 5 ..." << endl;
    1.32    check(U.join(1,4),"Test failed.");
    1.33    check(!U.join(2,4),"Test failed.");
    1.34    check(U.join(3,5),"Test failed.");
    1.35 -//   print(U);
    1.36  
    1.37 -  cout << "Insert 8 to the component of 5 ..." << endl;
    1.38    U.insert(8,5);
    1.39 -//   print(U);
    1.40  
    1.41 -  cout << "Size of the class of 4: " << U.size(4) << endl;
    1.42    check(U.size(4) == 3,"Test failed.");
    1.43 -  cout << "Size of the class of 5: " << U.size(5) << endl;
    1.44    check(U.size(5) == 3,"Test failed.");
    1.45 -  cout << "Size of the class of 6: " << U.size(6) << endl;
    1.46    check(U.size(6) == 1,"Test failed.");
    1.47 -  cout << "Size of the class of 2: " << U.size(2) << endl;
    1.48    check(U.size(2) == 3,"Test failed.");
    1.49  
    1.50 -  cout << "Insert 9 ..." << endl;
    1.51    U.insert(9);
    1.52 -//   print(U);
    1.53 -  cout << "Insert 10 to the component of 9 ..." << endl;
    1.54    U.insert(10,9);
    1.55 -//   print(U);
    1.56 +  check(U.join(8,10),"Test failed.");
    1.57  
    1.58 -  cout << "Join 8 and 10..." << endl;
    1.59 -  check(U.join(8,10),"Test failed.");
    1.60 -//   print(U);
    1.61 +  check(U.move(9,4),"Test failed.");
    1.62 +  check(!U.move(9,2),"Test failed.");
    1.63  
    1.64 -  cout << "Move 9 to the class of 4 ..." << endl;
    1.65 -  check(U.move(9,4),"Test failed.");
    1.66 -//   print(U);
    1.67 +  check(U.size(4) == 4,"Test failed.");
    1.68 +  check(U.size(9) == 4,"Test failed.");
    1.69  
    1.70 -  cout << "Move 9 to the class of 2 ..." << endl;
    1.71 -  check(!U.move(9,2),"Test failed.");
    1.72 -//   print(U);
    1.73 +  check(U.move(5,6),"Test failed.");
    1.74  
    1.75 -  cout << "Size of the class of 4: " << U.size(4) << endl;
    1.76 -  check(U.size(4) == 4,"Test failed.");
    1.77 -  cout << "Size of the class of 9: " << U.size(9) << endl;
    1.78 -  check(U.size(9) == 4,"Test failed.");
    1.79 -  
    1.80 -  cout << "Move 5 to the class of 6 ..." << endl;
    1.81 -  check(U.move(5,6),"Test failed.");
    1.82 -//   print(U);
    1.83 -
    1.84 -  cout << "Size of the class of 5: " << U.size(5) << endl;
    1.85    check(U.size(5) == 2,"Test failed.");
    1.86 -  cout << "Size of the class of 8: " << U.size(8) << endl;
    1.87    check(U.size(8) == 3,"Test failed.");
    1.88  
    1.89 -  cout << "Move 7 to the class of 10 ..." << endl;
    1.90    check(U.move(7,10),"Test failed.");
    1.91 -//   print(U);
    1.92 -
    1.93 -  cout << "Size of the class of 7: " << U.size(7) << endl;
    1.94    check(U.size(7) == 4,"Test failed.");
    1.95  
    1.96 -  cout <<"Erase 9... " << endl;
    1.97    U.erase(9);
    1.98 -//   print(U);
    1.99 +  U.erase(1);
   1.100  
   1.101 -  cout <<"Erase 1... " << endl;
   1.102 -  U.erase(1);
   1.103 -//   print(U);
   1.104 -
   1.105 -  cout << "Size of the class of 4: " << U.size(4) << endl;
   1.106    check(U.size(4) == 2,"Test failed.");
   1.107 -  cout << "Size of the class of 2: " << U.size(2) << endl;
   1.108    check(U.size(2) == 2,"Test failed.");
   1.109  
   1.110 +  U.erase(1);
   1.111 +  U.erase(6);
   1.112 +  U.split(8);
   1.113  
   1.114 -  cout <<"Erase 1... " << endl;
   1.115 -  U.erase(1);
   1.116 -//   print(U);
   1.117 -
   1.118 -  cout <<"Erase 6... " << endl;
   1.119 -  U.erase(6);
   1.120 -//   print(U);
   1.121 -
   1.122 -  cout << "Split the class of 8... " << endl;
   1.123 -  U.split(8);
   1.124 -//   print(U);
   1.125 -
   1.126 -
   1.127 -  cout << "Size of the class of 4: " << U.size(4) << endl;
   1.128    check(U.size(4) == 2,"Test failed.");
   1.129 -  cout << "Size of the class of 3: " << U.size(3) << endl;
   1.130    check(U.size(3) == 1,"Test failed.");
   1.131 -  cout << "Size of the class of 2: " << U.size(2) << endl;
   1.132    check(U.size(2) == 2,"Test failed.");
   1.133  
   1.134 -
   1.135 -  cout << "Join 3 - 4 and 2 - 4 ..." << endl;
   1.136    check(U.join(3,4),"Test failed.");
   1.137    check(!U.join(2,4),"Test failed.");
   1.138 -//   print(U);
   1.139  
   1.140 -
   1.141 -  cout << "Size of the class of 4: " << U.size(4) << endl;
   1.142    check(U.size(4) == 3,"Test failed.");
   1.143 -  cout << "Size of the class of 3: " << U.size(3) << endl;
   1.144    check(U.size(3) == 3,"Test failed.");
   1.145 -  cout << "Size of the class of 2: " << U.size(2) << endl;
   1.146    check(U.size(2) == 3,"Test failed.");
   1.147  
   1.148 -  cout << "Calling makeRep(4)..." << endl;
   1.149    U.makeRep(4);
   1.150 -//   print(U);
   1.151 -  cout << "Calling makeRep(3)..." << endl;
   1.152    U.makeRep(3);
   1.153 -//   print(U);
   1.154 -  cout << "Calling makeRep(2)..." << endl;
   1.155    U.makeRep(2);
   1.156 -//   print(U);
   1.157  
   1.158 -  cout << "Size of the class of 4: " << U.size(4) << endl;
   1.159    check(U.size(4) == 3,"Test failed.");
   1.160 -  cout << "Size of the class of 3: " << U.size(3) << endl;
   1.161    check(U.size(3) == 3,"Test failed.");
   1.162 -  cout << "Size of the class of 2: " << U.size(2) << endl;
   1.163    check(U.size(2) == 3,"Test failed.");
   1.164  
   1.165  
   1.166 -  cout << "eraseClass 4 ..." << endl;
   1.167    U.eraseClass(4);
   1.168 -//   print(U);
   1.169 +  U.eraseClass(7);
   1.170  
   1.171 -  cout << "eraseClass 7 ..." << endl;
   1.172 -  U.eraseClass(7);
   1.173 -//   print(U);
   1.174 -
   1.175 -  cout << "done." << endl;
   1.176  }