[pygobject/gsoc2009: 61/160] Add support for empty arrays as input/output arguments
- From: Simon van der Linden <svdlinden src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [pygobject/gsoc2009: 61/160] Add support for empty arrays as input/output arguments
- Date: Fri, 14 Aug 2009 21:27:13 +0000 (UTC)
commit b662487a8d39b8dfc4fdf3db06cd1e3ab4f12c95
Author: Simon van der Linden <svdlinden src gnome org>
Date: Thu Jul 23 13:06:53 2009 +0200
Add support for empty arrays as input/output arguments
gi/pygiinfo.c | 1 -
tests/test_girepository.py | 2 ++
2 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/gi/pygiinfo.c b/gi/pygiinfo.c
index 1088489..3893414 100644
--- a/gi/pygiinfo.c
+++ b/gi/pygiinfo.c
@@ -828,7 +828,6 @@ _wrap_g_function_info_invoke(PyGIBaseInfo *self, PyObject *args)
/* Get rid of the GArray. */
in_value.v_pointer = g_array_free(array, FALSE);
- g_assert(in_value.v_pointer != NULL);
}
if (direction == GI_DIRECTION_IN) {
diff --git a/tests/test_girepository.py b/tests/test_girepository.py
index 75b7066..137359f 100644
--- a/tests/test_girepository.py
+++ b/tests/test_girepository.py
@@ -299,12 +299,14 @@ class TestGIEverything(unittest.TestCase):
def testArrayIntIn(self):
self.assertEquals(5, Everything.test_array_int_in((1, 2, 3, -1)))
+ self.assertEquals(0, Everything.test_array_int_in(()))
self.assertRaises(TypeError, Everything.test_array_int_in, 0)
self.assertRaises(TypeError, Everything.test_array_int_in, (2, 'a'))
def testArrayIntInout(self):
self.assertEquals((2, 3, 4, 5), Everything.test_array_int_inout((0, 1, 2, 3, 4)))
+ self.assertEquals((), Everything.test_array_int_inout(()))
def testArrayIntOut(self):
self.assertEquals((0, 1, 2, 3, 4), Everything.test_array_int_out())
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]