1. Preston Timmons
  2. pypy

Commits

Maciej Fijalkowski  committed 1046cc3

add tests for C backend

  • Participants
  • Parent commits 1011b0c
  • Branches dynamic-specialized-tuple

Comments (0)

Files changed (3)

File pypy/rlib/test/test_rerased_raw.py

View file
         storage = rerased_raw.UntypedStorage("ooi")
         assert storage.getshape() == "ooi"
 
-class TestUntypedStorageLLType(LLRtypeMixin, BaseRtypingTest):
+class BaseTestUntypedStorage(BaseRtypingTest):
     def test_int(self):
         def f(x):
             storage = rerased_raw.UntypedStorage("i")
             return storage.getshape()
 
         llres = self.interpret(f, [])
-        assert hlstr(llres) == "ooi"
+        assert self.ll_to_string(llres) == "ooi"
 
     def test_const(self):
         class A(object):
 
         res = self.interpret(f, [0])
         assert res == 21
+
+class TestUntypedStorageLLtype(LLRtypeMixin, BaseTestUntypedStorage):
+    pass

File pypy/translator/c/test/test_genc.py

View file
     else:
         assert 0, "the call was not found in the C source"
     assert 'PYPY_INHIBIT_TAIL_CALL();' in lines[i+1]
+

File pypy/translator/c/test/test_untyped_storage.py

View file
+
+from pypy.rlib.test.test_rerased_raw import BaseTestUntypedStorage
+from pypy.translator.c.test.test_genc import compile
+
+class CCompiledMixin(object):
+    def interpret(self, f, args):
+        fn = compile(f, [type(arg) for arg in args], gcpolicy='boehm')
+        return fn(*args)
+
+    def ll_to_string(self, x):
+        return x
+
+class TestUntypedStorage(CCompiledMixin, BaseTestUntypedStorage):
+    pass