diff --git a/lldb/test/array_types/TestArrayTypes.py b/lldb/test/array_types/TestArrayTypes.py index 38974a7649ac5dc3b83147796f42c4d9c75967a3..ca08da18290753e428439a054f43c81108c05755 100644 --- a/lldb/test/array_types/TestArrayTypes.py +++ b/lldb/test/array_types/TestArrayTypes.py @@ -148,6 +148,9 @@ class ArrayTypesTestCase(TestBase): "Variable 'char_16' should have 16 children") # Lookup the "ushort_matrix" ushort[] array variable. + # Notice the pattern of int(child0_2.GetValue(frame), 0). We pass a + # base of 0 so that the proper radix is determined based on the contents + # of the string. Same applies to long(). variable = frame.LookupVar("ushort_matrix") self.DebugSBValue(frame, variable) self.assertTrue(variable.GetNumChildren() == 2, @@ -158,7 +161,7 @@ class ArrayTypesTestCase(TestBase): "Variable 'ushort_matrix[0]' should have 3 children") child0_2 = child0.GetChildAtIndex(2) self.DebugSBValue(frame, child0_2) - self.assertTrue(int(child0_2.GetValue(frame), 16) == 3, + self.assertTrue(int(child0_2.GetValue(frame), 0) == 3, "ushort_matrix[0][2] == 3") # Lookup the "long_6" char array variable. @@ -168,7 +171,7 @@ class ArrayTypesTestCase(TestBase): "Variable 'long_6' should have 6 children") child5 = variable.GetChildAtIndex(5) self.DebugSBValue(frame, child5) - self.assertTrue(long(child5.GetValue(frame)) == 6, + self.assertTrue(long(child5.GetValue(frame), 0) == 6, "long_6[5] == 6") diff --git a/lldb/test/bitfields/TestBitfields.py b/lldb/test/bitfields/TestBitfields.py index c25c7bc51f54d3cd3b8dcb7fdf15ef6f5a4150fe..f3c71ee87a2a4123499863181f6e6c97b6ff606a 100644 --- a/lldb/test/bitfields/TestBitfields.py +++ b/lldb/test/bitfields/TestBitfields.py @@ -108,6 +108,9 @@ class BitfieldsTestCase(TestBase): bits.GetByteSize() == 4, "(Bits)bits with byte size of 4 and 8 children") + # Notice the pattern of int(b1.GetValue(frame), 0). We pass a base of 0 + # so that the proper radix is determined based on the contents of the + # string. b1 = bits.GetChildAtIndex(0) self.DebugSBValue(frame, b1) self.assertTrue(b1.GetName() == "b1" and