test_object.py failing on `self.obj.handle == self.obj.fortran`
Issue #55
resolved
On Windows, it seems there's a problem in the Object_toFortran
code.
Sometimes I'm getting failures like this:
======================================================================
FAIL: testHandle (__main__.TestObjectViewer)
----------------------------------------------------------------------
Traceback (most recent call last):
File "test_object.py", line 95, in testHandle
self.assertEqual(h, f)
AssertionError: 1827496523648 != 2135422848
And, on inspecting further, it seems to be a problem of losing data on type conversion:
hex(1827496523648) == 0x1a97f47f780
hex(2135422848) == 0x7f47f780
It seems that Object_toFortran
is casting a 64-bits pointer to a long
, which is 32-bits on Windows (even in 64-bits compiler).
The failed assertion is on this line.
Comments (3)
-
-
- changed status to resolved
-
reporter Cool, thanks for the quick fix :)
- Log in to comment
Fixed in a2b1164 and d483b45.
PS: I never ever built petsc4py on Windows by myself. I'm quite surprised that's the only issue you catched. Many thanks!