/***************************************************
 ** @author   STF 487 (updated by STF 521)
 ** @version  0.0.2
 ** @purpose  1:22.3.3, null component in the to clause of the reply operation
 ** @verdict  pass reject
 ***************************************************/

// The following requirements are tested:
// No AddressRef in the to clause shall contain the special value null at the time
// of the operation.

module NegSem_220303_ReplyOperation_002 {


    signature S();

    type port P procedure {
        inout S;
    }

    type component GeneralComp {
        port P p;
    }

    function f_server() runs on GeneralComp {
        var GeneralComp v_compRef := null;
        p.getcall(S:?);
        p.reply(S:{}) to v_compRef;
    }

    testcase TC_NegSem_220303_ReplyOperation_002() runs on GeneralComp system GeneralComp {
        var GeneralComp v_ptc := GeneralComp.create("PTC");
        connect(self:p, v_ptc:p);
        v_ptc.start(f_server());
        p.call(S:{}, 1.0) {
            [] p.getreply(S:{}) { }
            [] p.catch(timeout) { }
        }
        setverdict(pass);
    }

    control{
        execute(TC_NegSem_220303_ReplyOperation_002(), 5.0);
    }

}
