Update of /cvsroot/ctypes/ctypes/ctypes/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15082
Modified Files:
Tag: endian_branch
test_byteswap.py
Log Message:
Check.
Index: test_byteswap.py
===================================================================
RCS file: /cvsroot/ctypes/ctypes/ctypes/test/Attic/test_byteswap.py,v
retrieving revision 1.1.2.2.2.3
retrieving revision 1.1.2.2.2.4
diff -C2 -d -r1.1.2.2.2.3 -r1.1.2.2.2.4
*** test_byteswap.py 17 Nov 2005 21:10:59 -0000 1.1.2.2.2.3
--- test_byteswap.py 18 Nov 2005 14:20:00 -0000 1.1.2.2.2.4
***************
*** 19,22 ****
--- 19,40 ----
return binascii.hexlify(buffer(s))
+ if __name__ == "__main__":
+ from ctypes import c_int, Structure
+ class Nibbles(Structure):
+ _fields_ = [("n1", c_int, 4),
+ ("n2", c_int, 4),
+ ("n3", c_int, 4),
+ ("n4", c_int, 4),
+ ("n5", c_int, 4),
+ ("n6", c_int, 4),
+ ("n7", c_int, 4),
+ ("n8", c_int, 4)]
+
+ n = Nibbles(1, 2, 3, 4, 5, 6, 7, 8)
+
+ print "sys.byteorder:", sys.byteorder
+ dump(n)
+
+ sys.exit()
class Test(unittest.TestCase):
|