Running 'make test' tonight, for the first time I experienced a
failure in a test *other than* t/examples/shootout.t (see http://
rt.perl.org/rt3/Ticket/Display.html?id=41185 for that problem). The
test file in question is t/pmc/object-meths.t. Here is the output of
t/harness on that file:
#####
[parrot] 533 $ perl t/harness t/pmc/object-meths.t
t/pmc/object-meths....NOK 36/36
# Failed test (t/pmc/object-meths.t at line 1149)
# got: 'init was called
# WTF!
# '
# expected: 'init was called
# init was called
# '
# Looks like you failed 1 test of 36.
t/pmc/object-meths....dubious
Test returned status 1 (wstat 256, 0x100)
DIED. FAILED test 36
Failed 1/36 tests, 97.22% okay (less 2 skipped tests: 33
okay, 91.67%)
Failed Test Stat Wstat Total Fail List of Failed
------------------------------------------------------------------------
-------
t/pmc/object-meths.t 1 256 36 1 36
2 subtests skipped.
Failed 1/1 test scripts. 1/36 subtests failed.
Files=1, Tests=36, 4 wallclock secs ( 1.31 cusr + 1.77 csys = 3.08
CPU)
Failed 1/1 test programs. 1/36 subtests failed.
######
Here is the block of code in that file beginning at line 1149:
ir_output_is( <<'CODE', <<'OUTPUT', "init calls" );
.sub main :main
.local pmc cl, o
cl = newclass 'MyClass'
o = new 'MyClass'
o = new 'MyClass', $P0
.end
.namespace ['MyClass']
.sub init :method :vtable
.param pmc initializer :optional
print "init was called\n"
.end
.sub init_pmc :method :vtable
.param pmc initializer
print "WTF!\n"
.end
CODE
init was called
init was called
OUTPUT
#####
kid51
> o = new 'MyClass', $P0
actually should call init_pmc, rather than init, even when $P0 is null.
Leo, are you saying the choice between init and init_pmc should be
based on the content of the argument rather than the signature of the call?
Allison
No. I was saying that there should be just one init :vtable that is called
with any arguments (or none) according to pdd03 calling convs.
> Allison
my 2¢
leo
Okay. So (a) are people experiencing this on other OSes? (b) how do
we fix it?
> Okay. So (a) are people experiencing this on other OSes? (b) how do
> we fix it?
This was a feature request submitted as a failing test. I've changed the
test to reflect current behavior in r17026, and submitted the feature
request as a separate ticket #41528.
Allison