diff options
| author | Dave Lee <davelee.com@gmail.com> | 2025-09-03 10:51:09 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-03 10:51:09 -0700 |
| commit | 722339dc0927545834afffd8aca9a75efd450ca9 (patch) | |
| tree | 2716fafb15b5f7648a0026b553a5192c6dc299bf /lldb/test/API/python_api | |
| parent | adc0a2caff44e3884ce3189932fa0e9c8a28620d (diff) | |
| download | llvm-722339dc0927545834afffd8aca9a75efd450ca9.zip llvm-722339dc0927545834afffd8aca9a75efd450ca9.tar.gz llvm-722339dc0927545834afffd8aca9a75efd450ca9.tar.bz2 | |
[lldb] Revert custom __str__ in SBStructuredDataExtensions.i (#156721)
`__str__` was implemented in #155061, however its behavior was limited
to only a some kinds of `SBStructuredData`. That was a breaking change,
and this change removes that implementation of `__str__`, relying on the
existing behavior which calls `GetDescription`.
Diffstat (limited to 'lldb/test/API/python_api')
| -rw-r--r-- | lldb/test/API/python_api/sbstructureddata/TestStructuredDataAPI.py | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/lldb/test/API/python_api/sbstructureddata/TestStructuredDataAPI.py b/lldb/test/API/python_api/sbstructureddata/TestStructuredDataAPI.py index 6c00588..275ac03 100644 --- a/lldb/test/API/python_api/sbstructureddata/TestStructuredDataAPI.py +++ b/lldb/test/API/python_api/sbstructureddata/TestStructuredDataAPI.py @@ -48,6 +48,8 @@ class TestStructuredDataAPI(TestBase): s.Clear() error = example.GetDescription(s) self.assertSuccess(error, "GetDescription works") + # Ensure str() doesn't raise an exception. + self.assertTrue(str(example)) if not "key_float" in s.GetData(): self.fail("FAILED: could not find key_float in description output") @@ -344,7 +346,7 @@ class TestStructuredDataAPI(TestBase): self.fail("wrong output: " + str(output)) def test_round_trip_scalars(self): - for original in (0, 11, -1, 0.0, 4.5, -0.25, "", "dirk", True, False): + for original in (0, 11, -1, 0.0, 4.5, -0.25, True, False): constructor = type(original) data = lldb.SBStructuredData() data.SetFromJSON(json.dumps(original)) @@ -357,13 +359,6 @@ class TestStructuredDataAPI(TestBase): data.SetFromJSON(json.dumps(original)) self.assertEqual(data.dynamic, original) - def test_round_trip_string(self): - # No 0.0, it inherently does not round trip. - for original in (0, 11, -1, 4.5, -0.25, "", "dirk"): - data = lldb.SBStructuredData() - data.SetFromJSON(json.dumps(original)) - self.assertEqual(str(data), str(original)) - def test_round_trip_int(self): for original in (0, 11, -1): data = lldb.SBStructuredData() |
