[t][TT #1122] Convert t/op/numbert.t to PIR, mgrimes++
[parrot.git] / t / pmc / packfilefixuptable.t
blob5db7c376ebfb41371fbca0ff47f43b73cafec8ff
1 #!parrot
2 # Copyright (C) 2009, Parrot Foundation.
3 # $Id$
5 =head1 NAME
7 t/pmc/packfilefixuptable.t - test the PackfileFixupTable PMC
10 =head1 SYNOPSIS
12     % prove t/pmc/packfilefixuptable.t
14 =head1 DESCRIPTION
16 Tests the PackfileFixupTable PMC.
18 =cut
20 # Having some known data would be helpful, here.  For now, just make sure
21 # the values returned have the right types.
23 .include 't/pmc/testlib/packfile_common.pir'
24 .sub 'main' :main
25 .include 'test_more.pir'
26     plan(3)
28     test_unpack()
29 .end
31 # Check unpackging FixupTable
32 .sub 'test_unpack'
33     .local pmc pf, pfdir, pftable, pfentry
34     .local int size, this, data
35     .local string name
36     pf      = _pbc()
37     pftable = _get_fixup_table(pf)
38     isa_ok(pftable, 'PackfileFixupTable')
40     size    = elements pftable
41     ok(size, "Got some elements")
43     this    = 0
44   loop:
45     pfentry = pftable[this]
46     name    = typeof pfentry
47     eq name, "PackfileFixupEntry", next
48     $S0 = "PackfileFixupTable["
49     $S1 = this
50     $S0 = concat $S1
51     $S0 = concat "] returned an object of type: "
52     $S0 = concat name
53     ok(0, $S0)
54     .return ()
55   next:
56     this = this + 1
57     ge this, size, done
58     goto loop
59     gt size, 0, done
60   done:
61     ok(1, "All elements of Table are Entries")
62 .end
64 # Local Variables:
65 #   mode: cperl
66 #   cperl-indent-level: 4
67 #   fill-column: 100
68 # End:
69 # vim: expandtab shiftwidth=4 ft=pir: