Commit 9879fd41 authored by Martin Pitt's avatar Martin Pitt
Browse files

test_gi: Stop using GLib.bytes.unref_to_array()

This method isn't safe for GI, and should be (skip)ed. Use get_data() instead
which is safe and works fine.

See https://bugzilla.gnome.org/show_bug.cgi?id=688242
parent 67136184
......@@ -976,23 +976,17 @@ class TestGBytes(unittest.TestCase):
b = GLib.Bytes.new(b'\x00\x01\xFF')
self.assertEqual(3, b.get_size())
self.assertEqual(b'\x00\x01\xFF', b.get_data())
# FIXME: crashes at cleanup, double-free
#self.assertEqual(b'\x00\x01\xFF', b.unref_to_array())
def test_gbytes_create_take(self):
b = GLib.Bytes.new_take(b'\x00\x01\xFF')
self.assertEqual(3, b.get_size())
self.assertEqual(b'\x00\x01\xFF', b.get_data())
# FIXME: crashes at cleanup, double-free
#self.assertEqual(b'\x00\x01\xFF', b.unref_to_array())
def test_gbytes_full_return(self):
b = GIMarshallingTests.gbytes_full_return()
self.assertEqual(4, b.get_size())
self.assertEqual(b'\x00\x31\xFF\x33', b.get_data())
self.assertEqual(b'\x00\x31\xFF\x33', b.unref_to_array())
def test_gbytes_none_in(self):
b = GIMarshallingTests.gbytes_full_return()
GIMarshallingTests.gbytes_none_in(b)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment