Re: [gnet] gnet-2.0.7 - test failed



On Mon, 2006-10-30 at 20:01 +0100, Peper wrote:

Hi,

> With the version from CVS:
> FAIL: pack_test
> ............143 attempts

I guess the truth is that the entire gnet_pack() API is pretty much
broken for anything but bytes and strings, at least for the purpose of
communicating between different machines.

Still, could you try the attached patch to see if that makes the pack
test pass?

 Cheers
  -Tim

Index: pack_test.c
===================================================================
RCS file: /cvs/gnome/gnet/tests/pack_test.c,v
retrieving revision 1.2
diff -u -p -r1.2 pack_test.c
--- pack_test.c	3 Jun 2003 17:08:49 -0000	1.2
+++ pack_test.c	31 Oct 2006 13:12:00 -0000
@@ -146,19 +146,19 @@ main(int argc, char** argv)
   TEST1 (10710, "f1020304", "I", sizeof(unsigned int), 0xf1020304);
   TEST1 (10720, "010203f4", "I", sizeof(unsigned int), 0x010203f4);
 
-  TEST1 (10800, "01020304", "l", sizeof(long), 0x01020304);
-  TEST1 (10810, "f1020304", "l", sizeof(long), 0xf1020304);
-  TEST1 (10820, "010203f4", "l", sizeof(long), 0x010203f4);
+  TEST1 (10800, "01020304", "l", sizeof(long), (long) 0x01020304);
+  TEST1 (10810, "f1020304", "l", sizeof(long), (long) 0xf1020304);
+  TEST1 (10820, "010203f4", "l", sizeof(long), (long) 0x010203f4);
 
-  TEST1 (10900, "01020304", "L", sizeof(unsigned long), 0x01020304);
-  TEST1 (10910, "f1020304", "L", sizeof(unsigned long), 0xf1020304);
-  TEST1 (10920, "010203f4", "L", sizeof(unsigned long), 0x010203f4);
+  TEST1 (10900, "01020304", "L", sizeof(unsigned long), (unsigned long) 0x01020304);
+  TEST1 (10910, "f1020304", "L", sizeof(unsigned long), (unsigned long) 0xf1020304);
+  TEST1 (10920, "010203f4", "L", sizeof(unsigned long), (unsigned long) 0x010203f4);
 
   if (sizeof(void*) == 4)
     {
-      TEST1 (11100, "01020304", "v", sizeof(void*), (void*) 0x01020304);
-      TEST1 (11110, "f1020304", "v", sizeof(void*), (void*) 0xf1020304);
-      TEST1 (11120, "010203f4", "v", sizeof(void*), (void*) 0x010203f4);
+      TEST1 (11100, "01020304", "v", sizeof(void*), (void*) GUINT_TO_POINTER (0x01020304));
+      TEST1 (11110, "f1020304", "v", sizeof(void*), (void*) GUINT_TO_POINTER (0xf1020304));
+      TEST1 (11120, "010203f4", "v", sizeof(void*), (void*) GUINT_TO_POINTER (0x010203f4));
     }
 
   TEST3 (11200, "00000102", "bhb", 4,  0x00, 0x0001, 0x02);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]