[ctypes-commit] ctypes/unittests/com test_variant.py,1.4,1.5
Brought to you by:
theller
From: Thomas H. <th...@us...> - 2005-02-17 15:22:52
|
Update of /cvsroot/ctypes/ctypes/unittests/com In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5740 Modified Files: test_variant.py Log Message: Preliminary support for one-dimensional safearray support in VARIANT. Index: test_variant.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/unittests/com/test_variant.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** test_variant.py 14 Feb 2005 14:33:39 -0000 1.4 --- test_variant.py 17 Feb 2005 15:22:43 -0000 1.5 *************** *** 55,59 **** # XXX The following line fails, which is a real bug in ctypes: # SystemError: ...\Objects\listobject.c:105: bad argument to internal function ! ## d.rgvarg[0].value = 1 def test_pythonobjects(self): --- 55,61 ---- # 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): *************** *** 103,106 **** --- 105,127 ---- self.failUnlessEqual(v.value, "") + class ArrayTest(unittest.TestCase): + def test_double(self): + import array + for typecode in "df": + # because of FLOAT rounding errors, whi will only work for + # certain values! + a = array.array(typecode, [1.0, 2.0, 3.0, 4.5]) + v = VARIANT() + v.value = a + self.failUnlessEqual(v.value, [1.0, 2.0, 3.0, 4.5]) + + def test_int(self): + import array + for typecode in "bhiBHIlL": + a = array.array(typecode, [1, 1, 1, 1]) + v = VARIANT() + v.value = a + self.failUnlessEqual(v.value, [1, 1, 1, 1]) + ################################################################ |