summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/lang/cpp/frame-var-anon-unions/TestFrameVariableAnonymousUnions.py
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/lang/cpp/frame-var-anon-unions/TestFrameVariableAnonymousUnions.py
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/lang/cpp/frame-var-anon-unions/TestFrameVariableAnonymousUnions.py')
-rw-r--r--lldb/packages/Python/lldbsuite/test/lang/cpp/frame-var-anon-unions/TestFrameVariableAnonymousUnions.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/frame-var-anon-unions/TestFrameVariableAnonymousUnions.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/frame-var-anon-unions/TestFrameVariableAnonymousUnions.py
index 396a637041c..d5d53638822 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/frame-var-anon-unions/TestFrameVariableAnonymousUnions.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/frame-var-anon-unions/TestFrameVariableAnonymousUnions.py
@@ -19,7 +19,13 @@ class FrameVariableAnonymousUnionsTestCase(TestBase):
self.runCmd("process launch", RUN_SUCCEEDED)
- self.expect('frame variable -f x i', substrs=['ffffff41'])
+ process = self.dbg.GetSelectedTarget().GetProcess()
+
+ if process.GetByteOrder() == lldb.eByteOrderLittle:
+ self.expect('frame variable -f x i', substrs=['ffffff41'])
+ else:
+ self.expect('frame variable -f x i', substrs=['41ffff00'])
+
self.expect('frame variable c', substrs=["'A"])
self.expect('frame variable x', matching=False, substrs=['3'])
OpenPOWER on IntegriCloud