Failed test t/local/00_ptr_cast on Ubuntu 9.04 Jaunty.
make test output:
t/local/00_ptr_cast..............# compiling test program with: cc -o
t/local/ptr_cast_test t/local/ptr_cast_test.c
# Failed test 'STDERR empty after compiling'
# at t/local/00_ptr_cast.t line 28.
# got: 't/local/ptr_cast_test.c: In function 'main':
# t/local/ptr_cast_test.c:27: warning: format '%d' expects type 'int',
but argument 4 has type 'long unsigned int'
# t/local/ptr_cast_test.c:27: warning: format '%d' expects type 'int',
but argument 6 has type 'long unsigned int'
# '
# expected: ''
t/local/00_ptr_cast..............NOK 2/5# Looks like you failed 1 test
of 5.
Error is due to t/local/ptr_cast_test.c producing warnings. The test
fails if the compilation produces anything on stderr. The relevant
portion of 00_ptr_cast.t:
my $cmd = "$Config{cc} -o $output $input " . join(' ', @extraargs);
diag( "compiling test program with: $cmd" );
my $pid = open3(undef, $out, $err, $cmd);
waitpid $pid, 0;
is( $?, 0, 'compiling ptr_cast_test.c' );
is( do { local $/ = undef; <$err>}, '', 'STDERR empty after compiling' );
The attached patch changes the format specifier from %d to %lu.
Alternatively, we add an option to suppress warnings (if that can be
done portably) or maybe only fail if the compile returns a non-zero exit
status (dunno if that's reliable or not).
Subject: | net-ssleay-1.35-ptr_cast_test.patch |
--- t/local/ptr_cast_test.c.orig 2009-07-17 23:59:11.000000000 -0700
+++ t/local/ptr_cast_test.c 2009-07-17 23:59:23.000000000 -0700
@@ -23,7 +23,7 @@
FROMTYPE bufptr = (FROMTYPE) malloc(500);
volatile TOTYPE i; /* prevent optimization */
- printf("# %s: '%s' len: %d, '%s' len: %d.\n", argv[0], FROMTYPESTR,
+ printf("# %s: '%s' len: %lu, '%s' len: %lu.\n", argv[0], FROMTYPESTR,
sizeof(TOTYPE), TOTYPESTR, sizeof(char *));
i = (TOTYPE)bufptr;