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

pmichaud at svn.parrot.org pmichaud at svn.parrot.org
Tue Sep 21 17:57:04 UTC 2010


Author: pmichaud
Date: Tue Sep 21 17:57:04 2010
New Revision: 49205
URL: https://trac.parrot.org/parrot/changeset/49205

Log:
[core]:  Add test for init_int initialization of ExceptionHandler PMC.

Modified:
   trunk/t/pmc/exceptionhandler.t

Modified: trunk/t/pmc/exceptionhandler.t
==============================================================================
--- trunk/t/pmc/exceptionhandler.t	Tue Sep 21 17:56:59 2010	(r49204)
+++ trunk/t/pmc/exceptionhandler.t	Tue Sep 21 17:57:04 2010	(r49205)
@@ -23,7 +23,7 @@
     .include 'test_more.pir'
 
     # If test exited with "bad plan" MyHandlerCan.can_handle wasn't invoked.
-    plan(18)
+    plan(19)
 
     test_bool()
     test_int()
@@ -105,7 +105,7 @@
 
     test_handle_types_except()
 
-    goto subclass_handler
+    goto init_int
 
   typed_handler_one:
     .get_results (e)
@@ -120,6 +120,21 @@
     eh = 0
     c()
 
+  init_int:
+    eh = new ['ExceptionHandler'], .CONTROL_BREAK
+    set_addr eh, init_int_eh
+    push_eh eh
+    $P0 = new ['Exception']
+    $P0['type'] = .CONTROL_BREAK
+    throw $P0
+    $I0 = 0
+    goto init_int_done
+  init_int_eh:
+    pop_eh
+    $I0 = 1
+  init_int_done:
+    ok($I0, "init_int handler correctly caught exception")
+
   subclass_handler:
     .local pmc myhandler, myhandlercan
     myhandler = subclass_exception_handler()


More information about the parrot-commits mailing list