diff options
author | Zachary Turner <zturner@google.com> | 2015-10-16 17:51:49 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2015-10-16 17:51:49 +0000 |
commit | 7d6d218e1219f7df284b83dfb3eaa5e5b70e77e8 (patch) | |
tree | 20841ad8e031d112a1b143bd60e336bac453eaea /lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp | |
parent | a6760f98cf628f215cea98cf0769c4294ca91cf3 (diff) | |
download | bcm5719-llvm-7d6d218e1219f7df284b83dfb3eaa5e5b70e77e8.tar.gz bcm5719-llvm-7d6d218e1219f7df284b83dfb3eaa5e5b70e77e8.zip |
Convert SWIG typemap string operations to PythonObjects.
llvm-svn: 250530
Diffstat (limited to 'lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp')
-rw-r--r-- | lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp b/lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp index 3502640c547..7abfb116c04 100644 --- a/lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp +++ b/lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp @@ -382,3 +382,14 @@ TEST_F(PythonDataObjectsTest, TestPythonFile) PythonFile py_file(file, "r"); EXPECT_TRUE(PythonFile::Check(py_file.get())); } + +TEST_F(PythonDataObjectsTest, TestObjectAttributes) +{ + PythonInteger py_int(42); + EXPECT_TRUE(py_int.HasAttribute("numerator")); + EXPECT_FALSE(py_int.HasAttribute("this_should_not_exist")); + + PythonInteger numerator_attr = py_int.GetAttributeValue("numerator").AsType<PythonInteger>(); + EXPECT_TRUE(numerator_attr.IsAllocated()); + EXPECT_EQ(42, numerator_attr.GetInteger()); +}
\ No newline at end of file |