/*****************************************************************
 ** @author   STF 548
 ** @version  0.0.1
 ** @purpose  1:27.1.2.0, Verify that override is applied to lower scopes that do not declare the attribute
 ** @verdict  pass accept, ttcn3verdict:pass
 *****************************************************************/

// The following requirement is tested:
// The override directive overrides the specified attribute for all declarations at all lower scopes
// that do not also declare the specified attribute.

module Sem_27010200_general_013 {

    type component GeneralComp {
	}

	type record R {
		integer field1,
		integer field2
	} with { encode "Rule1" }

	type record R2 {
		R field
	}

	type record of universal charstring RoUC;

	testcase TC_Sem_27010200_general_013 () runs on GeneralComp {
		var RoUC v_enc1 := R.encode,
			v_enc2 := R2.encode,
			v_enc3 := R2.field.encode;
		if(lengthof(v_enc1) == 1 and v_enc1[0] == "Rule1" and
		   lengthof(v_enc2) == 1 and v_enc2[0] == "GeneralRule" and
		   lengthof(v_enc3) == 1 and v_enc3[0] == "GeneralRule") {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
	}

	control {
		execute(TC_Sem_27010200_general_013());
	}
} with { encode override "GeneralRule" }