[pypy-svn] r36594 - in pypy/dist/pypy/rpython: ootypesystem test
fijal at codespeak.net
fijal at codespeak.net
Fri Jan 12 17:46:32 CET 2007
Author: fijal
Date: Fri Jan 12 17:46:31 2007
New Revision: 36594
Added:
pypy/dist/pypy/rpython/ootypesystem/rgeneric.py
Modified:
pypy/dist/pypy/rpython/test/test_rgeneric.py
Log:
Support for ootypesystem
Added: pypy/dist/pypy/rpython/ootypesystem/rgeneric.py
==============================================================================
--- (empty file)
+++ pypy/dist/pypy/rpython/ootypesystem/rgeneric.py Fri Jan 12 17:46:31 2007
@@ -0,0 +1,9 @@
+
+from pypy.rpython.rgeneric import AbstractGenericCallableRepr
+from pypy.rpython.ootypesystem import ootype
+
+class GenericCallableRepr(AbstractGenericCallableRepr):
+ def create_low_leveltype(self):
+ l_args = [r_arg.lowleveltype for r_arg in self.args_r]
+ l_retval = self.r_result.lowleveltype
+ return ootype.StaticMethod(l_args, l_retval)
Modified: pypy/dist/pypy/rpython/test/test_rgeneric.py
==============================================================================
--- pypy/dist/pypy/rpython/test/test_rgeneric.py (original)
+++ pypy/dist/pypy/rpython/test/test_rgeneric.py Fri Jan 12 17:46:31 2007
@@ -5,8 +5,9 @@
from pypy.rpython.test.test_llinterp import interpret, interpret_raises
import py
+from pypy.rpython.test.tool import LLRtypeMixin, OORtypeMixin
-class TestRGeneric:
+class BaseRGenericTest:
def test_some_generic_function_call(self):
def h(x):
return int(x)
@@ -38,3 +39,9 @@
assert interpret(f, [1.]) == 1
assert interpret(f, [10.]) == 11
assert interpret(f, [-3.]) == 0
+
+class TestLLRgeneric(BaseRGenericTest, LLRtypeMixin):
+ pass
+
+class TestOORgeneric(BaseRGenericTest, OORtypeMixin):
+ pass
More information about the Pypy-commit
mailing list