/***************************************************
 ** @author   STF 487
 ** @version  0.0.1
 ** @purpose  1:B.1.2.6, Ensure that the IUT correctly handles template matching of subset definitions
 ** @verdict  pass reject
 ***************************************************/

//Restriction f:If the length matching attribute is attached to the SubSet, the maximum length allowed by the length attribute
//shall not exceed the number of the elements in the SubSet.

module NegSem_B010207_subset_003{
	type set of integer SoI;

	type SoI MessageType;

	type port loopbackPort message {
		inout MessageType;
	}


	type component GeneralComp {
		port loopbackPort messagePort;
	}

	testcase TC_NegSem_B010207_subset_003() runs on GeneralComp {

		var MessageType v_testMessage;

		template MessageType mw_matchingTemplate := subset(1,10,3) length (1..5); //error:the upper bound of length attribute contradicts to the maximum number of
                                                                     // elements imposed by the subset argument

		v_testMessage := {1,10,3};

 messagePort.send(v_testMessage);

    alt {
     [] messagePort.receive(mw_matchingTemplate) {
        setverdict(pass);
     }
     [] messagePort.receive {
        setverdict(fail);
     }
    }

	}
	control {
		execute(TC_NegSem_B010207_subset_003());
	}
}
