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

NotFound at svn.parrot.org NotFound at svn.parrot.org
Wed Jun 9 13:40:44 UTC 2010


Author: NotFound
Date: Wed Jun  9 13:40:44 2010
New Revision: 47510
URL: https://trac.parrot.org/parrot/changeset/47510

Log:
ByteBuffer test for set with negative index, and force usage of the mark vtable function

Modified:
   trunk/t/pmc/bytebuffer.t

Modified: trunk/t/pmc/bytebuffer.t
==============================================================================
--- trunk/t/pmc/bytebuffer.t	Wed Jun  9 13:19:30 2010	(r47509)
+++ trunk/t/pmc/bytebuffer.t	Wed Jun  9 13:40:44 2010	(r47510)
@@ -18,7 +18,7 @@
 
 .sub 'main' :main
     .include 'test_more.pir'
-    plan(16)
+    plan(17)
 
     test_init()
     test_set_string()
@@ -46,6 +46,10 @@
     bb = new ['ByteBuffer']
     s = 'Hi'
     bb = s
+
+    # Exercise mark vtable
+    sweep 1
+
     n = elements bb
     is(n, 2, "size is the same as the source string bytelength")
     n = bb[0]
@@ -84,6 +88,15 @@
     is(n, 43, "setting a byte resize buffer with initial size")
     n = bb[41]
     is(n, 9, "resized buffer preserve old value")
+
+    push_eh catch
+    bb[-1] = 0
+    ok(0, "setting a byte with negative index should throw")
+    goto end
+catch:
+    pop_eh
+    ok(1, "setting a byte with negative index throws")
+end:
 .end
 
 .sub test_get_string


More information about the parrot-commits mailing list