/*****************************************************************
 ** @author   STF 487
 ** @version  0.0.1
 ** @purpose  1:20.4, explicit altstep call inside interleave
 ** @verdict  pass reject
 *****************************************************************/

// The following requirement is tested:
// Control transfer statements for, while, do-while, goto, activate,
// deactivate, stop, repeat, return, direct call of altsteps as alternatives
// and (direct and indirect) calls of user-defined functions, which include
// reception statements, shall not be used in interleave statements.

module NegSem_2004_InterleaveStatement_010 {

    type port MyPort message {
        inout charstring
    }

    type component GeneralComp {
        port MyPort p;
    }

    altstep a_receive() runs on GeneralComp {
        [] p.receive(charstring:?) {
        }
    }

    testcase TC_NegSem_2004_InterleaveStatement_010() runs on GeneralComp {
        p.send(charstring:"foo");
        p.send(charstring:"bar");
        p.send(charstring:"ding");

        interleave {
            [] p.receive(charstring:"bar") {
                a_receive();
            }
            [] p.receive(charstring:"foo") {
            }
        }
        setverdict(pass);
    }

    control{
        execute(TC_NegSem_2004_InterleaveStatement_010());
    }
}