src/work/klao/iter_map_test.cc
changeset 363 7a05119c121a
parent 361 ab0899df30d2
child 365 9ca84022df34
equal deleted inserted replaced
1:a7880e745f22 2:3e7f0c05f690
   117     cout << " 21: " << int(test[21]) << endl;
   117     cout << " 21: " << int(test[21]) << endl;
   118     cout << " 42: " << int(test[42]) << endl;
   118     cout << " 42: " << int(test[42]) << endl;
   119   }
   119   }
   120 
   120 
   121   {
   121   {
   122     cout << "Testing the IterableBoolMap...\n";
   122     cout << "\n\n\nTesting the IterableBoolMap...\n";
   123 
   123 
   124     BaseMap base(344);
   124     BaseMap base(344);
   125     TestBoolMap test(base);
   125     TestBoolMap test(base,true);
   126 
   126 
   127 
   127 
   128     print(test,2);
   128     print(test,2);
   129 
   129 
   130     cout << "Inserting 12 to class true...\n";
   130     cout << "Inserting 12 to class true...\n";
   155     cout << " 22: " << test[22] << endl;
   155     cout << " 22: " << test[22] << endl;
   156     cout << " 10: " << test[10] << endl;
   156     cout << " 10: " << test[10] << endl;
   157     cout << " 11: " << test[11] << endl;
   157     cout << " 11: " << test[11] << endl;
   158     cout << " 42: " << test[42] << endl;
   158     cout << " 42: " << test[42] << endl;
   159 
   159 
   160     cout << "Inserting 21 to class 1...\n";
   160     cout << "Setting 10 to class true...\n";
   161     test.insert(21,1);
   161     test.set(10,true);
   162     print(test,2);
       
   163 
       
   164     cout << "Inserting 20 to class 1...\n";
       
   165     test.insert(20,0);
       
   166     print(test,2);
       
   167 
       
   168     cout << "Testing some map values:\n";
       
   169     cout << " 12: " << test[12] << endl;
       
   170     cout << " 22: " << test[22] << endl;
       
   171     cout << " 10: " << test[10] << endl;
       
   172     cout << " 20: " << test[20] << endl;
       
   173     cout << " 11: " << test[11] << endl;
       
   174     cout << " 21: " << test[21] << endl;
       
   175     cout << " 42: " << test[42] << endl;
       
   176 
       
   177     cout << "Setting 20 to class 2...\n";
       
   178     test.set(20,2);
       
   179     print(test,2);
   162     print(test,2);
   180   
   163   
   181     cout << "Setting 10 to class 1...\n";
   164     cout << "Setting 11 to class true...\n";
   182     test.set(10,1);
       
   183     print(test,2);
       
   184   
       
   185     cout << "Setting 11 to class 1...\n";
       
   186     test.set(11,1);
   165     test.set(11,1);
   187     print(test,2);
   166     print(test,2);
   188   
   167   
   189     cout << "Setting 12 to class 1...\n";
   168     cout << "Setting 12 to class false...\n";
   190     test.set(12,1);
   169     test.set(12,false);
   191     print(test,2);
   170     print(test,2);
   192   
   171   
   193     cout << "Setting 21 to class 2...\n";
   172     cout << "Setting 22 to class false...\n";
   194     test.set(21,2);
   173     test.set(22,false);
   195     print(test,2);
       
   196   
       
   197     cout << "Setting 22 to class 2...\n";
       
   198     test.set(22,2);
       
   199     print(test,2);
   174     print(test,2);
   200   
   175   
   201     cout << "Testing some map values:\n";
   176     cout << "Testing some map values:\n";
   202     cout << " 12: " << test[12] << endl;
   177     cout << " 12: " << test[12] << endl;
   203     cout << " 22: " << test[22] << endl;
   178     cout << " 22: " << test[22] << endl;
   204     cout << " 10: " << test[10] << endl;
   179     cout << " 10: " << test[10] << endl;
   205     cout << " 20: " << test[20] << endl;
       
   206     cout << " 11: " << test[11] << endl;
   180     cout << " 11: " << test[11] << endl;
   207     cout << " 21: " << test[21] << endl;
       
   208     cout << " 42: " << test[42] << endl;
   181     cout << " 42: " << test[42] << endl;
   209 
   182 
   210   }
   183   }
   211 }
   184 }