Skip to content
Browse files

fix RIA thaw and add a test for it

git-svn-id: https://svn.parrot.org/parrot/trunk@47534 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information...
1 parent fb4f1a4 commit 9c48f7db7fd99a4f880336f7db5466aa5e83ee3d @NotFound NotFound committed
Showing with 19 additions and 3 deletions.
  1. +6 −2 src/pmc/resizableintegerarray.pmc
  2. +13 −1 t/pmc/resizableintegerarray.t
View
8 src/pmc/resizableintegerarray.pmc
@@ -313,8 +313,12 @@ Used to unarchive the array.
}
VTABLE void thaw(PMC *info) {
- const INTVAL n = VTABLE_shift_integer(INTERP, info);
- const INTVAL rt = VTABLE_shift_integer(INTERP, info);
+ INTVAL n, rt;
+
+ SUPER(info);
+
+ n = VTABLE_shift_integer(INTERP, info);
+ rt = VTABLE_shift_integer(INTERP, info);
SET_ATTR_size(INTERP, SELF, 0);
SET_ATTR_resize_threshold(INTERP, SELF, rt);
View
14 t/pmc/resizableintegerarray.t
@@ -43,7 +43,7 @@ Coverage plan:
.sub main :main
.include 'test_more.pir'
- plan(46)
+ plan(47)
test_does_interfaces()
@@ -74,6 +74,7 @@ Coverage plan:
test_cant_shift_empty()
test_iterator()
test_clone()
+ test_freeze()
.end
.sub test_does_interfaces
@@ -596,6 +597,17 @@ k0:
is( $I0, 1, 'cloned is equal to original')
.end
+.sub test_freeze
+ .local pmc ria, th
+ .local string s
+ ria = new ['ResizableIntegerArray']
+ push ria, 1
+ push ria, 0x1FFFF
+ s = freeze ria
+ th = thaw s
+ is( ria, th, 'freeze/thaw copy is equal to original' )
+.end
+
# Local Variables:
# mode: pir
# fill-column: 100

0 comments on commit 9c48f7d

Please sign in to comment.
Something went wrong with that request. Please try again.