/*****************************************************************
 ** @author   STF 548
 ** @version  0.0.1
 ** @purpose  1:27.2, Verify that excluded definition cannot refer to a non-existent group item
 ** @verdict  pass reject
 *****************************************************************/

// The following requirement is tested:
// Restriction a:
// DefinitionRef and FieldReference shall refer to a definition or field respectively which is within the module,
// group or definition to which the with statement is associated


module NegSem_2702_the_with_statement_005 {

	group G {
		type component GeneralComp {
		}

		const integer c_int1 := 1;
		const integer c_int2 := 2;
		const integer c_int3 := 3;
	} with { encode(const all except {c_int4}) "RuleA" }

	const integer c_int4 := 4;

	type record of universal charstring RoUC;

	testcase TC_NegSem_2702_the_with_statement_005 () runs on GeneralComp {
		var RoUC v_enc1 := c_int1.encode,
			v_enc2 := c_int2.encode,
			v_enc3 := c_int3.encode,
			v_enc4 := c_int4.encode;
		if(v_enc1[0] == "RuleA" and v_enc2[0] == "RuleA" and v_enc3[0] == "RuleA" and lengthof(v_enc4) == 0) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
	}


	control{
		execute(TC_NegSem_2702_the_with_statement_005());
	}

}