Richard Frith-Macdonald wrote:
On 4 Apr 2011, at 15:56, Wolfgang Lux wrote:
--- Running tests in base/NSNumber ---
base/NSNumber/test00.m:
Failed test: test00.m:111 ... NSDecimalNumber charValue works
The latter of these fails due to a mismatch between signed and
unsigned char. The test uses
(char)200 == [val1 charValue]
The result of charValue is signed char, but char is unsigned by
default on powerpc.
Thanks ... I just changed the test to be '(signed char)200 == [val1
charValue]' since, for consistency, charValue always returns a
signed char.
Thanks. This test now passes on PowerPC linux. As for the other two
failures, it looks like an endianness issue. Adding two log statements
NSLog(@" decoded object = %@", [decodedInstance objectAtIndex: 0]);
to decoding.m the interesting part of the output becomes:
Passed test: decoding.m:171 ... decoding current version of class
NSData
2011-04-05 13:25:10.517 decoding[10747] decoded object = <feff0057
00650020 006e0065 00650064 00200063 006f006e 00730074 0061006e
00740020 00640061 00740061>
Failed test: decoding.m:198 ... decoding version 0 of class NSData
2011-04-05 13:25:10.523 decoding[10747] decoded object = <fffe5700
65002000 6e006500 65006400 20006300 6f006e00 73007400 61006e00
74002000 64006100 74006100>
Passed test: decoding.m:171 ... decoding current version of class
NSMutableData
2011-04-05 13:25:10.525 decoding[10747] decoded object = <feff0057
00650020 006e0065 00650064 00200063 006f006e 00730074 0061006e
00740020 00640061 00740061>
Failed test: decoding.m:198 ... decoding version 0 of class
NSMutableData
2011-04-05 13:25:10.531 decoding[10747] decoded object = <fffe5700
65002000 6e006500 65006400 20006300 6f006e00 73007400 61006e00
74002000 64006100 74006100>
As you can see, byte order in the NSData objects is swapped in the
failed tests, which is sort of strange -- after all no byte swapping
should occur on a big-endian architecture as far as I recall.
Wolfgang
_______________________________________________
Gnustep-dev mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/gnustep-dev