[pygobject/gsoc2009: 21/160] Add tests for arrays as output argument and fixed-size arrays



commit 87e35f4f91c0eaf097ff435af823698ebfd976ef
Author: Simon van der Linden <simon vanderlinden student uclouvain be>
Date:   Wed Jun 24 17:45:13 2009 +0200

    Add tests for arrays as output argument and fixed-size arrays
    
    Add testArrayIntOut to test arrays as output argument.
    Add testArrayFixedSizeIntIn, testArrayFixedSizeIntOut, and
    testArrayFixedSizeIntReturn to test fixed-size arrays.

 tests/test_girepository.py |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/tests/test_girepository.py b/tests/test_girepository.py
index 4e08c11..c1279d4 100644
--- a/tests/test_girepository.py
+++ b/tests/test_girepository.py
@@ -268,6 +268,9 @@ class TestGIEverything(unittest.TestCase):
         self.assertRaises(TypeError, Everything.test_array_int_in, 0)
         self.assertRaises(TypeError, Everything.test_array_int_in, (2, 'a'))
 
+    def testArrayIntOut(self):
+        self.assertEquals((0, 1, 2, 3, 4), Everything.test_array_int_out())
+
     def testArrayInt8In(self):
         self.assertEquals(5, Everything.test_array_gint8_in((1, 2, 3, -1)))
         self.assertEquals(-1, Everything.test_array_gint8_in((INT8_MAX, INT8_MIN)))
@@ -332,6 +335,15 @@ class TestGIEverything(unittest.TestCase):
     def testStrvOutarg(self):
         self.assertEquals(("1", "2", "3"), Everything.test_strv_outarg())
 
+    def testArrayFixedSizeIntIn(self):
+        self.assertEquals(9, Everything.test_array_fixed_size_int_in((1, 2, 3, 4, -1)))
+
+    def testArrayFixedSizeIntOut(self):
+        self.assertEquals((0, 1, 2, 3, 4), Everything.test_array_fixed_size_int_out())
+
+    def testArrayFixedSizeIntReturn(self):
+        self.assertEquals((0, 1, 2, 3, 4), Everything.test_array_fixed_size_int_return())
+
 
 # Interface
 # GSList



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