コード例 #1
0
ファイル: test_heapcache.py プロジェクト: Qointum/pypy
    def test_known_nullity(self):
        h = HeapCache()
        assert not h.is_nullity_known(1)
        assert not h.is_nullity_known(2)
        h.nullity_now_known(1)
        assert h.is_nullity_known(1)
        assert not h.is_nullity_known(2)

        h.reset()
        assert not h.is_nullity_known(1)
        assert not h.is_nullity_known(2)
コード例 #2
0
    def test_known_nullity_more_cases(self):
        h = HeapCache()
        box1 = RefFrontendOp(1)
        box2 = RefFrontendOp(2)
        h.class_now_known(box1)
        assert h.is_nullity_known(box1)

        h.new(box2)
        assert h.is_nullity_known(box2)

        h.reset()
        assert not h.is_nullity_known(box1)
        assert not h.is_nullity_known(box2)
コード例 #3
0
    def test_known_nullity(self):
        h = HeapCache()
        box1 = RefFrontendOp(1)
        box2 = RefFrontendOp(2)
        assert not h.is_nullity_known(box1)
        assert not h.is_nullity_known(box2)
        h.nullity_now_known(box1)
        assert h.is_nullity_known(box1)
        assert not h.is_nullity_known(box2)

        h.reset()
        assert not h.is_nullity_known(box1)
        assert not h.is_nullity_known(box2)
コード例 #4
0
ファイル: test_heapcache.py プロジェクト: mozillazg/pypy
    def test_known_nullity(self):
        h = HeapCache()
        box1 = RefFrontendOp(1)
        box2 = RefFrontendOp(2)
        assert not h.is_nullity_known(box1)
        assert not h.is_nullity_known(box2)
        h.nullity_now_known(box1)
        assert h.is_nullity_known(box1)
        assert not h.is_nullity_known(box2)

        h.reset()
        assert not h.is_nullity_known(box1)
        assert not h.is_nullity_known(box2)