test_object.py failing on `self.obj.handle == self.obj.fortran`

Issue #55 resolved
Edson Tadeu M. Manoel created an issue

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)

  1. Log in to comment