/*****************************************************************
 ** @author   STF 548
 ** @version  0.0.1
 ** @purpose  1:27.2, Verify that excluded definition cannot refer to a non-existent module 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_004 {

    type component GeneralComp {
	}

	const integer c_int1 := 1;
	const integer c_int2 := 2;
	const integer c_int3 := 3;

	type record of universal charstring RoUC;

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


	control{
		execute(TC_NegSem_2702_the_with_statement_004());
	}

} with { encode(const all except {c_int4}) "RuleA" }