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

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Tue Apr 12 03:11:13 PDT 2016


labath added a subscriber: labath.
labath added a comment.

In http://reviews.llvm.org/D18985#398169, @uweigand wrote:

> In http://reviews.llvm.org/D18985#397674, @clayborg wrote:
>
> > 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.
>
>
> I fully agree this would be preferable.  Unfortunately I didn't see a straightforward way to detect in those test cases whether the target platform is big- or little-endian.  In the Python API tests this is simple, but these tests here just operate on the console interface.  Is there a good way to detect target byte order in such tests?


Just because the tests test the console interface, it doesn't mean you can't use the python interface to do auxiliary tasks, like computing the expectations. It sounds like you should be able to to a `self.target.GetByteOrder()` to get the info you need. (use `self.dbg.GetSelectedTarget()` if `self.target` happens to be empty, i don't remember if it's always set).


http://reviews.llvm.org/D18985





More information about the lldb-commits mailing list