[Lldb-commits] [PATCH] D17545: Fix PythonDataObjectsTests for python 2

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Tue Feb 23 08:38:05 PST 2016


labath created this revision.
labath added a reviewer: zturner.
labath added a subscriber: lldb-commits.

the python2 branch seems erroneous as it expected the object to be both a "String" and "Bytes".
Fix the expectation.

http://reviews.llvm.org/D17545

Files:
  unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp

Index: unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp
===================================================================
--- unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp
+++ unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp
@@ -209,14 +209,13 @@
     PyObject *py_bytes = PyBytes_FromString(test_bytes);
     EXPECT_TRUE(PythonBytes::Check(py_bytes));
     PythonBytes python_bytes(PyRefType::Owned, py_bytes);
-    EXPECT_EQ(PyObjectType::Bytes, python_bytes.GetObjectType());
 
 #if PY_MAJOR_VERSION < 3
     EXPECT_TRUE(PythonString::Check(py_bytes));
     EXPECT_EQ(PyObjectType::String, python_bytes.GetObjectType());
 #else
     EXPECT_FALSE(PythonString::Check(py_bytes));
-    EXPECT_NE(PyObjectType::String, python_bytes.GetObjectType());
+    EXPECT_EQ(PyObjectType::Bytes, python_bytes.GetObjectType());
 #endif
 
     llvm::ArrayRef<uint8_t> bytes = python_bytes.GetBytes();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17545.48820.patch
Type: text/x-patch
Size: 932 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20160223/47e5818e/attachment.bin>


More information about the lldb-commits mailing list