Exemplo n.º 1
0
 def test_unicode_fname(self):
     fname = u'foಠ'
     argtypes = types.int32, types.float32
     name = default_mangler(fname, argtypes)
     self.assertIsInstance(name, str)
     expect = 'fo\\u{0:04x}.int32.float32'.format(ord(u'ಠ'))
     self.assertEqual(name, expect)
Exemplo n.º 2
0
 def test_unicode_fname(self):
     fname = u'foಠ'
     argtypes = types.int32, types.float32
     name = default_mangler(fname, argtypes)
     self.assertIsInstance(name, str)
     # manually encode it
     unichar = fname[2]
     enc = ''.join('${:02x}'.format(utils.asbyteint(c))
                   for c in unichar.encode('utf8'))
     text = 'fo' + enc
     expect = '_Z{}{}if'.format(len(text), text)
     self.assertEqual(name, expect)
     # ensure result chars are in the right charset
     self.assertRegexpMatches(name, r'^_Z[a-zA-Z0-9_\$]+$')
Exemplo n.º 3
0
 def test_unicode_fname(self):
     fname = u'foಠ'
     argtypes = types.int32, types.float32
     name = default_mangler(fname, argtypes)
     self.assertIsInstance(name, str)
     # manually encode it
     unichar = fname[2]
     enc = ''.join('${:02x}'.format(utils.asbyteint(c))
                   for c in unichar.encode('utf8'))
     text = 'fo' + enc
     expect = '_Z{}{}if'.format(len(text), text)
     self.assertEqual(name, expect)
     # ensure result chars are in the right charset
     self.assertRegexpMatches(name, r'^_Z[a-zA-Z0-9_\$]+$')
Exemplo n.º 4
0
 def mangler(self, name, types):
     """
     Perform name mangling.
     """
     return funcdesc.default_mangler(name, types)
Exemplo n.º 5
0
Arquivo: base.py Projeto: yuguen/numba
 def mangler(self, name, types):
     """
     Perform name mangling.
     """
     return funcdesc.default_mangler(name, types)
Exemplo n.º 6
0
 def test_two_args(self):
     fname = 'foo'
     argtypes = types.int32, types.float32
     name = default_mangler(fname, argtypes)
     self.assertEqual(name, '_Z3fooif')
Exemplo n.º 7
0
 def test_one_args(self):
     fname = 'foo'
     argtypes = types.int32,
     name = default_mangler(fname, argtypes)
     self.assertEqual(name, '_Z3fooi')
Exemplo n.º 8
0
 def test_two_args(self):
     fname = 'foo'
     argtypes = types.int32, types.float32
     name = default_mangler(fname, argtypes)
     self.assertEqual(name, 'foo.int32.float32')
Exemplo n.º 9
0
 def test_one_args(self):
     fname = 'foo'
     argtypes = types.int32,
     name = default_mangler(fname, argtypes)
     self.assertEqual(name, 'foo.int32')