/***************************************************
 ** @author   STF 470
 ** @version  0.0.1
 ** @purpose  1:21.1.2, Verify that disconnecting all ports of all components is not possible in PTC
 ** @verdict  pass reject
 ***************************************************/

// The following requirements are tested:
// The all component keyword ... shall only be used by the MTC.

module NegSem_210102_disconnect_and_unmap_operations_002 {

    type port P message {
        inout integer
    }

    type component GeneralComp
    {
        port P p;
    }

	function f() runs on GeneralComp {
		disconnect(all component:all port); // error: allowed in PTC only
		setverdict(pass);
	}

    testcase TC_NegSem_210102_disconnect_and_unmap_operations_002() runs on GeneralComp system GeneralComp {
        var GeneralComp v_ptc := GeneralComp.create;
        connect(self:p, v_ptc:p);
        v_ptc.start(f());
		v_ptc.done; // wait for the PTC to finish
    }
    control{
        execute(TC_NegSem_210102_disconnect_and_unmap_operations_002());
    }
}

