[unittest] Fix scalar unit test.
authorJonas Devlieghere <jonas@devlieghere.com>
Thu, 31 Jan 2019 18:48:17 +0000 (18:48 +0000)
committerJonas Devlieghere <jonas@devlieghere.com>
Thu, 31 Jan 2019 18:48:17 +0000 (18:48 +0000)
The test was using ASSERT_EQ instead of ASSERT_STREQ which meant we were
comparing string addresses instead of the actual string. This caused the
test to fail with with the sanitizers enabled.

llvm-svn: 352780

lldb/unittests/Utility/ScalarTest.cpp

index 1b95bd8..d4a0849 100644 (file)
@@ -288,13 +288,13 @@ TEST(ScalarTest, Scalar_512) {
   ASSERT_TRUE(Z.IsZero());
 
   Scalar S(APInt(512, 2000));
-  EXPECT_EQ(S.GetTypeAsCString(), "int512_t");
-  EXPECT_EQ(S.GetValueTypeAsCString(Scalar::e_sint512), "int512_t");
+  ASSERT_STREQ(S.GetTypeAsCString(), "int512_t");
+  ASSERT_STREQ(S.GetValueTypeAsCString(Scalar::e_sint512), "int512_t");
 
   ASSERT_TRUE(S.MakeUnsigned());
   EXPECT_EQ(S.GetType(), Scalar::e_uint512);
-  EXPECT_EQ(S.GetTypeAsCString(), "unsigned int512_t");
-  EXPECT_EQ(S.GetValueTypeAsCString(Scalar::e_uint512), "uint512_t");
+  ASSERT_STREQ(S.GetTypeAsCString(), "unsigned int512_t");
+  ASSERT_STREQ(S.GetValueTypeAsCString(Scalar::e_uint512), "uint512_t");
   EXPECT_EQ(S.GetByteSize(), 64U);
 
   ASSERT_TRUE(S.MakeSigned());