From c156427ded1dfa7686c90cc56ad16013a079a742 Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Wed, 16 Nov 2016 21:15:24 +0000 Subject: Don't allow direct access to StreamString's internal buffer. This is a large API change that removes the two functions from StreamString that return a std::string& and a const std::string&, and instead provide one function which returns a StringRef. Direct access to the underlying buffer violates the concept of a "stream" which is intended to provide forward only access, and makes porting to llvm::raw_ostream more difficult in the future. Differential Revision: https://reviews.llvm.org/D26698 llvm-svn: 287152 --- .../ScriptInterpreter/Python/PythonDataObjectsTests.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp') diff --git a/lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp b/lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp index 590b143..202a65b 100644 --- a/lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp +++ b/lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp @@ -255,17 +255,17 @@ TEST_F(PythonDataObjectsTest, TestPythonString) { // Test that creating a `PythonString` object works correctly with the // string constructor PythonString constructed_string(test_string2); - EXPECT_STREQ(test_string2, constructed_string.GetString().str().c_str()); + EXPECT_STREQ(test_string2, constructed_string.c_str()); } TEST_F(PythonDataObjectsTest, TestPythonStringToStr) { const char *c_str = "PythonDataObjectsTest::TestPythonStringToStr"; PythonString str(c_str); - EXPECT_STREQ(c_str, str.GetString().str().c_str()); + EXPECT_STREQ(c_str, str.c_str()); PythonString str_str = str.Str(); - EXPECT_STREQ(c_str, str_str.GetString().str().c_str()); + EXPECT_STREQ(c_str, str_str.c_str()); } TEST_F(PythonDataObjectsTest, TestPythonIntegerToStr) {} @@ -315,7 +315,7 @@ TEST_F(PythonDataObjectsTest, TestPythonListValueEquality) { PythonString chk_str(PyRefType::Borrowed, chk_value2.get()); EXPECT_EQ(long_value0, chk_int.GetInteger()); - EXPECT_STREQ(string_value1, chk_str.GetString().str().c_str()); + EXPECT_STREQ(string_value1, chk_str.c_str()); } TEST_F(PythonDataObjectsTest, TestPythonListManipulation) { @@ -343,7 +343,7 @@ TEST_F(PythonDataObjectsTest, TestPythonListManipulation) { PythonString chk_str(PyRefType::Borrowed, chk_value2.get()); EXPECT_EQ(long_value0, chk_int.GetInteger()); - EXPECT_STREQ(string_value1, chk_str.GetString().str().c_str()); + EXPECT_STREQ(string_value1, chk_str.c_str()); } TEST_F(PythonDataObjectsTest, TestPythonListToStructuredList) { @@ -466,7 +466,7 @@ TEST_F(PythonDataObjectsTest, TestPythonDictionaryValueEquality) { PythonString chk_str(PyRefType::Borrowed, chk_value2.get()); EXPECT_EQ(value_0, chk_int.GetInteger()); - EXPECT_STREQ(value_1, chk_str.GetString().str().c_str()); + EXPECT_STREQ(value_1, chk_str.c_str()); } TEST_F(PythonDataObjectsTest, TestPythonDictionaryManipulation) { @@ -503,7 +503,7 @@ TEST_F(PythonDataObjectsTest, TestPythonDictionaryManipulation) { PythonString chk_str(PyRefType::Borrowed, chk_value2.get()); EXPECT_EQ(value_0, chk_int.GetInteger()); - EXPECT_STREQ(value_1, chk_str.GetString().str().c_str()); + EXPECT_STREQ(value_1, chk_str.c_str()); } TEST_F(PythonDataObjectsTest, TestPythonDictionaryToStructuredDictionary) { -- cgit v1.1