From f4c72644c71809929cba3a1562bad53a2e3cf4d6 Mon Sep 17 00:00:00 2001 From: Guillaume Bittoun Date: Wed, 18 Feb 2015 17:03:33 +0000 Subject: [PATCH] map: adding test for an unidentified bug to fix --- src/t/base/map.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/t/base/map.cpp b/src/t/base/map.cpp index 1d989ba4..cf9da432 100644 --- a/src/t/base/map.cpp +++ b/src/t/base/map.cpp @@ -71,7 +71,29 @@ lolunit_declare_fixture(MapTest) m[i] = i; a.Shuffle(); for (int i = 0; i < a.Count(); i++) + { + std::cout << m[a[i]] << " " << a[i] << std::endl; m.remove(a[i]); + } + } + + lolunit_declare_test(MapRemoveBug) + { + map m; + array a; + + for (int i = 0; i < a.Count(); i++) + m[i] = i; + + m.remove(12); + m.remove(0); + m.remove(17); + m.remove(2); + m.remove(9); + m.remove(4); + m.remove(15); + m.remove(10); + lolunit_assert_equal(m[8], 8); } lolunit_declare_test(StringMap)