diff options
author | Ryan Guo <ryanguo@modular.com> | 2023-02-17 09:07:35 -0800 |
---|---|---|
committer | Ryan Guo <ryanguo@modular.com> | 2023-02-17 10:07:01 -0800 |
commit | be83a4b257c8f0dfd74a659261a544483c5df9af (patch) | |
tree | eea7f8a14e5b82a23663b436cec9ac3d87056dd8 /llvm/unittests/ADT/StringMapTest.cpp | |
parent | 42944abf8583fc6efae5bbc39f092bf884f6d17c (diff) | |
download | llvm-be83a4b257c8f0dfd74a659261a544483c5df9af.zip llvm-be83a4b257c8f0dfd74a659261a544483c5df9af.tar.gz llvm-be83a4b257c8f0dfd74a659261a544483c5df9af.tar.bz2 |
[ADT] Fix tests for `StringMap::at` and `DenseMap::at`
These methods won't assert for release build.
Diffstat (limited to 'llvm/unittests/ADT/StringMapTest.cpp')
-rw-r--r-- | llvm/unittests/ADT/StringMapTest.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/llvm/unittests/ADT/StringMapTest.cpp b/llvm/unittests/ADT/StringMapTest.cpp index 25562d3..431b397 100644 --- a/llvm/unittests/ADT/StringMapTest.cpp +++ b/llvm/unittests/ADT/StringMapTest.cpp @@ -205,12 +205,9 @@ TEST_F(StringMapTest, CopyCtorTest) { EXPECT_EQ(5, Map2.lookup("funf")); } -TEST_F(StringMapTest, LookupOrTrapTest) { +TEST_F(StringMapTest, AtTest) { llvm::StringMap<int> Map; - // key not found on empty map - EXPECT_DEATH({ Map.at("a"); }, "StringMap::at failed due to a missing key"); - // keys both found and not found on non-empty map Map["a"] = 1; Map["b"] = 2; @@ -218,7 +215,6 @@ TEST_F(StringMapTest, LookupOrTrapTest) { EXPECT_EQ(1, Map.at("a")); EXPECT_EQ(2, Map.at("b")); EXPECT_EQ(3, Map.at("c")); - EXPECT_DEATH({ Map.at("d"); }, "StringMap::at failed due to a missing key"); } // A more complex iteration test. |