/***************************************************
 ** @author   STF 451
 ** @version  0.0.1
 ** @purpose  1:16.1.2, Ensure that the IUT recognizes predefined functions and correctly evaluates them (as specified by Annex C)
 ** @verdict  pass accept, ttcn3verdict:pass
 ***************************************************/
// test enum2int with labels
module Sem_160102_predefined_functions_013 {

    type enumerated EnumeratedTypeWithLabels2 {e_black (-1), e_white};
    type enumerated EnumeratedTypeWithLabels3 {e_black (-1), e_white , e_yellow (0) };

    type component GeneralComp {
    }

    testcase TC_Sem_160102_predefined_functions_013 () runs on GeneralComp {
        var EnumeratedTypeWithLabels2 vl_enum2_black := e_black;
        var EnumeratedTypeWithLabels2 vl_enum2_white := e_white;
        var EnumeratedTypeWithLabels3 vl_enum3_black := e_black;
        var EnumeratedTypeWithLabels3 vl_enum3_white := e_white;
        var EnumeratedTypeWithLabels3 vl_enum3_yellow := e_yellow;

        if( match(enum2int(vl_enum2_black), -1) and
            match(enum2int(vl_enum2_white), 0)
        ) {
            setverdict(pass);
        }
        else {
            setverdict(fail);
        }

        if( match(enum2int(vl_enum3_black), -1) and
            match(enum2int(vl_enum3_white), 1)
        ) {
            setverdict(pass);
        }
        else {
            setverdict(fail);
        }
    }

    control{
        execute(TC_Sem_160102_predefined_functions_013());
    }
}
