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

[pygame] pgreloaded doesn't pass test suite



Hi,

I just gave pgreloaded (r2721) a spin. running the test suite resulted in 3 errors an 1 failure.
The first two are the same issue. I haven't looked into the other two.
I tracked down the first two to the argument parsing in _rect_init().
In rect.c line 243 you parse the arguments with "iiii" but the types you pass are "int, int, long int, long int"
so "iill" would be more adequate. and indeed changing this resolved the issue for me.
I'm running 64-bit system, which might be relevant.

I don't have much time on my hands these days but if you want me to run a simple test or provide other information
I would be glad to help out.

sincerely yours
//Lorenz


======================================================================
ERROR: RectTest.test_union__list
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/lorenz/src/extern/pygame/branches/pgreloaded/test/base_rect_test.py", line 825, in test_union__list
    self.assertEqual( Rect(-2, -2, 5, 5), r4 )
ValueError: width and height must not be negative

======================================================================
ERROR: RectTest.test_union_ip__list
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/lorenz/src/extern/pygame/branches/pgreloaded/test/base_rect_test.py", line 833, in test_union_ip__list
    self.assertEqual( Rect(-2, -2, 5, 5), r1 )
ValueError: width and height must not be negative

======================================================================
ERROR: SDLTimeTest.test_pygame2_sdl_time_remove_timer
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/lorenz/src/extern/pygame/branches/pgreloaded/test/sdl_time_test.py", line 144, in test_pygame2_sdl_time_remove_timer
    self.assertRaises (ValueError, sdltime.remove_timer, tobj)
  File "/usr/lib64/python2.6/site-packages/pygame2/test/pgunittest.py", line 330, in failUnlessRaises
    callableObj(*args, **kwargs)
TypeError: invalid timer id

======================================================================
FAIL: SDLTimeTest.test_pygame2_sdl_time_was_init
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/lorenz/src/extern/pygame/branches/pgreloaded/test/sdl_time_test.py", line 180, in test_pygame2_sdl_time_was_init
    self.assertFalse (sdltime.was_init ())
AssertionError: None


Index: src/base/rect.c
===================================================================
--- src/base/rect.c	(revision 2721)
+++ src/base/rect.c	(working copy)
@@ -240,11 +240,11 @@
     pgint16 x, y;
     pgint32 w, h;
 
-    if (!PyArg_ParseTuple (args, "iiii", &x, &y, &w, &h))
+    if (!PyArg_ParseTuple (args, "iill", &x, &y, &w, &h))
     {
         x = y = 0;
         PyErr_Clear ();
-        if (!PyArg_ParseTuple (args, "ii", &w, &h))
+        if (!PyArg_ParseTuple (args, "ll", &w, &h))
         {
             PyObject *pt, *rect;
             PyErr_Clear ();