[pypy-svn] r23725 - pypy/dist/pypy/annotation/test
nik at codespeak.net
nik at codespeak.net
Tue Feb 28 02:14:33 CET 2006
Author: nik
Date: Tue Feb 28 02:14:27 2006
New Revision: 23725
Modified:
pypy/dist/pypy/annotation/test/test_model.py
Log:
fix some tests broken by changes to ootypesystem. but test_oo_union needs
more work ...
Modified: pypy/dist/pypy/annotation/test/test_model.py
==============================================================================
--- pypy/dist/pypy/annotation/test/test_model.py (original)
+++ pypy/dist/pypy/annotation/test/test_model.py Tue Feb 28 02:14:27 2006
@@ -3,6 +3,7 @@
import py
from pypy.annotation.model import *
from pypy.annotation.listdef import ListDef, MOST_GENERAL_LISTDEF
+from pypy.rpython.ootypesystem.ootype import ROOT
listdef1 = ListDef(None, SomeTuple([SomeInteger(nonneg=True), SomeString()]))
@@ -118,7 +119,7 @@
assert isinstance(s_p, SomePtr) and s_p.ll_ptrtype == lltype.Ptr(S)
s_p = ll_to_annotation(lltype.malloc(A, 0))
assert isinstance(s_p, SomePtr) and s_p.ll_ptrtype == lltype.Ptr(A)
- C = ootype.Instance('C', None, {})
+ C = ootype.Instance('C', ROOT, {})
s_p = ll_to_annotation(ootype.new(C))
assert isinstance(s_p, SomeOOInstance) and s_p.ootype == C
@@ -143,7 +144,7 @@
s_p = SomePtr(ll_ptrtype=PS)
assert annotation_to_lltype(s_p) == PS
py.test.raises(ValueError, "annotation_to_lltype(si0)")
- C = ootype.Instance('C', None, {})
+ C = ootype.Instance('C', ROOT, {})
ref = SomeOOInstance(C)
assert annotation_to_lltype(ref) == C
@@ -173,10 +174,10 @@
py.test.raises(AssertionError, "unionof(SomeObject(), SomePtr(PS1))")
def test_oo_union():
- C1 = ootype.Instance("C1", None)
+ C1 = ootype.Instance("C1", ROOT)
C2 = ootype.Instance("C2", C1)
C3 = ootype.Instance("C3", C1)
- D = ootype.Instance("D", None)
+ D = ootype.Instance("D", ROOT)
assert unionof(SomeOOInstance(C1), SomeOOInstance(C1)) == SomeOOInstance(C1)
assert unionof(SomeOOInstance(C1), SomeOOInstance(C2)) == SomeOOInstance(C1)
assert unionof(SomeOOInstance(C2), SomeOOInstance(C1)) == SomeOOInstance(C1)
More information about the Pypy-commit
mailing list