/***************************************************
 ** @author   STF 572
 ** @version  0.0.1
 ** @purpose  1:6.2.4, using user-assigned integer expressions for enums
 ** @verdict  pass accept, ttcn3verdict:pass
 ***************************************************/

//The following requirement is tested:
/* Each enumerated value may optionally have a user-assigned integer expressionor non-empty list of integer literal
 * values or ranges of integer literal values, which is defined after the name of the enumerated value in parenthesis.
 */
module Sem_060204_enumerated_type_and_values_008 {

    type component GeneralComp {
	}

    type enumerated EDays {
        Monday(1), Tuesday(1+1), Wednesday(bit2int('0011'B)), Thursday(oct2int('34'O)), Friday(hex2int('FF'H))
    };
    // note:  Monday(1), Tuesday(2), Wednesday(3), Thursday(28), Friday(255)

    testcase TC_Sem_060204_enumerated_type_and_values_008() runs on GeneralComp {
        var EDays v_day0 := Monday, v_day2 := Tuesday, v_day3 := Wednesday, v_day4 := Thursday, v_day5 := Friday;

		if (enum2int(v_day0) == 1 and enum2int(v_day2) == 2 and  enum2int(v_day3) == 3 and enum2int(v_day4) == 52 and enum2int(v_day5) == 255) {
			setverdict(pass);
		} else {
            setverdict(fail);
  }
	}

	control {
		execute(TC_Sem_060204_enumerated_type_and_values_008());
	}
}
