示例#1
0
    def test_loadFunctionList(self):
        with filterWarnings("error", DeprecationWarning):
            self.assertRaises(DeprecationWarning, objc._loadFunctionList, [])

        orig = objc.loadFunctionList
        try:
            l = []
            objc.loadFunctionList = lambda *args, **kwds: l.append((args, kwds))

            objc._loadFunctionList(1, 2, a=3, b=3)
            self.assertEqual(l, [((1,2), {'a':3, 'b':3})])

        finally:
            objc.loadFunctionList = orig
示例#2
0
    ("swapX_andY_", 'v^d^d', '',
            dict(arguments={
                    0: dict(type_modifier=objc._C_INOUT, null_accepted=False),
                    1: dict(type_modifier=objc._C_INOUT, null_accepted=False),
                })),

    ("input_output_inputAndOutput_", '@^i^i^i', '',
            dict(arguments={
                    0: dict(type_modifier=objc._C_IN, null_accepted=True),
                    1: dict(type_modifier=objc._C_OUT, null_accepted=True),
                    2: dict(type_modifier=objc._C_INOUT, null_accepted=True),
            })),
]

objc._loadFunctionList(function_list, globals(),  _FunctionTable, False)

class TestExists (TestCase):
    def testFunctionsExists(self):
        for item in _FunctionTable:
            self.assert_( item[0] in globals() )

class TestArrayDefault (TestCase):
    # TODO: what is the default anyway?
    pass

class TestArraysOut (TestCase):
    def testFixedSize(self):
        v = fill4Tuple_(None)
        self.assertEquals(list(v), [0, -1, -8, -27])
示例#3
0
    ("swapX_andY_", 'v^d^d', '',
     dict(
         arguments={
             0: dict(type_modifier=objc._C_INOUT, null_accepted=False),
             1: dict(type_modifier=objc._C_INOUT, null_accepted=False),
         })),
    ("input_output_inputAndOutput_", '@^i^i^i', '',
     dict(
         arguments={
             0: dict(type_modifier=objc._C_IN, null_accepted=True),
             1: dict(type_modifier=objc._C_OUT, null_accepted=True),
             2: dict(type_modifier=objc._C_INOUT, null_accepted=True),
         })),
]

objc._loadFunctionList(function_list, globals(), _FunctionTable, False)


class TestExists(TestCase):
    def testFunctionsExists(self):
        for item in _FunctionTable:
            self.assert_(item[0] in globals())


class TestArrayDefault(TestCase):
    # TODO: what is the default anyway?
    pass


class TestArraysOut(TestCase):
    def testFixedSize(self):