/*****************************************************************
 ** @author   STF 521
 ** @version  0.0.2
 ** @purpose  1:20.2, verify that the activate operation cannot be used  in alt branch events (in template parameters)
 ** @verdict  pass reject
 *****************************************************************/

// The following requirement is tested:
// c) The evaluation of the event of an alt branch shall not have side effects. To avoid side effects that cause
// an inconsistency between the actual snapshot and the state of the component or introduce indeterminism
// in the evaluation of the following alt branches or the re-evaluation of the same alt branch, the restrictions
// imposed on the contents of functions called from special places (clause 16.1.4) shall apply to expressions
// occurring in the matching part of an alternative.

module NegSem_2002_TheAltStatement_079 {

    type port MyPort message {
        inout boolean
    }

    type component GeneralComp {
	    port MyPort p;
    }

    altstep a_timeout() {
        [] any timer.timeout {
        }
    }

	template boolean mw_msg (boolean p_par) := (false, p_par);

    testcase TC_NegSem_2002_TheAltStatement_079() runs on GeneralComp system GeneralComp {
        map(self:p, system: p);
	    p.send(true);
	    alt {
		    [] p.receive(mw_msg(activate(a_timeout()) != null)) {
			    setverdict(pass);
		    }
	    }
    }

    control {
	    execute(TC_NegSem_2002_TheAltStatement_079());
    }
}