[svn:parrot] r47692 - trunk/t/pmc

NotFound at svn.parrot.org NotFound at svn.parrot.org
Sat Jun 19 00:18:49 UTC 2010


Author: NotFound
Date: Sat Jun 19 00:18:49 2010
New Revision: 47692
URL: https://trac.parrot.org/parrot/changeset/47692

Log:
more shift out of bounds tests

Modified:
   trunk/t/pmc/arrayiterator.t

Modified: trunk/t/pmc/arrayiterator.t
==============================================================================
--- trunk/t/pmc/arrayiterator.t	Fri Jun 18 18:31:12 2010	(r47691)
+++ trunk/t/pmc/arrayiterator.t	Sat Jun 19 00:18:49 2010	(r47692)
@@ -19,6 +19,7 @@
 .namespace []
 
 .include 'iterator.pasm'
+.include 'except_types.pasm'
 
 .sub main :main
     .include 'test_more.pir'
@@ -55,13 +56,38 @@
     nok(it, "Iterator is finished after second shift")
     is($P0, 42, "2nd element has correct value")
 
-    $I0 = 1
-    push_eh fail
+    .local int result
+    .local pmc ehandler
+    result = 0
+    ehandler = new ['ExceptionHandler']
+    ehandler.'handle_types'(.EXCEPTION_OUT_OF_BOUNDS)
+    push_eh ehandler
+
+    set_addr ehandler, handlep
     $P0 = shift it
-    $I0 = 0
+    goto fail
+handlep:
+    finalize ehandler
+    set_addr ehandler, handlei
+    $I0 = shift it
+    goto fail
+handlei:
+    finalize ehandler
+    set_addr ehandler, handlen
+    $N0 = shift it
+    goto fail
+handlen:
+    finalize ehandler
+    set_addr ehandler, handles
+    $S0 = shift it
+    goto fail
+handles:
+    finalize ehandler
+
+    result = 1
   fail:
     pop_eh
-    ok($I0, "Shifting from finished iterator throws exception")
+    ok(result, "Shifting from finished iterator throws out of bounds exception")
 
 .end
 


More information about the parrot-commits mailing list