Hi,
I enabled the tests for arm in configure.ac, copied the
test/sysdeps/i686 to arm and tried it
(I ran test/test.sh from the top level - is that the intended way?)
test_char_3 failed:
expected pattern='test_char_3\(a = 0x01, b = 0xfe, c = 0x07\)'
received='test_char_3(a = 0x01, b = 0xfe '�', c = 0x07)
[/discs/more/daveg/git/latrace/lib-test-args.so] {
} test_char_3 = 0xf7 '�'
(I modified re_test to print the expected/received).
The problem here is that on ARM 'char' is unsigned by default where as
on most other platforms it's
signed; the code in src/args.c does:
if (*((char*) pval) <= ' ')
len = snprintf(argbuf, alen, "0x%02x",
*((unsigned char*) pval));
else
len = snprintf(argbuf, alen, "0x%02x
\'%c\'",
*((unsigned char*)
pval), *((char*) pval));
on ARM the 0xfe is treated as a positive value and hence the test
prints the character out.
Is there a reason that you didn't use isprint() - perhaps worried
about the difference between locales?
I'm also getting result mismatches on test_char_6 (getting 0x0e
instead of the expected 0x6e).
I haven't worked through the math of teh code in test_char_6, but with
all those divides and stuff I
wouldn't be surprised if this is also a signedness issue.
I also had to change the shell in test/test.sh to /bin/bash - the
/bin/sh I have seems to be dash
which doesn't have functions.
Another suggestion is not to separate test_long into CPU specific
sysdeps; there are only a few
combinations and they'll be shared among lots of CPUs - i686 and ARM
are the same for those tests.
Dave