[Lldb-commits] [PATCH] D18985: Fix test cases for big-endian systems

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Mon Apr 11 14:08:32 PDT 2016


clayborg requested changes to this revision.
clayborg added a comment.
This revision now requires changes to proceed.

So many tests above are going to accept either a little endian or big endian value. This will make most of these tests useless since if a little endian machine fails with a big endian number we won't catch it and vice versa. So we need to expect the correct value for little endian and a different but correct one for big endian tests and only accept the correct one.


================
Comment at: packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py:75-79
@@ -74,6 +74,7 @@
         # check that we get the two real vars and the fake_a variables
+        # note that the value of fake_a depends on target byte order
         self.expect("frame variable f00_1",
-                    substrs = ['r = 33',
-                               'fake_a = 16777216',
-                               'a = 0']);
+                    patterns = ['r = 33',
+                                'fake_a = (16777216|0)',
+                                'a = 0']);
 
----------------
Zero seems like a bad alternate value as it could cover up a real failure. Can we improve this test so that we are testing for actual values? Or can we change the test by endianness and test for 16777216 for little endian and something else that is not zero for big endian? We don't want zero to be valid for little endian tests.

================
Comment at: packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py:87
@@ -85,3 +86,3 @@
         self.expect('frame variable f00_1.fake_a',
-                substrs = ['16777216'])
+                patterns = ['(16777216|0)'])
         
----------------
ditto

================
Comment at: packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py:91
@@ -89,3 +90,3 @@
         self.expect('frame variable f00_1[1]',
-                    substrs = ['16777216'])
+                    patterns = ['(16777216|0)'])
         
----------------
ditto

================
Comment at: packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py:96
@@ -94,3 +95,3 @@
         self.expect('frame variable f00_1',
-                    substrs = ['fake_a=16777216'])
+                    patterns = ['fake_a=(16777216|0)'])
         self.runCmd("type summary add --summary-string \"fake_a=${svar[1]}\" foo")
----------------
ditto

================
Comment at: packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py:99
@@ -97,3 +98,3 @@
         self.expect('frame variable f00_1',
-            substrs = ['fake_a=16777216'])
+            patterns = ['fake_a=(16777216|0)'])
         
----------------
ditto

================
Comment at: packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py:109
@@ +108,3 @@
+                    patterns = ['r = 33',
+                                'fake_a = (16777216|256)',
+                                'a = 1']);
----------------
We should expect one thing for little endian and one for big, don't accept either.

================
Comment at: packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py:116
@@ +115,3 @@
+                    patterns = ['r = 33',
+                                'fake_a = (16777217|71680)',
+                                'a = 280']);
----------------
We should expect one thing for little endian and one for big, don't accept either.

================
Comment at: packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py:122
@@ +121,3 @@
+            patterns = ['r = 45',
+                        'fake_a = (218103808|3072)',
+                        'a = 12'])
----------------
We should expect one thing for little endian and one for big, don't accept either.

================
Comment at: packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py:135
@@ +134,3 @@
+                    patterns = ['r = 45',
+                                'fake_a = (218103808|3072)',
+                                'a = 12'])
----------------
We should expect one thing for little endian and one for big, don't accept either.

================
Comment at: packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py:147
@@ +146,3 @@
+                    patterns = ['r = 45',
+                                'fake_a = (218103808|3072)',
+                                'a = 12'])
----------------
We should expect one thing for little endian and one for big, don't accept either.

================
Comment at: packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py:172
@@ +171,3 @@
+                    patterns = ['r = 45',
+                                'fake_a = (218103808|3072)',
+                                'a = 12'])
----------------
We should expect one thing for little endian and one for big, don't accept either.

================
Comment at: packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py:58
@@ +57,3 @@
+                    patterns = ['r = 33',
+                                'fake_a = (16777216|0)',
+                                'a = 0']);
----------------
We should expect one thing for little endian and one for big, don't accept either.

================
Comment at: packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py:66
@@ +65,3 @@
+                    patterns = ['...',
+                                'fake_a = (16777216|0)',
+                                'a = 0']);
----------------
We should expect one thing for little endian and one for big, don't accept either.

================
Comment at: packages/Python/lldbsuite/test/lang/cpp/frame-var-anon-unions/TestFrameVariableAnonymousUnions.py:22
@@ -21,3 +21,3 @@
 
-        self.expect('frame variable -f x i', substrs=['ffffff41'])
+        self.expect('frame variable -f x i', patterns=['(ffffff41|41ffff00)'])
         self.expect('frame variable c', substrs=["'A"])
----------------
We should expect one thing for little endian and one for big, don't accept either.


http://reviews.llvm.org/D18985





More information about the lldb-commits mailing list