[svn:parrot] r47235 - trunk/t/pmc
NotFound at svn.parrot.org
NotFound at svn.parrot.org
Mon May 31 20:25:07 UTC 2010
Author: NotFound
Date: Mon May 31 20:25:06 2010
New Revision: 47235
URL: https://trac.parrot.org/parrot/changeset/47235
Log:
tests for RBA set negative size and get with negative index out of range
Modified:
trunk/t/pmc/resizablebooleanarray.t
Modified: trunk/t/pmc/resizablebooleanarray.t
==============================================================================
--- trunk/t/pmc/resizablebooleanarray.t Mon May 31 18:25:36 2010 (r47234)
+++ trunk/t/pmc/resizablebooleanarray.t Mon May 31 20:25:06 2010 (r47235)
@@ -24,7 +24,7 @@
.include 'test_more.pir'
- plan(65)
+ plan(67)
setting_array_size()
setting_first_element()
@@ -70,6 +70,16 @@
$P0 = 7
is($P0, 7, "shrinking via int assignment to RBA works")
+
+ new $P1, ['ExceptionHandler']
+ set_addr $P1, caught
+ $P1.'handle_types'(.EXCEPTION_OUT_OF_BOUNDS)
+ push_eh $P1
+ $P0 = -1
+ ok(0, "no exception caught for setting negative size")
+ .return()
+caught:
+ ok(1, "caught exception on setting negative size")
.end
@@ -138,6 +148,17 @@
set $I0, $P0[-1]
is($I0, 0, "negative index retrieval is 0")
+
+ new $P1, ['ExceptionHandler']
+ set_addr $P1, caught
+ $P1.'handle_types'(.EXCEPTION_OUT_OF_BOUNDS)
+ push_eh $P1
+ set $I0, $P0[-2]
+ ok(0, "no exception caught for negative index out of range access")
+ .return()
+caught:
+ pop_eh
+ ok(1, "caught exception on negative index out of range access")
.end
More information about the parrot-commits
mailing list