Author: zturner Date: Wed Nov 16 15:45:11 2016 New Revision: 287158 URL: http://llvm.org/viewvc/llvm-project?rev=287158&view=rev Log: Fix some unit test compilation failures.
Modified: lldb/trunk/unittests/Core/TimerTest.cpp lldb/trunk/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp Modified: lldb/trunk/unittests/Core/TimerTest.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Core/TimerTest.cpp?rev=287158&r1=287157&r2=287158&view=diff ============================================================================== --- lldb/trunk/unittests/Core/TimerTest.cpp (original) +++ lldb/trunk/unittests/Core/TimerTest.cpp Wed Nov 16 15:45:11 2016 @@ -64,7 +64,7 @@ TEST(TimerTest, CategoryTimes2) { double seconds1, seconds2; ASSERT_EQ(2, sscanf(ss.GetData(), "%lf sec for CAT1%*[\n ]%lf sec for CAT2", &seconds1, &seconds2)) - << "String: " << ss.GetString(); + << "String: " << ss.GetData(); EXPECT_LT(0.01, seconds1); EXPECT_GT(1, seconds1); EXPECT_LT(0.001, seconds2); Modified: lldb/trunk/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp?rev=287158&r1=287157&r2=287158&view=diff ============================================================================== --- lldb/trunk/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp (original) +++ lldb/trunk/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp Wed Nov 16 15:45:11 2016 @@ -255,17 +255,17 @@ TEST_F(PythonDataObjectsTest, TestPython // Test that creating a `PythonString` object works correctly with the // string constructor PythonString constructed_string(test_string2); - EXPECT_STREQ(test_string2, constructed_string.c_str()); + EXPECT_EQ(test_string2, constructed_string.GetString()); } TEST_F(PythonDataObjectsTest, TestPythonStringToStr) { - const char *c_str = "PythonDataObjectsTest::TestPythonStringToStr"; + const char *GetString = "PythonDataObjectsTest::TestPythonStringToStr"; - PythonString str(c_str); - EXPECT_STREQ(c_str, str.c_str()); + PythonString str(GetString); + EXPECT_EQ(GetString, str.GetString()); PythonString str_str = str.Str(); - EXPECT_STREQ(c_str, str_str.c_str()); + EXPECT_EQ(GetString, str_str.GetString()); } TEST_F(PythonDataObjectsTest, TestPythonIntegerToStr) {} @@ -281,7 +281,7 @@ TEST_F(PythonDataObjectsTest, TestPython "PythonDataObjectsTest::TestPythonStringToStructuredString"; PythonString constructed_string(test_string); auto string_sp = constructed_string.CreateStructuredString(); - EXPECT_STREQ(test_string, string_sp->GetStringValue().c_str()); + EXPECT_EQ(test_string, string_sp->GetStringValue()); } TEST_F(PythonDataObjectsTest, TestPythonListValueEquality) { @@ -315,7 +315,7 @@ TEST_F(PythonDataObjectsTest, TestPython PythonString chk_str(PyRefType::Borrowed, chk_value2.get()); EXPECT_EQ(long_value0, chk_int.GetInteger()); - EXPECT_STREQ(string_value1, chk_str.c_str()); + EXPECT_EQ(string_value1, chk_str.GetString()); } TEST_F(PythonDataObjectsTest, TestPythonListManipulation) { @@ -343,7 +343,7 @@ TEST_F(PythonDataObjectsTest, TestPython PythonString chk_str(PyRefType::Borrowed, chk_value2.get()); EXPECT_EQ(long_value0, chk_int.GetInteger()); - EXPECT_STREQ(string_value1, chk_str.c_str()); + EXPECT_EQ(string_value1, chk_str.GetString()); } TEST_F(PythonDataObjectsTest, TestPythonListToStructuredList) { @@ -364,7 +364,7 @@ TEST_F(PythonDataObjectsTest, TestPython auto string_sp = array_sp->GetItemAtIndex(1)->GetAsString(); EXPECT_EQ(long_value0, long(int_sp->GetValue())); - EXPECT_STREQ(string_value1, string_sp->GetValue().c_str()); + EXPECT_EQ(string_value1, string_sp->GetValue()); } TEST_F(PythonDataObjectsTest, TestPythonTupleSize) { @@ -466,7 +466,7 @@ TEST_F(PythonDataObjectsTest, TestPython PythonString chk_str(PyRefType::Borrowed, chk_value2.get()); EXPECT_EQ(value_0, chk_int.GetInteger()); - EXPECT_STREQ(value_1, chk_str.c_str()); + EXPECT_EQ(value_1, chk_str.GetString()); } TEST_F(PythonDataObjectsTest, TestPythonDictionaryManipulation) { @@ -503,7 +503,7 @@ TEST_F(PythonDataObjectsTest, TestPython PythonString chk_str(PyRefType::Borrowed, chk_value2.get()); EXPECT_EQ(value_0, chk_int.GetInteger()); - EXPECT_STREQ(value_1, chk_str.c_str()); + EXPECT_EQ(value_1, chk_str.GetString()); } TEST_F(PythonDataObjectsTest, TestPythonDictionaryToStructuredDictionary) { @@ -526,7 +526,7 @@ TEST_F(PythonDataObjectsTest, TestPython auto string_sp = dict_sp->GetValueForKey(string_key0)->GetAsString(); auto int_sp = dict_sp->GetValueForKey(string_key1)->GetAsInteger(); - EXPECT_STREQ(string_value0, string_sp->GetValue().c_str()); + EXPECT_EQ(string_value0, string_sp->GetValue()); EXPECT_EQ(int_value1, long(int_sp->GetValue())); } _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits