[clang][unittest] Don't hardcode the string "Assertion"
authorBenjamin Kramer <benny.kra@googlemail.com>
Mon, 26 Oct 2020 17:10:56 +0000 (18:10 +0100)
committerBenjamin Kramer <benny.kra@googlemail.com>
Mon, 26 Oct 2020 17:10:56 +0000 (18:10 +0100)
This depends on the libc implementation. Use the string from the
assertion message instead. Overly specific, but so is this entire test.

clang/unittests/Basic/LineOffsetMappingTest.cpp

index e040813..b50374a 100644 (file)
@@ -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
 }