]> granicus.if.org Git - python/commitdiff
Fix and enable a test that now works.
authorThomas Heller <theller@ctypes.org>
Tue, 19 Aug 2008 06:36:52 +0000 (06:36 +0000)
committerThomas Heller <theller@ctypes.org>
Tue, 19 Aug 2008 06:36:52 +0000 (06:36 +0000)
Lib/ctypes/test/test_frombuffer.py

index 692d0f03063a5c70cb61f42dc6b3a53eb1f44b8a..23e2dcbb56c0e020059a9430dac6ecaf3179387e 100644 (file)
@@ -43,7 +43,7 @@ class Test(unittest.TestCase):
         self.assertRaises(ValueError, lambda: (c_int * 16).from_buffer(a, sizeof(c_int)))
         self.assertRaises(ValueError, lambda: (c_int * 1).from_buffer(a, 16 * sizeof(c_int)))
 
-    def BROKEN_test_from_buffer_copy(self):
+    def test_from_buffer_copy(self):
         a = array.array("i", range(16))
         x = (c_int * 16).from_buffer_copy(a)
 
@@ -64,8 +64,8 @@ class Test(unittest.TestCase):
         del a; gc.collect(); gc.collect(); gc.collect()
         self.assertEqual(x[:], list(range(16)))
 
-        x = (c_char * 16).from_buffer_copy("a" * 16)
-        self.assertEqual(x[:], "a" * 16)
+        x = (c_char * 16).from_buffer_copy(b"a" * 16)
+        self.assertEqual(x[:], b"a" * 16)
 
     def test_fom_buffer_copy_with_offset(self):
         a = array.array("i", range(16))