From 1d822046ef4b771f4af077ed2df55f634688dd0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20=E2=80=98Touky=E2=80=99=20Huet?= Date: Wed, 18 Feb 2015 03:48:20 +0000 Subject: [PATCH] added map unit test to check removal correct behaviour. --- src/t/base/map.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/t/base/map.cpp b/src/t/base/map.cpp index 3960d0a4..1d989ba4 100644 --- a/src/t/base/map.cpp +++ b/src/t/base/map.cpp @@ -57,6 +57,23 @@ lolunit_declare_fixture(MapTest) lolunit_assert(m.has_key(2)); } + lolunit_declare_test(MapRemove) + { + map m; + array 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 m;