Browse Source

added map unit test to check removal correct behaviour.

undefined
Benjamin ‘Touky’ Huet Sam Hocevar <sam@hocevar.net> 10 years ago
parent
commit
1d822046ef
1 changed files with 17 additions and 0 deletions
  1. +17
    -0
      src/t/base/map.cpp

+ 17
- 0
src/t/base/map.cpp View File

@@ -57,6 +57,23 @@ lolunit_declare_fixture(MapTest)
lolunit_assert(m.has_key(2));
}

lolunit_declare_test(MapRemove)
{
map<uint64_t, uint64_t> m;
array<uint64_t> a;

for (int i = 0; i < 20; i++)
{
a << i;
m[i] = -1;
}
for (int i = 0; i < a.Count(); i++)
m[i] = i;
a.Shuffle();
for (int i = 0; i < a.Count(); i++)
m.remove(a[i]);
}

lolunit_declare_test(StringMap)
{
map<char const *, int> m;


Loading…
Cancel
Save