#385: t/pmc/packfileconstanttable.t failure
--------------------+-------------------------------------------------------
Reporter: coke | Owner: Infinoid
Type: bug | Status: new
Priority: normal | Milestone:
Component: none | Version:
Severity: medium | Keywords:
Lang: | Patch:
Platform: |
--------------------+-------------------------------------------------------
Changes (by Infinoid):
* owner: => Infinoid
Comment:
Replying to [comment:5 rg]:
> Actually I think the test was never fully exercised. After the change in
r37044 the uuid.pmc now seems to contain a type Key pftable element, which
can't be retrieved. Instead of autoboxing, the packfileconstanttable.pmc
just throws an exception. I have no idea how to fix that (other than not
checking type Key elements at all).
Yep. PDD13 says it will throw an exception if the constant at the given
offset isn't of the requested type, so autoconverting would be wrong.
{{{
=item * C<get_number_keyed_int> (v-table)
Gets the value of the number constant at the specified index in the
constants
table. If the constant at that position in the table is not a number, an
exception will be thrown.
}}}
(And similar text, for all of the other type accessors.) So I think the
PackfileConstantTable class is doing the right thing here.
The real issue is the test. When I wrote these tests, I chose a pbc file
at random which didn't seem likely to change (uuid.pbc). So of course,
when it got modified and the items in its constant table were no longer
the same, the test blew up. Oops.
To fix this properly, the test should use a pbc file whose contents are
known (and guaranteed to never change). It should probably generate this
pbc file itself.
(Note that some of the other t/pmc/packfile*.t tests also use uuid.pbc for
testing. Having each test generate its own pbc test file is probably
better than using a common one, as a common one will cause race conditions
with parallel testing.)
--
Ticket URL: <https://trac.parrot.org/parrot/ticket/385#comment:10>
Parrot <https://trac.parrot.org/parrot/>
Parrot Development
_______________________________________________
parrot-tickets mailing list
[email protected]
http://lists.parrot.org/mailman/listinfo/parrot-tickets