/
imageiosize.t
73 lines (57 loc) · 1.35 KB
/
imageiosize.t
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!./parrot
# Copyright (C) 2010, Parrot Foundation.
=head1 NAME
t/pmc/imageiosize.t - test ImageIOSize PMC
=head1 SYNOPSIS
% prove t/pmc/imagiosize.t
=head1 DESCRIPTION
Tests the ImageIOSize PMC.
=cut
.sub main :main
.include 'test_more.pir'
plan(4)
.local pmc iios
iios = new ['ImageIOSize']
ok(1, 'instantiated ImageIOSize')
.local pmc test_pmc
test_pmc = null
setref iios, test_pmc
$P0 = deref iios
$S0 = freeze test_pmc
$I0 = $P0
$I1 = length $S0
is($I0, $I1, 'gets the same size as freeze (null)')
iios = new ['ImageIOSize']
test_pmc = 'get_test_simple'()
setref iios, test_pmc
$P0 = deref iios
$S0 = freeze test_pmc
$I0 = $P0
$I1 = length $S0
is($I0, $I1, 'gets the same size as freeze (simple)')
iios = new ['ImageIOSize']
test_pmc = 'get_test_aggregate'()
setref iios, test_pmc
$P0 = deref iios
$S0 = freeze test_pmc
$I0 = $P0
$I1 = length $S0
is($I0, $I1, 'gets the same size as freeze (aggregate)')
.end
.sub get_test_simple
$P0 = new ['Integer']
$P0 = -99
.return ($P0)
.end
.sub get_test_aggregate
$P0 = new ['ResizableStringArray']
$P0[0] = 'parrot'
$P0[1] = '???'
$P0[2] = 'profit'
.return ($P0)
.end
# Local Variables:
# mode: pir
# fill-column: 100
# End:
# vim: expandtab shiftwidth=4 ft=pir: