/***************************************************
 ** @author   STF 470
 ** @version  0.0.1
 ** @purpose  1:20.5.1, verify stop command behaviour in invoked default
 ** @verdict  pass accept, ttcn3verdict:pass
 ***************************************************/

// The following requirement is tested:
// In the case of a successful termination, the default may either stop the test component
// by means of a stop statement

module Sem_200501_the_default_mechanism_008 {

	type port P message {
		inout integer;
	}

	type component GeneralComp {
		port P p;
	}

	altstep a() runs on GeneralComp {
		[] p.receive(integer:?) {
			setverdict(pass, "Default value -> stopping component");
			stop;
		}
	}

	testcase TC_Sem_200501_the_default_mechanism_008() runs on GeneralComp {
		activate(a());
		p.send(integer:5);
		alt {
			[] p.receive(integer:1) { // not expected: invoking default
				setverdict(fail);
			}
		}
		setverdict(fail, "Component stop expected");
	}

	control{
		execute(TC_Sem_200501_the_default_mechanism_008());
	}
}
