[pygobject] [gi] set length when marshalling guint8 erases



commit 09f7ca7e2378e6679002677ac3f4802f4cc7d9d5
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Wed Jan 19 12:04:15 2011 +0100

    [gi] set length when marshalling guint8 erases

 gi/pygi-argument.c |    1 +
 tests/test_gi.py   |    4 ++++
 2 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/gi/pygi-argument.c b/gi/pygi-argument.c
index f33074e..2ba63f6 100644
--- a/gi/pygi-argument.c
+++ b/gi/pygi-argument.c
@@ -925,6 +925,7 @@ _pygi_argument_from_object (PyObject   *object,
                 PYGLIB_PyBytes_Check(object)) {
 
                 memcpy(array->data, PYGLIB_PyBytes_AsString(object), length);
+                array->len = length;
                 goto array_success;
             }
 
diff --git a/tests/test_gi.py b/tests/test_gi.py
index a218ec0..531da51 100644
--- a/tests/test_gi.py
+++ b/tests/test_gi.py
@@ -671,6 +671,10 @@ class TestArray(unittest.TestCase):
     def test_array_in(self):
         GIMarshallingTests.array_in(Sequence([-1, 0, 1, 2]))
 
+    def test_array_uint8_in(self):
+        GIMarshallingTests.array_uint8_in(Sequence([97, 98, 99, 100]))
+        GIMarshallingTests.array_uint8_in("abcd")
+
     def test_array_out(self):
         self.assertEquals([-1, 0, 1, 2], GIMarshallingTests.array_out())
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]