]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Add missing SVN eol-style property to text files.
authorTim Peters <tim.peters@gmail.com>
Sun, 16 Apr 2006 22:11:28 +0000 (22:11 +0000)
committerTim Peters <tim.peters@gmail.com>
Sun, 16 Apr 2006 22:11:28 +0000 (22:11 +0000)
Lib/ctypes/test/test_unaligned_structures.py

index ffbc2be29a824e925a8cda1b2d0ac6fa49f33548..89343ba48e8f0a1885c88f5894f3bdbafb613b6c 100644 (file)
@@ -1,45 +1,45 @@
-import sys, unittest\r
-from ctypes import *\r
-\r
-structures = []\r
-byteswapped_structures = []\r
-\r
-\r
-if sys.byteorder == "little":\r
-    SwappedStructure = BigEndianStructure\r
-else:\r
-    SwappedStructure = LittleEndianStructure\r
-\r
-for typ in [c_short, c_int, c_long, c_longlong,\r
-            c_float, c_double,\r
-            c_ushort, c_uint, c_ulong, c_ulonglong]:\r
-    class X(Structure):\r
-        _pack_ = 1\r
-        _fields_ = [("pad", c_byte),\r
-                    ("value", typ)]\r
-    class Y(SwappedStructure):\r
-        _pack_ = 1\r
-        _fields_ = [("pad", c_byte),\r
-                    ("value", typ)]\r
-    structures.append(X)\r
-    byteswapped_structures.append(Y)\r
-\r
-class TestStructures(unittest.TestCase):\r
-    def test_native(self):\r
-        for typ in structures:\r
-##            print typ.value\r
-            self.failUnlessEqual(typ.value.offset, 1)\r
-            o = typ()\r
-            o.value = 4\r
-            self.failUnlessEqual(o.value, 4)\r
-\r
-    def test_swapped(self):\r
-        for typ in byteswapped_structures:\r
-##            print >> sys.stderr, typ.value\r
-            self.failUnlessEqual(typ.value.offset, 1)\r
-            o = typ()\r
-            o.value = 4\r
-            self.failUnlessEqual(o.value, 4)\r
-\r
-if __name__ == '__main__':\r
-    unittest.main()\r
+import sys, unittest
+from ctypes import *
+
+structures = []
+byteswapped_structures = []
+
+
+if sys.byteorder == "little":
+    SwappedStructure = BigEndianStructure
+else:
+    SwappedStructure = LittleEndianStructure
+
+for typ in [c_short, c_int, c_long, c_longlong,
+            c_float, c_double,
+            c_ushort, c_uint, c_ulong, c_ulonglong]:
+    class X(Structure):
+        _pack_ = 1
+        _fields_ = [("pad", c_byte),
+                    ("value", typ)]
+    class Y(SwappedStructure):
+        _pack_ = 1
+        _fields_ = [("pad", c_byte),
+                    ("value", typ)]
+    structures.append(X)
+    byteswapped_structures.append(Y)
+
+class TestStructures(unittest.TestCase):
+    def test_native(self):
+        for typ in structures:
+##            print typ.value
+            self.failUnlessEqual(typ.value.offset, 1)
+            o = typ()
+            o.value = 4
+            self.failUnlessEqual(o.value, 4)
+
+    def test_swapped(self):
+        for typ in byteswapped_structures:
+##            print >> sys.stderr, typ.value
+            self.failUnlessEqual(typ.value.offset, 1)
+            o = typ()
+            o.value = 4
+            self.failUnlessEqual(o.value, 4)
+
+if __name__ == '__main__':
+    unittest.main()