[ctypes-commit] ctypes/comtypes/test test_variant.py,1.1.2.1,1.1.2.2
Brought to you by:
theller
From: Thomas H. <th...@us...> - 2006-02-18 20:31:02
|
Update of /cvsroot/ctypes/ctypes/comtypes/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32496 Modified Files: Tag: branch_1_0 test_variant.py Log Message: This test deomstrates the 'set values through pointer' bug. Requires "buggy" now. Index: test_variant.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/comtypes/test/Attic/test_variant.py,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** test_variant.py 16 Feb 2006 20:35:42 -0000 1.1.2.1 --- test_variant.py 18 Feb 2006 20:30:57 -0000 1.1.2.2 *************** *** 4,7 **** --- 4,8 ---- from comtypes.automation import VARIANT, DISPPARAMS from comtypes.typeinfo import LoadTypeLibEx, LoadRegTypeLib + from ctypes.test import is_resource_enabled def get_refcnt(comptr): *************** *** 48,61 **** v = VARIANT(p) self.failUnlessEqual(get_refcnt(p), 0) ! ! def test_dispparams(self): ! # DISPPARAMS is a complex structure, well worth testing. ! d = DISPPARAMS() ! d.rgvarg = (VARIANT * 3)() ! # XXX The following line fails, which is a real bug in ctypes: ! # SystemError: ...\Objects\listobject.c:105: bad argument to internal function ! # ! # Update: this bug is fixed, now I have to rememeber what I wanted to test here. ! d.rgvarg[0].value = 1 def test_pythonobjects(self): --- 49,63 ---- v = VARIANT(p) self.failUnlessEqual(get_refcnt(p), 0) ! ! if is_resource_enabled("buggy"): ! def test_dispparams(self): ! # DISPPARAMS is a complex structure, well worth testing. ! d = DISPPARAMS() ! d.rgvarg = (VARIANT * 3)() ! values = [1, 5, 7] ! for i, v in enumerate(values): ! d.rgvarg[i].value = v ! result = [d.rgvarg[i].value for i in range(3)] ! self.failUnlessEqual(result, values) def test_pythonobjects(self): |