[Python-checkins] r58389 - in python/ctypes-branch: Lib/ctypes/test/test_callbacks.py Modules/_ctypes/cfield.c
thomas.heller
python-checkins at python.org
Tue Oct 9 14:16:26 CEST 2007
Author: thomas.heller
Date: Tue Oct 9 14:16:26 2007
New Revision: 58389
Modified:
python/ctypes-branch/Lib/ctypes/test/test_callbacks.py
python/ctypes-branch/Modules/_ctypes/cfield.c
Log:
Add some debug prints.
Modified: python/ctypes-branch/Lib/ctypes/test/test_callbacks.py
==============================================================================
--- python/ctypes-branch/Lib/ctypes/test/test_callbacks.py (original)
+++ python/ctypes-branch/Lib/ctypes/test/test_callbacks.py Tue Oct 9 14:16:26 2007
@@ -1,4 +1,5 @@
import unittest
+import sys
from ctypes import *
import _ctypes_test
@@ -78,8 +79,14 @@
self.check_type(c_double, -3.14)
def test_longdouble(self):
+ print >> sys.stderr, "First Test Start"
self.check_type(c_longdouble, 3.14)
- self.check_type(c_longdouble, -3.14)
+ print >> sys.stderr, "First Test Done"
+ print >> sys.stderr
+
+ print >> sys.stderr, "Second Test Start"
+ self.check_type(c_longdouble, 2.78)
+ print >> sys.stderr, "Second Test Done"
def test_char(self):
self.check_type(c_char, "x")
Modified: python/ctypes-branch/Modules/_ctypes/cfield.c
==============================================================================
--- python/ctypes-branch/Modules/_ctypes/cfield.c (original)
+++ python/ctypes-branch/Modules/_ctypes/cfield.c Tue Oct 9 14:16:26 2007
@@ -1001,6 +1001,7 @@
value->ob_type->tp_name);
return NULL;
}
+ fprintf(stderr, "D_set(%p, %f)\n", ptr, (float)x);
memcpy(ptr, &x, sizeof(long double));
_RET(value);
}
@@ -1010,6 +1011,7 @@
{
long double val;
memcpy(&val, ptr, sizeof(long double));
+ fprintf(stderr, "D_get(%p) -> %f\n", ptr, (float)val);
return PyFloat_FromDouble(val);
}
More information about the Python-checkins
mailing list