summaryrefslogtreecommitdiff
path: root/tests/test_gobject.py
diff options
context:
space:
mode:
authorMikhail Fludkov <misha@pexip.com>2015-09-01 17:54:17 +0200
committerSimon Feltman <sfeltman@src.gnome.org>2016-02-20 21:13:53 -0800
commitf27b1976ea325fcd55359888401dd08ac8fb074a (patch)
tree2ca27db777ada7415ec515b384efbb52e57c6a4f /tests/test_gobject.py
parentc8176dfabea694ce738ff4633e7522b0d1fc1c51 (diff)
downloadpygobject-f27b1976ea325fcd55359888401dd08ac8fb074a.tar.gz
pygi-value: special case for NULL GValueArray
Don't segfault when dealing with GValue of GValueArray type containing NULL. Return empty list in this case. https://bugzilla.gnome.org/show_bug.cgi?id=754359
Diffstat (limited to 'tests/test_gobject.py')
-rw-r--r--tests/test_gobject.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test_gobject.py b/tests/test_gobject.py
index 6c15e20f..87b0e4ca 100644
--- a/tests/test_gobject.py
+++ b/tests/test_gobject.py
@@ -669,5 +669,11 @@ class TestGValue(unittest.TestCase):
value = GObject.Value(GObject.TYPE_OBJECT, obj)
self.assertEqual(value.get_value(), obj)
+ def test_value_array(self):
+ value = GObject.Value(GObject.ValueArray)
+ self.assertEqual(value.g_type, GObject.type_from_name('GValueArray'))
+ value.set_value([32, 'foo_bar', 0.3])
+ self.assertEqual(value.get_value(), [32, 'foo_bar', 0.3])
+
if __name__ == '__main__':
unittest.main()