Commit Graph

44 Commits

Author SHA1 Message Date
Thomas Heller c314ac5492 Next try to fix the OpenBSD buildbot tests:
Use ctypes.util.find_library to locate the C runtime library
on platforms where is returns useful results.
2006-06-19 08:32:46 +00:00
Thomas Heller 0b465702e6 Try to repair the failing test on the OpenBSD buildbot. Trial and error... 2006-06-19 07:07:49 +00:00
Thomas Heller 4180e12d26 Add an __all__ list, since this module does 'from ctypes import *'. 2006-06-14 09:20:11 +00:00
Thomas Heller 866a5d89b2 Fix docstring. 2006-06-14 06:18:15 +00:00
Thomas Heller fdbebb65af Add back WCHAR, UINT, DOUBLE, _LARGE_INTEGER, _ULARGE_INTEGER.
VARIANT_BOOL is a special _ctypes data type, not c_short.
2006-06-13 09:40:14 +00:00
Thomas Heller a7e823fd2c Add some windows datatypes that were missing from this file, and add
the aliases defined in windows header files for the structures.
2006-06-13 08:56:14 +00:00
Thomas Heller c2da994585 Add pep-291 compatibility markers. 2006-06-12 20:56:48 +00:00
Tim Peters 4f96f1f2b5 Whitespace normalization. 2006-06-11 19:42:51 +00:00
Neal Norwitz 6aaccc6b55 Fix errors found by pychecker 2006-06-11 08:35:14 +00:00
Thomas Heller 5114826950 Upgrade to ctypes version 0.9.9.7.
Summary of changes:

- support for 'variable sized' data
- support for anonymous structure/union fields
- fix severe bug with certain arrays or structures containing more than 256 fields
2006-06-10 19:55:36 +00:00
Thomas Heller 56dab85022 Specify argtypes for all test functions. Maybe that helps on strange ;-) architectures 2006-06-06 15:34:18 +00:00
Martin Blais 215f13dd11 Normalized a few cases of whitespace in function declarations.
Found them using::

  find . -name '*.py' | while read i ; do grep 'def[^(]*( ' $i /dev/null ; done
  find . -name '*.py' | while read i ; do grep ' ):' $i /dev/null ; done

(I was doing this all over my own code anyway, because I'd been using spaces in
all defs, so I thought I'd make a run on the Python code as well.  If you need
to do such fixes in your own code, you can use xx-rename or parenregu.el within
emacs.)
2006-06-06 12:46:55 +00:00
Thomas Heller ecc3e67b98 Convert CFieldObject tp_members to tp_getset, since there is no
structmember typecode for Py_ssize_t fields.  This should fix some of
the errors on the PPC64 debian machine (64-bit, big endian).

Assigning to readonly fields now raises AttributeError instead of
TypeError, so the testcase has to be changed as well.
2006-06-06 11:34:33 +00:00
Richard Jones 7b9558d37d Conversion of exceptions over from faked-up classes to new-style C types. 2006-05-27 12:29:24 +00:00
Thomas Heller 0e10cb0266 add svn:eol-style native svn:keywords Id 2006-05-12 19:31:46 +00:00
Thomas Heller e43a0fcc9d Add missing svn properties. 2006-05-12 18:16:03 +00:00
Thomas Heller 40f55b2f08 Disable a test that is unreliable. 2006-05-09 20:20:15 +00:00
Thomas Heller 97a7b7fef3 oops - the function is exported as 'my_free', not 'free'. 2006-05-05 18:46:27 +00:00
Thomas Heller 748f6fbf2c Fix memory leaks in the ctypes test suite, reported by valgrind, by
free()ing the memory we allocate.
2006-05-05 18:43:24 +00:00
Thomas Heller 14f3da7585 Don't fail the tests when libglut.so or libgle.so cannot be loaded. 2006-05-03 18:35:39 +00:00
Thomas Heller 6a907d8b8e Remove a duplicated test (the same test is in test_incomplete.py). 2006-04-28 17:02:18 +00:00
Thomas Heller 6ff67ef096 Merge in changes from ctypes 0.9.9.6 upstream version. 2006-04-21 16:51:04 +00:00
Tim Peters c5c9ce957d Add missing SVN eol-style property to text files. 2006-04-16 22:11:28 +00:00
Thomas Heller 55d031ef23 Fix for a bug found by Armin Rigo, plus test.
https://sourceforge.net/tracker/?func=detail&atid=532154&aid=1467852&group_id=71702
2006-04-12 19:07:36 +00:00
Tim Peters 319c47fcdb Try to repair what may be the last new test failure on the
"x86 OpenBSD trunk" buildbot due to changing Python so that
Python-exposed addresses are always non-negative.

