test/maps_test.cc
changeset 159 c7d30f7810e5
parent 136 b82dc494bafc
child 167 d57ae6f0a335
equal deleted inserted replaced
6:f2f8fc6954a9 7:57f5f99f3aee
   302     check(lessMap(id,cm)[1] && !lessMap(id,cm)[2] && !lessMap(id,cm)[3],
   302     check(lessMap(id,cm)[1] && !lessMap(id,cm)[2] && !lessMap(id,cm)[3],
   303           "Something is wrong with LessMap");
   303           "Something is wrong with LessMap");
   304     check(!equalMap(id,cm)[1] && equalMap(id,cm)[2] && !equalMap(id,cm)[3],
   304     check(!equalMap(id,cm)[1] && equalMap(id,cm)[2] && !equalMap(id,cm)[3],
   305           "Something is wrong with EqualMap");
   305           "Something is wrong with EqualMap");
   306   }
   306   }
       
   307   
       
   308   // StoreBoolMap
       
   309   {
       
   310     typedef std::vector<int> vec;
       
   311     vec v1;
       
   312     vec v2(10);
       
   313     StoreBoolMap<std::back_insert_iterator<vec> > map1(std::back_inserter(v1));
       
   314     StoreBoolMap<vec::iterator> map2(v2.begin());
       
   315     map1.set(10, false);
       
   316     map1.set(20, true);   map2.set(20, true);
       
   317     map1.set(30, false);  map2.set(40, false);
       
   318     map1.set(50, true);   map2.set(50, true);
       
   319     map1.set(60, true);   map2.set(60, true);
       
   320     check(v1.size() == 3 && v2.size() == 10 &&
       
   321           v1[0]==20 && v1[1]==50 && v1[2]==60 && v2[0]==20 && v2[1]==50 && v2[2]==60,
       
   322           "Something is wrong with StoreBoolMap");
       
   323           
       
   324     int i = 0;
       
   325     for ( StoreBoolMap<vec::iterator>::Iterator it = map2.begin();
       
   326           it != map2.end(); ++it )
       
   327       check(v1[i++] == *it, "Something is wrong with StoreBoolMap");
       
   328   }
   307 
   329 
   308   return 0;
   330   return 0;
   309 }
   331 }