/***************************************************
 ** @author   STF 470
 ** @version  0.0.1
 ** @purpose  1:21.1.2, Verify that unmapping 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_003 {

    type port P message {
        inout integer
    }

    type component GeneralComp
    {
        port P p;
    }

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

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

