/******************************************************************************
 * Copyright (c) ETSI 2017.
 *
 * This file is subject to copyrights owned by ETSI. Non-exclusive permission
 * is hereby granted, free of charge, to copy, reproduce and amend this file
 * under the following conditions: It is provided "as is", without warranty of any
 * kind, expressed or implied.
 * 
 * ETSI shall never be liable for any claim, damages, or other liability arising
 * from its use or inability of use.This permission does not apply to any documentation
 * associated with this file for which ETSI keeps all rights reserved. The present
 * copyright notice shall be included in all copies of whole or part of this
 * file and shall not imply any sub-license right.
 *
 * Modified by: Adrien Kirjak
 *
 ** @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 reject
 ***************************************************/
module NegSem_160102_predefined_functions_030 {
    type enumerated EnumeratedType {e_black, e_white};
    type enumerated EnumeratedTypeWithLabels1 {e_black (1), e_white};
    type enumerated EnumeratedTypeWithLabels2 {e_black (-1), e_white};
    type enumerated EnumeratedTypeWithLabels3 {e_black (-1), e_white , e_yellow (0) };
    type enumerated Fruits {e_apple, e_peach, e_cherry};

	type component GeneralComp {	
	}


	testcase TC_NegSem_160102_predefined_functions_030 () runs on GeneralComp {

		var EnumeratedType vl_enum_black := e_black;	
		var EnumeratedType vl_enum_white := e_white;	
		var EnumeratedTypeWithLabels1 vl_enum1_black := e_black;	
		var EnumeratedTypeWithLabels1 vl_enum1_white := e_white;	
		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;	
		const EnumeratedTypeWithLabels1 c_enum1_black := e_black;	

		int2enum(4,vl_enum1_black); //not existing label

		//if( match(int2enum(4,vl_enum1_black), c_enum1_black) // int2enum isn't a return type function
		if( match(vl_enum1_black, c_enum1_black)	
		  ) {
		    setverdict(pass);
		}
		else {
		    setverdict(fail);
		}
		
		   
	}


	control{

		execute(TC_NegSem_160102_predefined_functions_030());

	}

}
