/******************************************************************************
 * 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:B.1.3.3, Ensure that all from clause can be used inside permutation
 ** @verdict  pass accept, ttcn3verdict:pass
 ***************************************************/

// The following requirement is tested:
// Besides specifying all individual values, it is possible to add all elements of 
// a record of template into permutations using an all from clause.

module Sem_B010303_permutation_007 { 

	type record of integer RoI;
	
	template RoI t_source := { 1, 2 };
	template RoI t_perm1 := { permutation (all from t_source), 5 };
	template RoI t_perm2 := { -1, permutation (0, all from t_source, 3) };
	
	type component GeneralComp {	    	    
	}	

	testcase TC_Sem_B010303_permutation_007() runs on GeneralComp {
		if (match({ 2, 1, 5 }, t_perm1) and match({ -1, 1, 0, 2, 3 }, t_perm2)) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
	}

	control{
	    execute(TC_Sem_B010303_permutation_007());
	}

}
 
