[Lldb-commits] [lldb] r352780 - [unittest] Fix scalar unit test.

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Thu Jan 31 10:48:18 PST 2019


Author: jdevlieghere
Date: Thu Jan 31 10:48:17 2019
New Revision: 352780

URL: http://llvm.org/viewvc/llvm-project?rev=352780&view=rev
Log:
[unittest] Fix scalar unit test.

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.

Modified:
    lldb/trunk/unittests/Utility/ScalarTest.cpp

Modified: lldb/trunk/unittests/Utility/ScalarTest.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Utility/ScalarTest.cpp?rev=352780&r1=352779&r2=352780&view=diff
==============================================================================
--- lldb/trunk/unittests/Utility/ScalarTest.cpp (original)
+++ lldb/trunk/unittests/Utility/ScalarTest.cpp Thu Jan 31 10:48:17 2019
@@ -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());




More information about the lldb-commits mailing list