CTYPE 0.9.2 porting problems

  • Thread starter Armin Steinhoff
  • Start date
A

Armin Steinhoff

Hi all,

I ported ctypes 0.9.2 to QNX6.3 ... 99.9 % is working but only the
unittest test_functions.py makes some problem. Here is the code:


p = pointer(c_int(99))
result = f(p)
self.failUnlessEqual(result.contents.value, 99) #---> works!!

# We need to keep the pointer alive, otherwise the contents change:
result = f(pointer(c_int(99)))
print result.contents.value
self.failIfEqual(result.contents.value, 99)

Error message:
# python test_functions.py
...........99
F.....
======================================================================
FAIL: test_pointers (__main__.FunctionTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "test_functions.py", line 194, in test_pointers
self.failIfEqual(result.contents.value, 99)
File "/usr/local/lib/python2.3/unittest.py", line 310, in failIfEqual
raise self.failureException, \
AssertionError: 99 == 99

What's the problem here? 99 isn't equal 99 :)

----------------------------------------------------------------------
Ran 16 tests in 0.053s

FAILED (failures=1)
#



# XXX But this not! WHY on earth? ====>> BUT this IS working!!
arg = byref(v)
result = f(arg)
self.failIfEqual(result.contents, v.value)


I see always a crash of Python if the library call time() is used ...
but it happens only with this call.

What could be in general the reasons??

Regards

Armin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top