/***************************************************
 ** @author   STF 487
 ** @version  0.0.1
 ** @purpose  1:6.2.5, assignment notation for union values
 ** @verdict  pass accept, ttcn3verdict:pass
 ***************************************************/

// The following requirement is tested:
// The assignment notation shall be used for union-s, and the notation shall assign
// a value to one field only. This field becomes the chosen field.

module Sem_060205_top_level_001 {
    type component GeneralComp {
	}

    type union U {
		integer option1,
		charstring option2
	}

    testcase TC_Sem_060205_top_level_001() runs on GeneralComp {
		var U v_choice := { option1 := 1 };
        if (ischosen(v_choice.option1) and v_choice.option1 == 1) { setverdict(pass); }
        else { setverdict(fail); }
	}

	control{
		execute(TC_Sem_060205_top_level_001());
	}
}