CTYPE 0.9.2 porting problems

Discussion in 'Python' started by Armin Steinhoff, Dec 6, 2004.

  1. 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
     
    Armin Steinhoff, Dec 6, 2004
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mark Kamoski
    Replies:
    3
    Views:
    15,703
    Jay B. Harlow [MVP - Outlook]
    Aug 9, 2003
  2. Andreas Klemt
    Replies:
    1
    Views:
    452
    Steve C. Orr, MCSD
    Jul 23, 2003
  3. Child

    ctype for date?

    Child, Jan 21, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    607
    Child
    Jan 21, 2004
  4. TS
    Replies:
    6
    Views:
    5,652
    metalpower
    Sep 26, 2007
  5. Stan Sainte-Rose

    Ctype and Web Custom Control question

    Stan Sainte-Rose, Sep 7, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    350
    Stan Sainte-Rose
    Sep 7, 2004
Loading...

Share This Page