Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > CTYPE 0.9.2 porting problems

Thread Tools

CTYPE 0.9.2 porting problems

Armin Steinhoff
Posts: n/a

Hi all,

I ported ctypes 0.9.2 to QNX6.3 ... 99.9 % is working but only the
unittest 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
================================================== ====================
FAIL: test_pointers (__main__.FunctionTestCase)
Traceback (most recent call last):
File "", line 194, in test_pointers
self.failIfEqual(result.contents.value, 99)
File "/usr/local/lib/python2.3/", 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??



Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't use getType() in 2nd param of ctype function? TS ASP .Net 6 09-26-2007 04:22 PM
Ctype and Web Custom Control question Stan Sainte-Rose ASP .Net 0 09-07-2004 09:49 AM
ctype for date? Child ASP .Net 0 01-21-2004 10:51 PM
difference between Convert.ToString(obj) and CType(obj, String) Mark Kamoski ASP .Net 3 08-08-2003 11:09 PM
Which is faster? Dim dv As New DataView(session("myDataTable")) or CType(session("myDataTable")) Andreas Klemt ASP .Net 1 07-23-2003 12:18 AM