/***************************************************
 ** @author   STF 409
 ** @version  0.0.1
 ** @purpose  1:16.1.4, Ensure that the IUT recognizes restrictions described in section 16.1.4. STF409 assumes that the list given in section 16.1.4 describes mandatory restrictions
 ** @verdict  pass reject
 ***************************************************/
module NegSem_160104_invoking_functions_from_specific_places_002 {

    type port loopbackPort message {
        inout integer
    }


    type component GeneralComp {
        port loopbackPort messagePort
    }

    function f_test() return boolean {
        if (rnd() > 0.5) { //calling rnd within a function inside a boolean guard
            return true;
        } else {
            return false;
        }
    }

    testcase TC_NegSem_160104_invoking_functions_from_specific_places_002 () runs on GeneralComp {
        var integer v_i;

        messagePort.send(1);
        alt {
            [f_test()] messagePort.receive { v_i:=0; }
            [] messagePort.receive { v_i:=1; }
        }

    }

    control{

        execute(TC_NegSem_160104_invoking_functions_from_specific_places_002());

    }

}
