/****************************************************************************** * 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 * Baranyi, Botond * Kovacs, Ferenc * Raduly, Csaba * ******************************************************************************/ module NegTest_RAW_Testcases { import from NegTest_RAW_Types all; type component RawComp {}; //================================================ //======== Functions============================== //================================================ function f_compareAndVerdict(in octetstring pl_encoded, in octetstring pl_expected) { //log("Encoded value: ", pl_encoded); //switch off from cfg file ! //log("Expected value: ", pl_expected); if( pl_encoded == pl_expected ) { setverdict(pass); } else { setverdict(fail, "! encoded value: ", pl_encoded, "!expected value: ", pl_expected ); } } //seq external function encode_rawInteger10( in RawInteger10 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSeqEmpty(in RawSeqEmpty pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSeqBool(in RawSeqBool pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSeqInt(in RawSeqInt pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSeqInt8(in RawSeqInt8 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSeqRawEnum(in RawSeqRawEnum pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSeqInt2( in RawSeqInt2 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSeqInt28( in RawSeqInt28 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSeqIntSeqInt2( in RawSeqIntSeqInt2 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSeqIntSeqInt2opt( in RawSeqIntSeqInt2opt pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSeqIntSeqInt2optopt( in RawSeqIntSeqInt2optopt pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSeqInt3( in RawSeqInt3 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } //external function encode_rawSeqInt3opt( in RawSeqInt3opt pdu) return octetstring //with { extension "prototype(convert) encode(RAW)" } external function encode_rawSeqInt4( in RawSeqInt4 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSeqOJKL( in RawSeqOJKL pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSeqIOKL( in RawSeqIOKL pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSeqCharstring(in RawSeqCharstring pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSeqStr(in RawSeqStr pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSeqBitStr(in RawSeqBitStr pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSeqOctStr(in RawSeqOctStr pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSeqIntCharstring( in RawSeqIntCharstring pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSeqIntStr( in RawSeqIntStr pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSeqIntBitStr( in RawSeqIntBitStr pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSeqISKL( in RawSeqISKL pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSeqIntSeqIntSeqInt2( in RawSeqIntSeqIntSeqInt2 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSeqIntSeqIntSeqInt2SeqCharstring2( in RawSeqIntSeqIntSeqInt2SeqCharstring2 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSeqIntSeqIntSeqInt2SeqInt2(in RawSeqIntSeqIntSeqInt2SeqInt2 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSeqIntSeqCharstring2( in RawSeqIntSeqCharstring2 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSeqSeqIntSeqInt2SeqCharstring2( in RawSeqSeqIntSeqInt2SeqCharstring2 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSeqIntSeqIntSeqInt2optoptSeqCharstring2( in RawSeqIntSeqIntSeqInt2optoptSeqCharstring2 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSeq_SeqSeqIntSeqInt2SeqCharstring2_SeqSeqIntSeqInt2SeqCharstring2( in RawSeq_SeqSeqIntSeqInt2SeqCharstring2_SeqSeqIntSeqInt2SeqCharstring2 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSeq_SeqSeqIntSeqInt2optoptSeqCharstring2_SeqSeqIntSeqInt2optoptSeqCharstring2( in RawSeq_SeqSeqIntSeqInt2optoptSeqCharstring2_SeqSeqIntSeqInt2optoptSeqCharstring2 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } //seq of external function encode_rawSeqOfBool(in RawSeqOfBool pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSeqOfInt(in RawSeqOfInt pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSeqOfInt32(in RawSeqOfInt32 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSeqOfRawEnum(in RawSeqOfRawEnum pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSeqOfCharstring( in RawSeqOfCharstring pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSeqOfBitStr(in RawSeqOfBitStr pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSeqOfOctStr(in RawSeqOfOctStr pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSeqOfObjId(in RawSeqOfObjId pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSeqOfRawUnionBT(in RawSeqOfRawUnionBT pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSeqOfRawUnionBT32(in RawSeqOfRawUnionBT32 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSeqOfSeqSeqIntSeqInt2SeqCharstring2(in RawSeqOfSeqSeqIntSeqInt2SeqCharstring2 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSeqOfRawSeqIntSeqIntSeqInt2optoptSeqCharstring2(in RawSeqOfRawSeqIntSeqIntSeqInt2optoptSeqCharstring2 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } //set external function encode_rawSetEmpty(in RawSetEmpty pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSetBool(in RawSetBool pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSetInt(in RawSetInt pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSetInt8(in RawSetInt8 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSetRawEnum(in RawSetRawEnum pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSetInt2( in RawSetInt2 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSetInt2opt( in RawSetInt2opt pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSetInt2opt32( in RawSetInt2opt32 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSetIntSeqInt2( in RawSetIntSeqInt2 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSetIntSeqInt2T( in RawSetIntSeqInt2T pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSetIntSeqInt2opt( in RawSetIntSeqInt2opt pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSetIntSeqInt2Topt( in RawSetIntSeqInt2Topt pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSetIntSeqInt2optopt( in RawSetIntSeqInt2optopt pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSetIntSeqInt2Toptopt( in RawSetIntSeqInt2Toptopt pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSetInt3( in RawSetInt3 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSetInt3opt( in RawSetInt3opt pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSetInt4( in RawSetInt4 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSetInt4opt( in RawSetInt4opt pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSetOJKL( in RawSetOJKL pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSetIOKL( in RawSetIOKL pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSetCharstring(in RawSetCharstring pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSetStr(in RawSetStr pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSetBitStr(in RawSetBitStr pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSetOctStr(in RawSetOctStr pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSetIntCharstring( in RawSetIntCharstring pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSetIntStr( in RawSetIntStr pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSetIntBitStr( in RawSetIntBitStr pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSetISKL( in RawSetISKL pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSetISKLopt( in RawSetISKLopt pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSetIS2KLopt( in RawSetIS2KLopt pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSetISOKL( in RawSetISOKL pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSetISOKLopt( in RawSetISOKLopt pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSetIOSKL( in RawSetIOSKL pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSetIOSKLopt( in RawSetIOSKLopt pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSetIntSeqIntSeqInt2( in RawSetIntSeqIntSeqInt2 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSetIntSeqIntSeqInt2SeqCharstring2( in RawSetIntSeqIntSeqInt2SeqCharstring2 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSetIntSeqCharstring2( in RawSetIntSeqCharstring2 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSetSeqIntSeqInt2SeqCharstring2( in RawSetSeqIntSeqInt2SeqCharstring2 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSetIntSeqIntSeqInt2optoptSeqCharstring2( in RawSetIntSeqIntSeqInt2optoptSeqCharstring2 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSet_SeqSeqIntSeqInt2SeqCharstring2_SeqSeqIntSeqInt2SeqCharstring2( in RawSet_SeqSeqIntSeqInt2SeqCharstring2_SeqSeqIntSeqInt2SeqCharstring2 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSet_SeqSeqIntSeqInt2optoptSeqCharstring2_SeqSeqIntSeqInt2optoptSeqCharstring2( in RawSet_SeqSeqIntSeqInt2optoptSeqCharstring2_SeqSeqIntSeqInt2optoptSeqCharstring2 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } //set of external function encode_rawSetOfBool(in RawSetOfBool pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSetOfBoolBogus(in RawSetOfBoolBogus pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSetOfInt(in RawSetOfInt pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSetOfInt32(in RawSetOfInt32 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSetOfRawEnum(in RawSetOfRawEnum pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSetOfCharstring( in RawSetOfCharstring pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSetOfBitStr(in RawSetOfBitStr pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSetOfOctStr(in RawSetOfOctStr pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSetOfObjId(in RawSetOfObjId pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSetOfRawUnionBT(in RawSetOfRawUnionBT pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSetOfRawUnionBT32(in RawSetOfRawUnionBT32 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawSetOfSeqSeqIntSeqInt2SeqCharstring2(in RawSetOfSeqSeqIntSeqInt2SeqCharstring2 pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } //union external function encode_rawUnionBasicTypes( in RawUnionBasicTypes pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawUnionBasicTypesT( in RawUnionBasicTypesT pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } external function encode_rawUnionComplexTypes( in RawUnionComplexTypes pdu) return octetstring with { extension "prototype(convert) encode(RAW)" } //external function decode_rawUnionComplexTypes( in octetstring s) return RawUnionComplexTypes //with { extension "prototype(convert) decode(TEXT)" } modulepar { integer tsp_maxInt := 1000000; integer tsp_step := -10; } group Sequences{ template RawSeqInt2opt t_msi2opt := { i:= 1, j := 2 } template RawSeqInt2opt t_msi2optomit := { i:= 1, j := omit } const RawSeqInt2 c_msi2 := { i:= 1, j := 2 } const RawSeqInt2opt c_msi2opt := { i:= 1, j := 2 } const RawSeqInt2opt c_msi2optomit := { i:= 1, j := omit } template RawSeqEmpty t_seqEmpty :={} template RawSeqBool t_msb(template boolean p_b) := {b:= p_b} template RawSeqInt t_msi(template integer p_i) := {i:= p_i} template RawSeqInt8 t_msi8(template integer p_i) := {i:= p_i} template RawSeqInt2 t_msi2(template integer p_i, template integer p_j) := {i:= p_i, j:=p_j} template RawSeqInt28 t_msi28(template integer p_i, template integer p_j) := {i:= p_i, j:=p_j} //variable related values: //template RawSeqInt2 t_msi2_valueSeqIntOptFieldC(template integer p_i, template integer p_j):={i:=p_i, j:=p_j} with { erroneous (j) "value:=int32 : c_msi2opt.j" } ;//2 template RawSeqIntSeqInt2 t_msisi2_trial(template integer p_i, template integer p_j, template integer p_k) := { p_i, { p_j, p_k} } //not used yet template RawSeqIntSeqInt2 t_msisi2(template integer p_i, template integer p_j, template integer p_k) := { i:= p_i, jk:= { i:=p_j, j:=p_k} }; // template RawSeqInt3 t_msi3(template integer p_i, template integer p_j, template integer p_k) := {i:= p_i, j:=p_j, k:=p_k} template RawSeqInt4 t_msi4(template integer p_i, template integer p_j, template integer p_k,template integer p_l ) := {i:= p_i, j:=p_j, k:=p_k, l:=p_l} template RawSeqISKL t_msiskl(template integer p_i, template RawSeqInt4 p_s, template integer p_k,template integer p_l ) := {i:=p_i, s:=p_s, k:=p_k, l:=p_l} //===seq of seq of seq:== //Sequence of depth 3: //real (charstring) template RawSeqCharstring t_msr(template charstring p_x) := { x:=p_x } template RawSeqCharstring2 t_mr2(template charstring p_x, template charstring p_y):={x:=p_x, y:=p_y} //charstring->VisibleString template RawSeqStr t_msstr(template charstring p_s) := { s := p_s } //bitstring: template RawSeqBitStr t_msbitstr(template bitstring p_b) := { b := p_b }; template RawSeqOctStr t_msos(template octetstring p_o) := { o := p_o }; template RawSeqIntCharstring t_msir(template integer p_i, template charstring p_x ) := { i:=p_i, x:=p_x }; template RawSeqIntStr t_msistr(template integer p_i, template charstring p_s ) := { i:=p_i, s:=p_s }; template RawSeqIntBitStr t_msibitstr(template integer p_i, template bitstring p_b ) := { i:=p_i, b:=p_b }; //====set of related templates ======== //==== union related templates ======== // It caused Seg fault - earlier :) //template RawUnionBasicTypes t_mubt_boolean1( template boolean p_b) := { b:= p_b } with { erroneous(b) "value:=omit" } //================================================ //======== Testcases============================== //================================================ //======== {integer}=================== //omit template RawSeqInt t_msi_omit(template integer p_i) := {i:= p_i} with { erroneous (i) "value:= omit" } testcase tc_rawSeqIntOmit() runs on RawComp { for(var integer i:=1; iVisibleString template RawSetStr t_msetstr(template charstring p_s) := { s := p_s } //bitstring: template RawSetBitStr t_msetbitstr(template bitstring p_b) := { b := p_b }; template RawSetOctStr t_msetos(template octetstring p_o) := { o := p_o }; template RawSetIntCharstring t_msetir(template integer p_i, template charstring p_f ) := { i:=p_i, f:=p_f }; template RawSetIntStr t_msetistr(template integer p_i, template charstring p_s ) := { i:=p_i, s:=p_s }; template RawSetIntBitStr t_msetibitstr(template integer p_i, template bitstring p_b ) := { i:=p_i, b:=p_b }; //================================================ //======== Testcases============================== //================================================ //======== {integer}=================== //omit testcase tc_RawSetIntOmit() runs on RawComp { for(var integer i:=1; i