/*****************************************************************
 ** @author   STF 409
 ** @version  0.0.1
 ** @purpose  1:20.2, Ensure that the killed-block in an alt-statement is triggered as expected when the component is killed (loopback case).
 ** @verdict  pass accept, ttcn3verdict:pass
 *****************************************************************/

module Sem_2002_TheAltStatement_009 {

type port MyPort message {
    inout charstring
}

type component SystemComp {
    port MyPort p;
}

type component MTCComp {
    port MyPort p;
}

type component PTCComp {
    port MyPort p;
}

function f_secondComponent() runs on PTCComp {
}

testcase TC_Sem_2002_TheAltStatement_009() runs on MTCComp system SystemComp {
    var PTCComp v_ptc := PTCComp.create;
    map(self:p, system:p);
    v_ptc.start(f_secondComponent());
    v_ptc.kill;

    alt {
        [] v_ptc.killed {
            setverdict(pass);
        }
        [else] {
            setverdict(fail);
        }
    }
}

control {
    execute(TC_Sem_2002_TheAltStatement_009());
}

}