[pywin32-checkins] pywin32/com/win32com/test testPyComTest.py,1.22,1.23
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2006-02-13 01:23:57
|
Update of /cvsroot/pywin32/pywin32/com/win32com/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16297/win32com/test Modified Files: testPyComTest.py Log Message: Fix some errors when attempting to use integer values > sys.maxint - both when the VT is unknown, and when the VT is explicitly VT_UI4. Also catch int conversion errors in the universal gateway. Index: testPyComTest.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/testPyComTest.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** testPyComTest.py 27 Jun 2005 11:02:42 -0000 1.22 --- testPyComTest.py 13 Feb 2006 01:23:48 -0000 1.23 *************** *** 113,116 **** --- 113,126 ---- if o.LongProp != 3 or o.IntProp != 3: raise error, "Property value wrong - got %d/%d" % (o.LongProp,o.IntProp) + o.LongProp = o.IntProp = -3 + if o.LongProp != -3 or o.IntProp != -3: + raise error, "Property value wrong - got %d/%d" % (o.LongProp,o.IntProp) + # This number fits in an unsigned long. Attempting to set it to a normal + # long will involve overflow, which is to be expected. But we do + # expect it to work in a property explicitly a VT_UI4. + check = 3 *10 **9 + o.ULongProp = check + if o.ULongProp != check: + raise error, "Property value wrong - got %d (expected %d)" % (o.ULongProp, check) # currency. pythoncom.__future_currency__ = 1 *************** *** 229,232 **** --- 239,251 ---- raise error, "Property value wrong - got %d/%d" % (o.LongProp,o.IntProp) + o.LongProp = o.IntProp = -3 + if o.LongProp != -3 or o.IntProp != -3: + raise error, "Property value wrong - got %d/%d" % (o.LongProp,o.IntProp) + + check = 3 *10 **9 + o.ULongProp = check + if o.ULongProp != check: + raise error, "Property value wrong - got %d (expected %d)" % (o.ULongProp, check) + # currency. pythoncom.__future_currency__ = 1 |