From 5bfee5f1c8b11915b6c2c894b8f938f406c14e93 Mon Sep 17 00:00:00 2001 From: Abhishek Aggarwal Date: Mon, 29 May 2017 08:25:46 +0000 Subject: Added new API to SBStructuredData class Summary: - Added API to access data types -- integer, double, array, string, boolean and dictionary data types -- Earlier user had to parse through the string output to get these values - Added Test cases for API testing - Added new StructuredDataType enum in public include file -- Replaced locally-defined enum in StructuredData.h with this new one -- Modified other internal files using this locally-defined enum Signed-off-by: Abhishek Aggarwal Reviewers: clayborg, lldb-commits Reviewed By: clayborg Subscribers: labath Differential Revision: https://reviews.llvm.org/D33434 llvm-svn: 304138 --- .../ScriptInterpreter/Python/PythonDataObjectsTests.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 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 192e64d..1376f26 100644 --- a/lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp +++ b/lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp @@ -15,6 +15,7 @@ #include "lldb/Host/File.h" #include "lldb/Host/FileSystem.h" #include "lldb/Host/HostInfo.h" +#include "lldb/lldb-enumerations.h" #include "PythonTestSuite.h" @@ -355,9 +356,9 @@ TEST_F(PythonDataObjectsTest, TestPythonListToStructuredList) { list.AppendItem(PythonString(string_value1)); auto array_sp = list.CreateStructuredArray(); - EXPECT_EQ(StructuredData::Type::eTypeInteger, + EXPECT_EQ(lldb::eStructuredDataTypeInteger, array_sp->GetItemAtIndex(0)->GetType()); - EXPECT_EQ(StructuredData::Type::eTypeString, + EXPECT_EQ(lldb::eStructuredDataTypeString, array_sp->GetItemAtIndex(1)->GetType()); auto int_sp = array_sp->GetItemAtIndex(0)->GetAsInteger(); @@ -424,9 +425,9 @@ TEST_F(PythonDataObjectsTest, TestPythonTupleToStructuredList) { auto array_sp = tuple.CreateStructuredArray(); EXPECT_EQ(tuple.GetSize(), array_sp->GetSize()); - EXPECT_EQ(StructuredData::Type::eTypeInteger, + EXPECT_EQ(lldb::eStructuredDataTypeInteger, array_sp->GetItemAtIndex(0)->GetType()); - EXPECT_EQ(StructuredData::Type::eTypeString, + EXPECT_EQ(lldb::eStructuredDataTypeString, array_sp->GetItemAtIndex(1)->GetType()); } -- cgit v1.1