@@ -56,14 +56,14 @@ def test_rlist_set(self):
5656 def test_rlist_slice (self ):
5757 l = self .sample_list ()
5858 LIST = typeOf (l ).TO
59- self .check_list (ll_listslice_startonly (LIST , l , 0 ), [42 , 43 , 44 , 45 ])
60- self .check_list (ll_listslice_startonly (LIST , l , 1 ), [43 , 44 , 45 ])
61- self .check_list (ll_listslice_startonly (LIST , l , 2 ), [44 , 45 ])
62- self .check_list (ll_listslice_startonly (LIST , l , 3 ), [45 ])
63- self .check_list (ll_listslice_startonly (LIST , l , 4 ), [])
59+ self .check_list (ll_listslice_startonly_unsafe (LIST , l , 0 ), [42 , 43 , 44 , 45 ])
60+ self .check_list (ll_listslice_startonly_unsafe (LIST , l , 1 ), [43 , 44 , 45 ])
61+ self .check_list (ll_listslice_startonly_unsafe (LIST , l , 2 ), [44 , 45 ])
62+ self .check_list (ll_listslice_startonly_unsafe (LIST , l , 3 ), [45 ])
63+ self .check_list (ll_listslice_startonly_unsafe (LIST , l , 4 ), [])
6464 for start in range (5 ):
6565 for stop in range (start , 8 ):
66- self .check_list (ll_listslice_startstop (LIST , l , start , stop ),
66+ self .check_list (ll_listslice_startstop_unsafe (LIST , l , start , stop ),
6767 [42 , 43 , 44 , 45 ][start :stop ])
6868
6969 def test_rlist_setslice (self ):
@@ -77,7 +77,7 @@ def test_rlist_setslice(self):
7777 expected [i ] = n
7878 ll_setitem_unsafe (l2 , i , n )
7979 n += 1
80- l2 = ll_listslice_startstop (typeOf (l2 ).TO , l2 , start , stop )
80+ l2 = ll_listslice_startstop_unsafe (typeOf (l2 ).TO , l2 , start , stop )
8181 ll_listsetslice (l1 , start , stop , l2 )
8282 self .check_list (l1 , expected )
8383
@@ -99,7 +99,7 @@ def sample_list(self): # [42, 43, 44, 45]
9999 ll_setitem_unsafe (l , 0 , 42 )
100100 ll_setitem_unsafe (l , - 2 , 43 )
101101 ll_setitem_nonneg_unsafe (l , 2 , 44 )
102- ll_append (l , 45 )
102+ ll_append_unsafe (l , 45 )
103103 return l
104104
105105 def test_rlist_del (self ):
@@ -124,14 +124,14 @@ def test_rlist_extend_concat(self):
124124
125125 def test_rlist_delslice (self ):
126126 l = self .sample_list ()
127- ll_listdelslice_startonly (l , 3 )
127+ ll_listdelslice_startonly_unsafe (l , 3 )
128128 self .check_list (l , [42 , 43 , 44 ])
129- ll_listdelslice_startonly (l , 0 )
129+ ll_listdelslice_startonly_unsafe (l , 0 )
130130 self .check_list (l , [])
131131 for start in range (5 ):
132132 for stop in range (start , 8 ):
133133 l = self .sample_list ()
134- ll_listdelslice_startstop (l , start , stop )
134+ ll_listdelslice_startstop_unsafe (l , start , stop )
135135 expected = [42 , 43 , 44 , 45 ]
136136 del expected [start :stop ]
137137 self .check_list (l , expected )
@@ -1613,17 +1613,16 @@ def dummyfn():
16131613 total += ord (c )
16141614 return total
16151615 #
1616- prev = rlist .ll_getitem_foldable_nonneg
1616+ prev = rlist .ll_getitem_foldable_nonneg_unsafe
16171617 try :
16181618 def seen_ok (l , index ):
16191619 if index == 5 :
16201620 raise KeyError # expected case
16211621 return prev (l , index )
1622- rlist .ll_getitem_foldable_nonneg = seen_ok
1623- e = py .test .raises (LLException , self .interpret , dummyfn , [])
1624- assert 'KeyError' in str (e .value )
1622+ rlist .ll_getitem_foldable_nonneg_unsafe = seen_ok
1623+ self .interpret (dummyfn , [])
16251624 finally :
1626- rlist .ll_getitem_foldable_nonneg = prev
1625+ rlist .ll_getitem_foldable_nonneg_unsafe = prev
16271626
16281627 def test_iterate_over_immutable_list_quasiimmut_attr (self ):
16291628 from rpython .rtyper import rlist
@@ -1639,17 +1638,16 @@ def dummyfn():
16391638 total += ord (c )
16401639 return total
16411640 #
1642- prev = rlist .ll_getitem_foldable_nonneg
1641+ prev = rlist .ll_getitem_foldable_nonneg_unsafe
16431642 try :
16441643 def seen_ok (l , index ):
16451644 if index == 5 :
16461645 raise KeyError # expected case
16471646 return prev (l , index )
1648- rlist .ll_getitem_foldable_nonneg = seen_ok
1649- e = py .test .raises (LLException , self .interpret , dummyfn , [])
1650- assert 'KeyError' in str (e .value )
1647+ rlist .ll_getitem_foldable_nonneg_unsafe = seen_ok
1648+ self .interpret (dummyfn , [])
16511649 finally :
1652- rlist .ll_getitem_foldable_nonneg = prev
1650+ rlist .ll_getitem_foldable_nonneg_unsafe = prev
16531651
16541652 def test_iterate_over_mutable_list (self ):
16551653 from rpython .rtyper import rlist
@@ -1663,17 +1661,17 @@ def dummyfn():
16631661 lst [0 ] = 'x'
16641662 return total
16651663 #
1666- prev = rlist .ll_getitem_foldable_nonneg
1664+ prev = rlist .ll_getitem_foldable_nonneg_unsafe
16671665 try :
16681666 def seen_ok (l , index ):
16691667 if index == 5 :
16701668 raise KeyError # expected case
16711669 return prev (l , index )
1672- rlist .ll_getitem_foldable_nonneg = seen_ok
1670+ rlist .ll_getitem_foldable_nonneg_unsafe = seen_ok
16731671 res = self .interpret (dummyfn , [])
16741672 assert res == sum (map (ord , 'abcdef' ))
16751673 finally :
1676- rlist .ll_getitem_foldable_nonneg = prev
1674+ rlist .ll_getitem_foldable_nonneg_unsafe = prev
16771675
16781676 def test_extend_was_not_overallocating (self ):
16791677 from rpython .rlib import rgc
0 commit comments