Loading 20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_007.ttcn 0 → 100644 +49 −0 Original line number Diff line number Diff line /***************************************************************** ** @author STF 409 ** @version $Rev: 150 $ ** @purpose 1:20.2, Ensure that an altstep invocation works as expected and that the optional statement block is executed after the altstep staatement block (loopback case). ** @verdict pass accept, ttcn3verdict:pass *****************************************************************/ module Sem_2002_TheAltStatement_007 { type port MyPort message { inout charstring } type component GeneralComp { port MyPort p; var boolean v_visitedAltstep := false; } template charstring m_testOne := "ping1"; template charstring m_testTwo := "ping2"; altstep a_test() runs on GeneralComp { [] p.receive(m_testOne) { v_visitedAltstep := true; } } testcase TC_Sem_2002_TheAltStatement_007() runs on GeneralComp { p.send(m_testOne); alt { [] a_test() { if (v_visitedAltstep == true) { setverdict(pass); } } [else] { setverdict(false); } } setverdict(pass); } control { execute(TC_Sem_2002_TheAltStatement_007()); } } No newline at end of file Loading
20_statement_and_operations_for_alt/2002_the_alt_statement/Sem_2002_TheAltStatement_007.ttcn 0 → 100644 +49 −0 Original line number Diff line number Diff line /***************************************************************** ** @author STF 409 ** @version $Rev: 150 $ ** @purpose 1:20.2, Ensure that an altstep invocation works as expected and that the optional statement block is executed after the altstep staatement block (loopback case). ** @verdict pass accept, ttcn3verdict:pass *****************************************************************/ module Sem_2002_TheAltStatement_007 { type port MyPort message { inout charstring } type component GeneralComp { port MyPort p; var boolean v_visitedAltstep := false; } template charstring m_testOne := "ping1"; template charstring m_testTwo := "ping2"; altstep a_test() runs on GeneralComp { [] p.receive(m_testOne) { v_visitedAltstep := true; } } testcase TC_Sem_2002_TheAltStatement_007() runs on GeneralComp { p.send(m_testOne); alt { [] a_test() { if (v_visitedAltstep == true) { setverdict(pass); } } [else] { setverdict(false); } } setverdict(pass); } control { execute(TC_Sem_2002_TheAltStatement_007()); } } No newline at end of file