On Jan 26, 2004, at 2:00 AM, Leopold Toetsch wrote:

Michael Scott <[EMAIL PROTECTED]> wrote:
I see that t/src/io is now failing on OS X 10.3.2. Is anyone else
seeing this on another system?

t/src/io................ok 12/19#     Failed test (t/src/io.t at line
395)
#          got: '0
# 0
# 0
# '
#     expected: '0
# 6
# 60000
# '

Does OS X use io_unix.c or io_stdio.c? Can you debug/trace/strace the code?

Ah, it turns out to be a simple fix. The return value of PIO_tell() is PIOOFF_T, which ends up being a long long on Mac OS X, and the "%d" format is only printing out the first word of the return value. The easiest fix, for the purpose of the test, is just to cast the return value to an int. (A format string of "%lld" also works, but PIOOFF_T is just a long on some platforms, so the cast is the most portable fix.) Patch below.


JEff

Index: t/src/io.t
===================================================================
RCS file: /cvs/public/parrot/t/src/io.t,v
retrieving revision 1.10
diff -u -r1.10 io.t
--- t/src/io.t  25 Jan 2004 10:42:38 -0000      1.10
+++ t/src/io.t  9 Feb 2004 00:36:22 -0000
@@ -409,11 +409,11 @@

buf = malloc(65536 * sizeof(char));

-    printf("%d\n", PIO_tell(interpreter, io));
+    printf("%d\n", (int)PIO_tell(interpreter, io));
     PIO_read(interpreter, io, buf, 6);
-    printf("%d\n", PIO_tell(interpreter, io));
+    printf("%d\n", (int)PIO_tell(interpreter, io));
     PIO_read(interpreter, io, buf, 65535);
-    printf("%d\n", PIO_tell(interpreter, io));
+    printf("%d\n", (int)PIO_tell(interpreter, io));

     return NULL;
 }



Reply via email to