[PATCH] Add standard insert overloads to StringMap

Agustín Bergé kaballo86 at hotmail.com
Thu Jun 19 11:08:07 PDT 2014


================
Comment at: unittests/ADT/StringMapTest.cpp:233
@@ +232,3 @@
+  EXPECT_EQ(1, t.getNumBuckets());
+  EXPECT_EQ(3916023477, HashString("abcdef"));
+
----------------
David Blaikie wrote:
> What is this EXPECT test for?
As I said before, this test is not correct. In order for the test case to be useful, it has to have knowledge of the hashing function and the internals of `StringMap`. If either of those change, this test might became meaningless. That EXPECT was my attempt to have this test fail if the hashing function changes, but is of course wrong. I really don't know how to reliably reproduce a situation that depends on several implementation details.

http://reviews.llvm.org/D4153






More information about the llvm-commits mailing list