Esempio n. 1
0
    def test_array(self):
        self.assertEqual(Everything.test_array_int_in([]), 0)
        self.assertEqual(Everything.test_array_int_in([1, 5, -2]), 4)
        self.assertEqual(Everything.test_array_int_out(), [0, 1, 2, 3, 4])
        self.assertEqual(Everything.test_array_int_full_out(), [0, 1, 2, 3, 4])
        self.assertEqual(Everything.test_array_int_none_out(), [1, 2, 3, 4, 5])
        self.assertEqual(Everything.test_array_int_inout([1, 5, 42, -8]), [6, 43, -7])

        if sys.version_info >= (3, 0):
            self.assertEqual(Everything.test_array_gint8_in(b'\x01\x03\x05'), 9)
        self.assertEqual(Everything.test_array_gint8_in([1, 3, 5, -50]), -41)
        self.assertEqual(Everything.test_array_gint16_in([256, 257, -1000, 10000]), 9513)
        self.assertEqual(Everything.test_array_gint32_in([30000, 1, -2]), 29999)
        self.assertEqual(Everything.test_array_gint64_in([2 ** 33, 2 ** 34]), 2 ** 33 + 2 ** 34)

        self.assertEqual(Everything.test_array_gtype_in(
            [GObject.TYPE_STRING, GObject.TYPE_UINT64, GObject.TYPE_VARIANT]),
            '[gchararray,guint64,GVariant,]')
Esempio n. 2
0
 def test_array_gint32_in(self):
     self.assertEqual(Everything.test_array_gint32_in([30000, 1, -2]),
                      29999)
Esempio n. 3
0
 def test_array_gint32_in(self):
     self.assertEqual(Everything.test_array_gint32_in([30000, 1, -2]), 29999)