Skip to content

Commit

Permalink
fix RIA thaw and add a test for it
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.parrot.org/parrot/trunk@47534 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information
NotFound committed Jun 10, 2010
1 parent fb4f1a4 commit 9c48f7d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/pmc/resizableintegerarray.pmc
Expand Up @@ -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);
Expand Down
14 changes: 13 additions & 1 deletion t/pmc/resizableintegerarray.t
Expand Up @@ -43,7 +43,7 @@ Coverage plan:
.sub main :main
.include 'test_more.pir'
plan(46)
plan(47)
test_does_interfaces()
Expand Down Expand Up @@ -74,6 +74,7 @@ Coverage plan:
test_cant_shift_empty()
test_iterator()
test_clone()
test_freeze()
.end
.sub test_does_interfaces
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9c48f7d

Please sign in to comment.