[clang] dd7095f - [clang][unittest] Don't hardcode the string "Assertion"
Benjamin Kramer via cfe-commits
cfe-commits at lists.llvm.org
Mon Oct 26 10:12:58 PDT 2020
Author: Benjamin Kramer
Date: 2020-10-26T18:10:56+01:00
New Revision: dd7095f52bda36e0f3cd37574a1cb97c7a46cffe
URL: https://github.com/llvm/llvm-project/commit/dd7095f52bda36e0f3cd37574a1cb97c7a46cffe
DIFF: https://github.com/llvm/llvm-project/commit/dd7095f52bda36e0f3cd37574a1cb97c7a46cffe.diff
LOG: [clang][unittest] Don't hardcode the string "Assertion"
This depends on the libc implementation. Use the string from the
assertion message instead. Overly specific, but so is this entire test.
Added:
Modified:
clang/unittests/Basic/LineOffsetMappingTest.cpp
Removed:
################################################################################
diff --git a/clang/unittests/Basic/LineOffsetMappingTest.cpp b/clang/unittests/Basic/LineOffsetMappingTest.cpp
index e04081378283..b50374a449c8 100644
--- a/clang/unittests/Basic/LineOffsetMappingTest.cpp
+++ b/clang/unittests/Basic/LineOffsetMappingTest.cpp
@@ -20,7 +20,7 @@ TEST(LineOffsetMappingTest, empty) {
EXPECT_FALSE(Mapping);
#if !defined(NDEBUG) && GTEST_HAS_DEATH_TEST
- EXPECT_DEATH((void)Mapping.getLines(), "Assertion");
+ EXPECT_DEATH((void)Mapping.getLines(), "Storage");
#endif
}
@@ -34,7 +34,7 @@ TEST(LineOffsetMappingTest, construct) {
EXPECT_EQ(20u, Mapping[2]);
#if !defined(NDEBUG) && GTEST_HAS_DEATH_TEST
- EXPECT_DEATH((void)Mapping[3], "Assertion");
+ EXPECT_DEATH((void)Mapping[3], "Invalid index");
#endif
}
More information about the cfe-commits
mailing list