test_int_pointer_arg():  This line failed now whenever the
box happened to assign an address to `ci` "with the sign
bit set":

    self.failUnlessEqual(addressof(ci), func(byref(ci)))

The problem is that the ctypes addressof() inherited "all
addresses are non-negative now" from changes to
PyLong_FromVoidPtr(), but byref() did not inherit that
change and can still return a negative int.

I don't know whether, or what, the ctypes implementation wants
to do about that (possibly nothing), but in the meantime
the test fails frequently.

So, introduced a Python positive_address() function in
the test module, that takes a purported machine address and,
if negative, converts it to a non-negative value "with the
same bits".  This should leave the test passing under all
versions of Python.

Belated thanks to Armin Rigo for teaching me the sick trick ;-)
for determining the # of bits in a machine pointer via abuse
of the struct module.
2006-04-11 02:59:48 +00:00
Thomas Heller fff61ea025 Expose RTLD_LOCAL and RTLD_GLOBAL always from the _ctypes extension module.
If RTLD_LOCAL is not #defined in any header file (Windows), set it to 0.
If RTLD_GLOBAL is not #defined, set it equal to RTLD_LOCAL.

This should fix ctypes on cygwin.
2006-04-06 15:23:16 +00:00
Thomas Heller fb8f83b33f One test still fails on the ia64 debian box. 2006-04-05 19:01:35 +00:00
Thomas Heller 726dcf34a6 Use 'ldd' to find the libc library to load. Based on an idea from Matthias Klose. 2006-04-05 17:36:45 +00:00
Neal Norwitz b0b20a10bc Get ctypes loader working on OSF1 (Tru64) 2006-04-03 06:52:43 +00:00
Thomas Heller 0d93a23479 Try to fix test_loading on openbsd. 2006-03-30 19:16:15 +00:00
Thomas Heller 300269ae6f Oops - this should not have gone in. 2006-03-30 18:29:25 +00:00
Thomas Heller b320682577 Output more info when the test fails. 2006-03-30 17:49:55 +00:00
Thomas Heller 240ec6b9ef Make the tests succeed with -Qnew: Do not rely on the exact wording of a ZeroDivisionError. 2006-03-28 11:00:08 +00:00
Thomas Heller cce2267cf1 Plug a leak in the ctypes test suite when tests are run repeatedly. 2006-03-20 08:11:56 +00:00
Thomas Heller d59ca8f335 Accessing unaligned structure fields works now on all architectures.
Including unittest.
2006-03-20 07:54:01 +00:00
Thomas Heller b03cb602e8 Merge changes from the upstream version:
- cast is implemented as a foreign function now
- On Windows, it is now possible to access functions exported by ordinal only
2006-03-17 15:52:58 +00:00
Thomas Heller 23e408603c Fix a test that fails when libGL.so and libGLU.so are not installed (on posix systems). 2006-03-16 20:09:22 +00:00
Thomas Heller a022789ab3 Plug some refcount leaks when tests are run repeatedly. 2006-03-13 10:47:02 +00:00
Thomas Heller 6058aa40d2 Remove the slightly broken test_leaks.py.
Change test_functions.py so that it can be run multiple time without
failing: Assign a restype to the function in test_intresult, and move
the definition of class POINT to module level so that no new class is
created each time the test is run.
2006-03-13 07:33:38 +00:00
Thomas Heller 51f77b5152 Remove the magic to run an uninstalled ctypes version from a CVS sandbox. 2006-03-09 19:40:00 +00:00
Thomas Heller 57e881eb22 Disable the testcase that crashes solaris. 2006-03-09 09:43:53 +00:00
Tim Peters e8d09e5818 Whitespace normalization. 2006-03-09 01:15:05 +00:00
Hye-Shik Chang d758d3d747 Remove .cvsignore and set svn:ignore for *.pyc *.pyo. 2006-03-08 23:31:17 +00:00
Thomas Heller babddfca75 Copy ctypes-0.9.9.4 Python modules from external into the trunk. 2006-03-08 19:56:54 +00:00