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

NotFound at svn.parrot.org NotFound at svn.parrot.org
Wed Jul 28 16:11:39 UTC 2010


Author: NotFound
Date: Wed Jul 28 16:11:38 2010
New Revision: 48202
URL: https://trac.parrot.org/parrot/changeset/48202

Log:
test ExceptionHandler get severity values

Modified:
   trunk/t/pmc/exceptionhandler.t

Modified: trunk/t/pmc/exceptionhandler.t
==============================================================================
--- trunk/t/pmc/exceptionhandler.t	Wed Jul 28 14:59:46 2010	(r48201)
+++ trunk/t/pmc/exceptionhandler.t	Wed Jul 28 16:11:38 2010	(r48202)
@@ -1,5 +1,5 @@
 #!./parrot
-# Copyright (C) 2006-2008, Parrot Foundation.
+# Copyright (C) 2006-2010, Parrot Foundation.
 # $Id$
 
 =head1 NAME
@@ -23,9 +23,9 @@
     .include 'test_more.pir'
 
     # If test exited with "bad plan" MyHandlerCan.can_handle wasn't invoked.
-    plan(11)
+    plan(15)
 
-    .local pmc eh
+    .local pmc eh, eh2
     eh = new ['ExceptionHandler']
     ok(1, 'Instantiated ExceptionHandler')
 
@@ -34,11 +34,21 @@
     eh.'max_severity'(.EXCEPT_WARNING)
     push_eh eh
 
-    eh = new ['ExceptionHandler']
-    set_addr eh, error_handler_one
-    eh.'min_severity'(.EXCEPT_ERROR)
-    eh.'max_severity'(.EXCEPT_FATAL)
-    push_eh eh
+    eh2 = new ['ExceptionHandler']
+    set_addr eh2, error_handler_one
+    eh2.'min_severity'(.EXCEPT_ERROR)
+    eh2.'max_severity'(.EXCEPT_FATAL)
+    push_eh eh2
+
+    .local int i
+    i = eh.'min_severity'()
+    is(i, .EXCEPT_NORMAL, 'get min_severity - 1')
+    i = eh.'max_severity'()
+    is(i, .EXCEPT_WARNING, 'get max_severity - 1')
+    i = eh2.'min_severity'()
+    is(i, .EXCEPT_ERROR, 'get min_severity - 2')
+    i = eh2.'max_severity'()
+    is(i, .EXCEPT_FATAL, 'get max_severity - 2')
 
     $P0 = new ['Exception']
     $P0['severity'] = .EXCEPT_NORMAL


More information about the parrot-commits mailing list