summaryrefslogtreecommitdiffstats
path: root/lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2016-11-16 21:15:24 +0000
committerZachary Turner <zturner@google.com>2016-11-16 21:15:24 +0000
commitc156427ded1dfa7686c90cc56ad16013a079a742 (patch)
treef4912beeebd9e7a04e9c20a8e05d64e25bde192d /lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp
parent725dc14bb21da8a01709a6b3370a658d071689dc (diff)
downloadbcm5719-llvm-c156427ded1dfa7686c90cc56ad16013a079a742.tar.gz
bcm5719-llvm-c156427ded1dfa7686c90cc56ad16013a079a742.zip
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
Diffstat (limited to 'lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp')
-rw-r--r--lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp b/lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp
index 590b143ec7a..202a65b7f25 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) {
OpenPOWER on IntegriCloud