/****************************************************************************** * Copyright (c) 2000-2016 Ericsson Telecom AB * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Balasko, Jeno * Raduly, Csaba * ******************************************************************************/ module all_from_complement { // ETSI CR 6088 import from types all; import from functions all; import from imported_templates all; // B 1.2.1 Template List // "It can be used on values of all types" //just to test these types as well: modulepar RoI tsp_RoI3 := {20,21,22}; modulepar RoI tsp_SoI3 := {20,21,22}; const RoI c_RoI3 := {20,21,22}; const SoI c_SoI3 := {20,21,22}; //============Record of Integer============================ template RoI t_RoI1 := {1, 2, (6..9)}; template RoI t_RoI2 := {1, *, 3}; template RoI t_RoI3 := {20,21,22}; template RoI t_RoI4 := {1, ?, 3}; //template RoI t_RoI1c := {complement (1),complement (2), complement(6)}; template integer t_i0 := complement(all from t_RoI1); template integer t_i0_eq := complement (1, 2, (6..9)); template integer t_i1 := complement(all from t_RoI1, 100); template integer t_i1_eq :=complement(1, 2, (6..9), 100); template integer t_i2 := complement (-1,0,all from t_RoI1, 100); template integer t_i2_eq := complement (-1,0,1, 2, (6..9), 100); template integer t_i3 := complement (-1,0,all from t_RoI1, all from t_RoI3, 100); template integer t_i3_eq := complement (-1,0,1, 2, (6..9),20,21,22, 100); template integer t_i4 := complement (-1,0,all from t_RoI1, 100, all from t_RoI3); template integer t_i4_eq := complement (-1,0,1, 2, (6..9),100,20,21,22 ); template integer t_i5 := complement (-1,0,all from t_RoI1, 100, all from t_RoI3,all from t_RoI3 ); //repetition template integer t_i5_eq := complement (-1,0,1, 2, (6..9),100,20,21,22,20,21,22); template integer t_i6 := complement (-1,0,all from t_RoI1, 100, all from t_RoI3,all from t_RoI3,all from t_RoI3); //repetition template integer t_i6_eq := complement (-1,0, 1, 2, (6..9),100,20,21,22,20,21,22,20,21,22); //from modulepar: template integer t_i13roi := complement(all from tsp_RoI3); template integer t_i13_eq := complement(20,21,22); template integer t_i13soi := complement(all from tsp_SoI3); //from const: template integer t_i13roi_c := complement(all from c_RoI3); template integer t_i13soi_c := complement(all from c_SoI3); //=== All from referring remote templates (imported templates) template integer t_importing_i0 := complement(all from t_imported_RoI1); template integer t_importing_i1 := complement(all from t_imported_RoI1, 100); template integer t_importing_i2 := complement(-1,0,all from t_imported_RoI1, 100); template integer t_importing_i3 := complement(-1,0,all from t_imported_RoI1, all from t_imported_RoI3, 100); template integer t_importing_i4 := complement(-1,0,all from t_imported_RoI1, 100, all from t_imported_RoI3); template integer t_importing_i5 := complement(-1,0,all from t_imported_RoI1, 100,all from t_imported_RoI3,all from t_imported_RoI3 ); //repetition template integer t_importing_i6 := complement(-1,0,all from t_imported_RoI1, 100, all from t_imported_RoI3,all from t_imported_RoI3,all from t_imported_RoI3); //repetition template integer t_importing_i7 := complement(all from t_imported_RoI4,100); template integer t_importing_i8 := complement(100,all from t_imported_RoI4); template integer t_importing_i9 := complement(100,all from t_imported_RoI4,-1); //===========Set of Integer================================ template SoI t_SoI1 := {1, 2, (6..9)}; template SoI t_SoI2 := {1, *, 3}; template SoI t_SoI3 := {20,21,22}; template integer t_i0s := complement(all from t_SoI1); template integer t_i0s_eq := complement( 1,2,(6..9)); template integer t_i1s := complement(all from t_SoI1, 100); template integer t_i1s_eq := complement( 1,2,(6..9),100); // equivalent to (1, 2, (6..9) , 100); template integer t_i2s := complement(-1,0,all from t_SoI1, 100); template integer t_i2s_eq := complement( -1,0,1,2,(6..9),100); template integer t_i3s := complement(-1,0,all from t_SoI1, all from t_SoI3, 100); template integer t_i3s_eq := complement( -1,0,1,2,(6..9),20,21,22,100); template integer t_i4s := complement(-1,0,all from t_SoI1, 100, all from t_SoI3); template integer t_i5s := complement(-1,0,all from t_SoI1, 100, all from t_SoI3,all from t_SoI3 ); //repetition template integer t_i6s := complement(-1,0,all from t_SoI1, 100, all from t_SoI3,all from t_SoI3,all from t_SoI3); //repetition //===========Record of of charstring================================ template RoCS t_RoCS1 := { "apple","banana","","pear"}; template RoCS t_RoCS2 := { "apples","bananas","","pears"}; template charstring t_cs1 := complement ( all from t_RoCS1, "dog" ); template charstring t_cs2 := complement ( "treeeeeeeeeeeeee",all from t_RoCS1, "dog", all from t_RoCS2); //==== function reference ===== template RoF_int2int t_rofref_int2int := { refers(f_int2int_1),refers(f_int2int_2) } template F_int2int t_fref_int2int_c := complement( all from t_rofref_int2int ); template F_int2int t_fref_int2int_c_eq := complement( refers(f_int2int_1),refers(f_int2int_2) ); //============== Test for Integer List ================================ //----- Tests for static templates ------ //real static template, without any manipulation testcase tc_complementInt() runs on A { var RoI vl_goodValues := { -99,-10,-1,0,3,4,5,10,11,20,99,101,102,200,1000, 100000000000000}; action("t_i1=", t_i1, " will be checked against ",vl_goodValues); var integer N:=sizeof(vl_goodValues); for(var integer i:=0;i