示例#1
0
    def test_from_ctypes(self):
        """
        Test converting a ctypes type to a Numba type.
        """
        def check(cty, ty):
            got = ctypes_utils.from_ctypes(cty)
            self.assertEqual(got, ty)

        self._conversion_tests(check)

        # An unsupported type
        with self.assertRaises(TypeError) as raises:
            ctypes_utils.from_ctypes(c_wchar_p)
        self.assertIn("Unsupported ctypes type", str(raises.exception))
示例#2
0
    def test_from_ctypes(self):
        """
        Test converting a ctypes type to a Numba type.
        """
        def check(cty, ty):
            got = ctypes_utils.from_ctypes(cty)
            self.assertEqual(got, ty)

        self._conversion_tests(check)

        # An unsupported type
        with self.assertRaises(TypeError) as raises:
            ctypes_utils.from_ctypes(c_wchar_p)
        self.assertIn("Unsupported ctypes type", str(raises.exception))
示例#3
0
 def check(cty, ty):
     got = ctypes_utils.from_ctypes(cty)
     self.assertEqual(got, ty)
示例#4
0
 def check(cty, ty):
     got = ctypes_utils.from_ctypes(cty)
     self.assertEqual(got, ty)