/***************************************************
 ** @author   STF 487 (updated by STF 527)
 ** @version  0.0.2
 ** @purpose  1:B.1.2.2, Ensure that the IUT correctly handles template matching of complemented value omit
 ** @verdict  pass accept, ttcn3verdict:fail
 ***************************************************/

//Restriction e) The complement of a template list shall not match omit.

module NegSem_B010202_complemented_value_list_004 {

    type record MyRec {
        integer field1,
        float   field2 optional
    }

    type port loopbackPort message {
        inout MyRec
    }


    type component GeneralComp {
        port loopbackPort messagePort
    }

    testcase TC_NegSem_B010202_complemented_value_list_004() runs on GeneralComp {
        var MyRec v_testMessage := { field1 := 1, field2 := omit};
        var template MyRec mw_matchingTemplate:= { field1 := ?, field2 := complement(1.0, (2.0 .. 5.0)) };

        messagePort.send(v_testMessage);

        alt {
            [] messagePort.receive(mw_matchingTemplate) { // won't match as complement never matches omit
                setverdict(pass);
        }
            [] messagePort.receive {
                setverdict(fail);
            }
        }
    }

    control {
        execute(TC_NegSem_B010202_complemented_value_list_004());
    }

}
