summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping
diff options
context:
space:
mode:
authorUlrich Weigand <ulrich.weigand@de.ibm.com>2016-04-14 14:35:02 +0000
committerUlrich Weigand <ulrich.weigand@de.ibm.com>2016-04-14 14:35:02 +0000
commit7e8de59b9059a2eec1367f32c0a06561f5e025ac (patch)
tree7c45afced59af2c934f84169e2defd5e3da9777b /lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping
parent91a2ad182df725452d453407ea9f87874a0f0b1e (diff)
downloadbcm5719-llvm-7e8de59b9059a2eec1367f32c0a06561f5e025ac.tar.gz
bcm5719-llvm-7e8de59b9059a2eec1367f32c0a06561f5e025ac.zip
Fix test cases for big-endian systems
A number of test cases were failing on big-endian systems simply due to byte order assumptions in the tests themselves, and no underlying bug in LLDB. These two test cases: tools/lldb-server/lldbgdbserverutils.py python_api/process/TestProcessAPI.py actually check for big-endian target byte order, but contain Python errors in the corresponding code paths. These test cases: functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py functionalities/data-formatter/data-formatter-smart-array/TestDataFormatterSmartArray.py functionalities/data-formatter/synthcapping/TestSyntheticCapping.py lang/cpp/frame-var-anon-unions/TestFrameVariableAnonymousUnions.py python_api/sbdata/TestSBData.py (first change) could be fixed to check for big-endian target byte order and update the expected result strings accordingly. For the two synthetic tests, I've also updated the source to make sure the fake_a value is always nonzero on both big- and little-endian platforms. These test case: python_api/sbdata/TestSBData.py (second change) functionalities/memory/cache/TestMemoryCache.py simply accessed memory with the wrong size, which wasn't noticed on LE but fails on BE. Differential Revision: http://reviews.llvm.org/D18985 llvm-svn: 266315
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping')
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py22
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/main.cpp2
2 files changed, 16 insertions, 8 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py
index ad554f5c4dd..e8b6c1ad95f 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py
@@ -31,6 +31,8 @@ class SyntheticCappingTestCase(TestBase):
self.runCmd("run", RUN_SUCCEEDED)
+ process = self.dbg.GetSelectedTarget().GetProcess()
+
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
substrs = ['stopped',
@@ -52,25 +54,31 @@ class SyntheticCappingTestCase(TestBase):
self.runCmd("script from fooSynthProvider import *")
self.runCmd("type synth add -l fooSynthProvider foo")
+ # note that the value of fake_a depends on target byte order
+ if process.GetByteOrder() == lldb.eByteOrderLittle:
+ fake_a_val = 0x02000000
+ else:
+ fake_a_val = 0x00000100
+
# check that the synthetic children work, so we know we are doing the right thing
self.expect("frame variable f00_1",
- substrs = ['r = 33',
- 'fake_a = 16777216',
- 'a = 0']);
+ substrs = ['r = 34',
+ 'fake_a = %d' % fake_a_val,
+ 'a = 1']);
# check that capping works
self.runCmd("settings set target.max-children-count 2", check=False)
self.expect("frame variable f00_1",
substrs = ['...',
- 'fake_a = 16777216',
- 'a = 0']);
+ 'fake_a = %d' % fake_a_val,
+ 'a = 1']);
self.expect("frame variable f00_1", matching=False,
- substrs = ['r = 33']);
+ substrs = ['r = 34']);
self.runCmd("settings set target.max-children-count 256", check=False)
self.expect("frame variable f00_1", matching=True,
- substrs = ['r = 33']);
+ substrs = ['r = 34']);
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/main.cpp b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/main.cpp
index b921915b91c..fec7907e003 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/main.cpp
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/main.cpp
@@ -48,7 +48,7 @@ struct wrapint
int main()
{
- foo f00_1(0);
+ foo f00_1(1);
foo *f00_ptr = new foo(12);
f00_1.a++; // Set break point at this line.
OpenPOWER on IntegriCloud