Amaury Forgeot d'Arc committed 9ba5088

Fix the test: it's normal for moving gc's to allocate an additional nonmoving buffer,
and keep it alive along with the c_char_p object.

Comments (0)

Files changed (1)


         self.assertEqual(refcnt, grc(i))
         self.assertEqual(ci._objects, None)
-    @xfail
     def test_c_char_p(self):
         s = "Hello, World"
         refcnt = grc(s)
         cs = c_char_p(s)
         self.assertEqual(refcnt + 1, grc(s))
-        self.assertSame(cs._objects, s)
+        try:
+            # Moving gcs need to allocate a nonmoving buffer
+            cs._objects._obj
+        except AttributeError:
+            self.assertSame(cs._objects, s)
+        else:
+            self.assertSame(cs._objects._obj, s)
     def test_simple_struct(self):
         class X(Structure):