Re: help with an upstream test suite problem?
A quick look at the rest of the code shows that util.h tests
#ifndef __BIG_ENDIAN__
which probably doesn't work because it needs the right header.
#include <endian.h>
#if BYTE_ORDER == LITTLE_ENDIAN
works under Linux, though it probably isn't portable.
-f
On Wed, 23 Nov 2005, Paul Wise wrote:
> Hi,
>
> I recently enabled my upstream's cppunit test suite in an upload to
> experimental and the endianess test failed on m68k. The test is
> basically like so:
>
> #define SWAP_ENDIAN_INT32(x) ( \
> (((x)&0xFF000000) >> 24) | \
> (((x)&0x00FF0000) >> 8) | \
> (((x)&0x0000FF00) << 8) | \
> (((x)&0x000000FF) << 24) )
>
> CPPUNIT_ASSERT_EQUAL( (int)0x78563412, (int)SWAP_ENDIAN_INT32(0x12345678) );
>
> I've zero idea why this would fail on m68k (perhaps it is related to the
> casts?), but the result was this:
>
> Expected: 2018915346 (0x78563412)
> Actual: 305419896 (0x12345678)
>
> If anyone has time to explain what the problem is, that would be very
> much appreciated.
>
> The relevant source files are available here:
>
> http://cvs.sourceforge.net/viewcvs.py/*checkout*/nsis/NSIS/Source/util.h
> http://cvs.sourceforge.net/viewcvs.py/*checkout*/nsis/NSIS/Source/Tests/endian.cpp
>
> Buildd logs are available here:
>
> http://experimental.debian.net/fetch.php?&pkg=nsis&ver=2.11-1&arch=m68k&stamp=1132413921&file=log&as=raw
>
>
Reply to: