/******************************************************************************
 * Copyright (c) 2000-2021 Ericsson Telecom AB
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
 *
 * Contributors:
 *   Szabo, Bence Janos – initial implementation
 *
 ******************************************************************************/
module Any2Unistr
{
   
    type component EmptyCT {}
 
	testcase tc_any2unistr() runs on EmptyCT {
		var integer v_int1 := 5, v_int2;
		var template integer vmw_int1 := ?;
		var template integer vmw_int2 := -1 ifpresent;
		var universal charstring v_chr1, v_chr2, v_chr3, v_chr4;
		v_chr1 := any2unistr(v_int1); // after the assignment v_chr1 will be "5"
		v_chr2 := any2unistr(v_int2); // after the assignment v_chr2 will be "<unbound>"
		v_chr3 := any2unistr(vmw_int1); // after the assignment v_chr3 will be "?"
		v_chr4 := any2unistr(vmw_int2); // after the assignment v_chr3 will be "-1 ifpresent" 

		var universal charstring v_chr1_exp, v_chr2_exp, v_chr3_exp, v_chr4_exp;
		v_chr1_exp := "5";
		v_chr2_exp := "<unbound>";
		v_chr3_exp := "?";
		v_chr4_exp := "-1 ifpresent";

		if(match(v_chr1,v_chr1_exp) and match(v_chr2,v_chr2_exp) and
		   match(v_chr3,v_chr3_exp) and match(v_chr4,v_chr4_exp)) {
		  setverdict(pass);
		} else {
		  setverdict(fail);
		}
	}

    control
    {
	    execute(tc_any2unistr());
    }
}
