1.1 --- a/test/maps_test.cc Mon May 26 13:31:41 2008 +0200
1.2 +++ b/test/maps_test.cc Mon May 26 13:50:47 2008 +0100
1.3 @@ -304,6 +304,28 @@
1.4 check(!equalMap(id,cm)[1] && equalMap(id,cm)[2] && !equalMap(id,cm)[3],
1.5 "Something is wrong with EqualMap");
1.6 }
1.7 +
1.8 + // StoreBoolMap
1.9 + {
1.10 + typedef std::vector<int> vec;
1.11 + vec v1;
1.12 + vec v2(10);
1.13 + StoreBoolMap<std::back_insert_iterator<vec> > map1(std::back_inserter(v1));
1.14 + StoreBoolMap<vec::iterator> map2(v2.begin());
1.15 + map1.set(10, false);
1.16 + map1.set(20, true); map2.set(20, true);
1.17 + map1.set(30, false); map2.set(40, false);
1.18 + map1.set(50, true); map2.set(50, true);
1.19 + map1.set(60, true); map2.set(60, true);
1.20 + check(v1.size() == 3 && v2.size() == 10 &&
1.21 + v1[0]==20 && v1[1]==50 && v1[2]==60 && v2[0]==20 && v2[1]==50 && v2[2]==60,
1.22 + "Something is wrong with StoreBoolMap");
1.23 +
1.24 + int i = 0;
1.25 + for ( StoreBoolMap<vec::iterator>::Iterator it = map2.begin();
1.26 + it != map2.end(); ++it )
1.27 + check(v1[i++] == *it, "Something is wrong with StoreBoolMap");
1.28 + }
1.29
1.30 return 0;
1.31 }