/***************************************************
 ** @author   STF 451, STF 470
 ** @version  0.0.2
 ** @purpose  1:21.1.1, Ensure that disconnect has no effect on components that are not connected
 ** @verdict  pass accept, ttcn3verdict:pass
 ***************************************************/

module Sem_210102_disconnect_operation_002{

    type port P message {
        inout integer
    }

    type component GeneralComp
    {
        port P p;
    }

	function f() runs on GeneralComp
	{
		if(p.checkstate("Mapped")) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
	}

    testcase TC_Sem_210102_disconnect_operation_002() runs on GeneralComp system GeneralComp {
        var GeneralComp v_ptc1 := GeneralComp.create,
			v_ptc2 := GeneralComp.create;

		map(v_ptc1:p, system:p);

		disconnect(v_ptc1:p, v_ptc2:p); // acceptable even when not connected

        v_ptc1.start(f());
		all component.done;
    }
    control{
        execute(TC_Sem_210102_disconnect_operation_002());
    }
}

