Ticket #1318 (new todo)

Opened 5 years ago

Last modified 5 years ago

./t/pmc/complex.t: Can SKIP-ped tests be unskipped?

Reported by: jkeenan Owned by:
Priority: normal Milestone:
Component: testing Version: 1.8.0
Severity: medium Keywords:
Cc: pmichaud bacek NotFound Language:
Patch status: Platform:


A variety of issues were discussed in  RT #59630 and the ticket was resolved. However, t/pmc/complex.t still has 3 SKIP tests where the skip message cites RT #59630. This must now be followed in Trac.

Can the people who participated in the original RT take a look and see whether the tests can be unskipped?

Thank you very much.


Change History

Changed 5 years ago by jkeenan

1163 .sub add_using_subclass_of_complex_bug_59630
1164     skip( 3, 'add using subclass of Complex - TT #1318' )
1165     .return()

Changed 5 years ago by bacek


Yes, test can be unskipped. Unfortunately it will not pass. Major problem is in interaction between Object, PMCProxy and get_attr_str (used in auto_attrs). Currently Complex.add(Complex) invoked propely. But GETATTR_(re|im) fail to fetch correct values because it should fetch real object from PMCProxy before fetching attributes.

-- Bacek

Changed 5 years ago by mikehh

I did some tests on this and simplified the basic test in t/pmc/complex.t

#! parrot

.sub main :main
    .include 'test_more.pir'
    .include 'fp_equality.pasm'
    .include "iglobals.pasm"


    $P0 = subclass 'Complex', 'MyComplex'
    addattribute $P0, "re"
    addattribute $P0, "im"

    .local pmc a, b, c
    ##   a = 1 + 2i
    a = new ['MyComplex']
    a['real'] = 1
    a['imag'] = 2
    is( a, "1+2i", 'a created' )

    ##   b = 3 + 4i
    b = new ['MyComplex']
    b['real'] = 3
    b['imag'] = 4
    is( b, "3+4i" , 'b created' )

    ##   a = a + b

    a = add a, b
    is( a, "4+6i", 'subclass add' )

giving the following results:

mhb@mhb-desktop:~/parrot$ date
Wed Dec  2 13:09:06 GMT 2009
mhb@mhb-desktop:~/parrot$ prove -v t/pmc/sub_comp.t
t/pmc/sub_comp.t ..
ok 1 - a created
ok 2 - b created
not ok 3 - subclass add
# Have: 0+0i
# Want: 4+6i
Failed 1/3 subtests

Test Summary Report
t/pmc/sub_comp.t (Wstat: 0 Tests: 3 Failed: 1)
  Failed test:  3
Files=1, Tests=3,  0 wallclock secs ( 0.02 usr  0.00 sys +  0.01 cusr  0.02 csys =  0.05 CPU)
Result: FAIL

So it looks like the subclassed add always returns 0+0i

Changed 5 years ago by mikehh

this looks like the problem specified in TT #562

Note: See TracTickets for help on using tickets.