// This C++ source file was generated by the TTCN-3 compiler
// of the TTCN-3 Test Executor version 11.1.0
// The generation of user and time information were disabled by the -D flag.

// Copyright (c) 2000-2025 Ericsson Telecom AB

// Do not edit this file unless you know what you are doing.

/* Including header files */

#include "BTS_Tests.hh"

namespace BTS__Tests {

/* Literal string constants */

const unsigned char bs_2_bits[] = { 0 },
bs_5_bits[] = { 0 },
bs_7_bits[] = { 0 },
bs_0_bits[] = { 0 },
bs_15_bits[] = { 128 },
bs_4_bits[] = { 32, 0 },
bs_8_bits[] = { 4 },
bs_9_bits[] = { 2 },
bs_10_bits[] = { 6 },
bs_1_bits[] = { 1 },
bs_11_bits[] = { 1 },
bs_3_bits[] = { 9 },
bs_12_bits[] = { 5 },
bs_13_bits[] = { 3 },
bs_6_bits[] = { 255 };
extern const BITSTRING bs_14(0, NULL),
bs_2(1, bs_2_bits),
bs_5(2, bs_5_bits),
bs_7(3, bs_7_bits),
bs_0(8, bs_0_bits),
bs_15(8, bs_15_bits),
bs_4(16, bs_4_bits),
bs_8(3, bs_8_bits),
bs_9(3, bs_9_bits),
bs_10(3, bs_10_bits),
bs_1(1, bs_1_bits),
bs_11(3, bs_11_bits),
bs_3(4, bs_3_bits),
bs_12(3, bs_12_bits),
bs_13(3, bs_13_bits),
bs_6(8, bs_6_bits);
const unsigned char hs_1_nibbles[] = { 33, 67, 149, 137, 7 },
hs_2_nibbles[] = { 98, 2 },
hs_0_nibbles[] = { 98, 242, 36 },
hs_3_nibbles[] = { 36, 15 };
extern const HEXSTRING hs_1(9, hs_1_nibbles),
hs_2(3, hs_2_nibbles),
hs_0(6, hs_0_nibbles),
hs_3(3, hs_3_nibbles);
const unsigned char os_1_octets[] = { 0 },
os_16_octets[] = { 0, 0 },
os_0_octets[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
os_19_octets[] = { 0, 0, 220 },
os_15_octets[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22 },
os_20_octets[] = { 0, 35, 43, 43, 43, 43 },
os_14_octets[] = { 1, 1, 2, 3, 4, 5, 6, 7, 9, 9 },
os_11_octets[] = { 1, 2 },
os_17_octets[] = { 1, 2, 3, 4 },
os_3_octets[] = { 1, 3, 1 },
os_34_octets[] = { 1, 3, 73, 6, 21, 0, 64, 1, 192 },
os_10_octets[] = { 1, 6, 0, 144, 0, 24, 90, 111, 201, 224, 132, 16, 171, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43 },
os_8_octets[] = { 1, 6, 3, 191, 102, 176, 170, 10, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 43, 43, 43, 43 },
os_28_octets[] = { 1, 63, 1 },
os_29_octets[] = { 1, 63, 17, 35, 66, 8, 21 },
os_31_octets[] = { 3, 0, 13, 6, 53, 5 },
os_26_octets[] = { 3, 3, 1 },
os_33_octets[] = { 3, 224, 13, 6, 53, 5 },
os_30_octets[] = { 3, 225, 1 },
os_9_octets[] = { 5, 6, 7, 177, 0, 4, 134, 73, 130, 237, 219, 141, 85, 88, 103, 238, 60, 149, 84, 11, 43, 43, 43 },
os_32_octets[] = { 6, 53, 5 },
os_25_octets[] = { 10, 11, 12, 13 },
os_27_octets[] = { 15, 3, 1 },
os_23_octets[] = { 35 },
os_21_octets[] = { 35, 66 },
os_24_octets[] = { 35, 66, 8, 21 },
os_4_octets[] = { 43 },
os_18_octets[] = { 45, 6, 63, 48, 15, 195, 100 },
os_13_octets[] = { 73, 1, 34, 35, 36, 37, 38, 39, 41, 41, 170, 187, 204 },
os_22_octets[] = { 85 },
os_12_octets[] = { 85, 1, 17, 19, 42, 37, 43, 39, 204, 41, 170, 17, 187, 51, 204 },
os_7_octets[] = { 85, 6, 2, 191, 232, 9, 179, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 121, 0, 0, 43 },
os_6_octets[] = { 85, 6, 25, 143, 179, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 229, 4, 0, 43 },
os_37_octets[] = { 192 },
os_35_octets[] = { 208 },
os_36_octets[] = { 255 },
os_5_octets[] = { 255, 255, 255, 255 };
extern const OCTETSTRING os_2(0, NULL),
os_1(1, os_1_octets),
os_16(2, os_16_octets),
os_0(16, os_0_octets),
os_19(3, os_19_octets),
os_15(23, os_15_octets),
os_20(6, os_20_octets),
os_14(10, os_14_octets),
os_11(2, os_11_octets),
os_17(4, os_17_octets),
os_3(3, os_3_octets),
os_34(9, os_34_octets),
os_10(23, os_10_octets),
os_8(23, os_8_octets),
os_28(3, os_28_octets),
os_29(7, os_29_octets),
os_31(6, os_31_octets),
os_26(3, os_26_octets),
os_33(6, os_33_octets),
os_30(3, os_30_octets),
os_9(23, os_9_octets),
os_32(3, os_32_octets),
os_25(4, os_25_octets),
os_27(3, os_27_octets),
os_23(1, os_23_octets),
os_21(2, os_21_octets),
os_24(4, os_24_octets),
os_4(1, os_4_octets),
os_18(7, os_18_octets),
os_13(13, os_13_octets),
os_22(1, os_22_octets),
os_12(15, os_12_octets),
os_7(23, os_7_octets),
os_6(23, os_6_octets),
os_37(1, os_37_octets),
os_35(1, os_35_octets),
os_36(1, os_36_octets),
os_5(4, os_5_octets);
extern const CHARSTRING cs_9(0, NULL),
cs_79(3, " < "),
cs_72(8, " deleted"),
cs_149(12, " hysteresis "),
cs_71(11, " received, "),
cs_70(7, " sent, "),
cs_12(8, "() start"),
cs_77(2, ") "),
cs_76(21, ") far from expected ("),
cs_44(8, "-OsmuxEM"),
cs_3(4, "-RSL"),
cs_2(8, "-RSL-IPA"),
cs_41(6, "-RTPEM"),
cs_88(7, "0.0.0.0"),
cs_97(17, "00101000000000123"),
cs_1(9, "127.0.0.1"),
cs_0(9, "127.0.0.2"),
cs_109(15, "127.127.127.127"),
cs_87(11, "192.168.1.1"),
cs_73(11, "AGCH test: "),
cs_24(31, "BCCH is not a dedicated channel"),
cs_50(78, "BS power control should not be active unless we receive a power parameters IE!"),
cs_58(33, "BTS 0 is of*type* in band (\\w+),*"),
cs_136(49, "BTS shouldn't be able to decrypt after key change"),
cs_4(14, "BTS_Tests.ttcn"),
cs_80(28, "Cannot have SI13alt and SI13"),
cs_81(31, "Cannot have SI16/SI17 and SI22!"),
cs_82(51, "Cannot have SI21 on BCCH Norm if BCCH Extd enabled!"),
cs_11(86, "Could not connect to the control (TRXC) interface of FakeTRX, check your configuration"),
cs_54(7, "DCS1800"),
cs_39(42, "Didn't receive expected measurement result"),
cs_78(33, "Error: Insufficient SI in array: "),
cs_129(28, "Failing due to RSL_ERROR_IND"),
cs_53(6, "GSM\?\?\?"),
cs_144(5, "I/0/0"),
cs_145(5, "I/7/0"),
cs_42(12, "IPA CRCX ACK"),
cs_86(13, "IPA CRCX NACK"),
cs_85(12, "IPA DLCX ACK"),
cs_43(12, "IPA MDCX ACK"),
cs_8(39, "Invalid PCU Version/BTS Number received"),
cs_134(16, "MODE MODIFY NACK"),
cs_14(6, "Mapped"),
cs_66(25, "No CONN FAIL IND received"),
cs_45(27, "No MEAS RES received at all"),
cs_7(7, "OsmoBSC"),
cs_25(35, "PCH/AGCH is not a dedicated channel"),
cs_55(7, "PCS1900"),
cs_89(31, "PCU RTS.req before PDCH active\?"),
cs_49(55, "Power Level in L1 header has not decreased sufficiently"),
cs_48(55, "Power Level in L1 header has not increased sufficiently"),
cs_51(55, "Power level in L1 header != signaled (RSL) power level."),
cs_23(30, "RACH doesn't exist on timeslot"),
cs_22(31, "RACH is not a dedicated channel"),
cs_18(11, "RF CHAN REL"),
cs_17(12, "RSL CHAN ACT"),
cs_121(17, "RSL CHAN ACT NACK"),
cs_124(14, "RSL CHAN ACT ["),
cs_123(16, "RSL CHAN ACT [0]"),
cs_122(16, "RSL CHAN ACT [1]"),
cs_91(24, "RTS.req for wrong TRX/TS"),
cs_74(20, "RX + DEL != TX \?!\?: "),
cs_75(10, "RX ratio ("),
cs_32(36, "Received SACCH when not expecting it"),
cs_93(31, "Received unexpected PCU RTS.req"),
cs_16(30, "Rx unexpected RSL port message"),
cs_104(16, "TC_pcu_oml_alert"),
cs_106(23, "TC_pcu_socket_reconnect"),
cs_28(18, "TS0 cannot be PDCH"),
cs_29(21, "TS0 cannot be SDCCH/8"),
cs_26(19, "TS0 cannot be TCH/F"),
cs_27(19, "TS0 cannot be TCH/H"),
cs_31(19, "TS1 cannot be TCH/H"),
cs_30(21, "TS7 cannot be SDCCH/4"),
cs_13(14, "Tguard timeout"),
cs_15(18, "Timeout expecting "),
cs_20(33, "Timeout expecting RF_CHAN_REL_ACK"),
cs_133(28, "Timeout waiting for DATA_IND"),
cs_127(27, "Timeout waiting for EST IND"),
cs_146(40, "Timeout waiting for L2 fill frames on Um"),
cs_135(38, "Timeout waiting for MODE MODIFY (N)ACK"),
cs_103(30, "Timeout waiting for PAGING REQ"),
cs_10(32, "Timeout waiting for PCU INFO_IND"),
cs_92(31, "Timeout waiting for PCU RTS.req"),
cs_96(51, "Timeout waiting for PCU-originated AGCH block on Um"),
cs_98(50, "Timeout waiting for PCU-originated PCH block on Um"),
cs_101(34, "Timeout waiting for PCUIF_DATA.ind"),
cs_100(28, "Timeout waiting for RACH IND"),
cs_137(42, "Timeout waiting for RF RESource INDication"),
cs_130(31, "Timeout waiting for RLL EST IND"),
cs_84(31, "Timeout waiting for RSL ERR REP"),
cs_5(32, "Timeout waiting for RSL bring up"),
cs_95(27, "Timeout waiting for RTS.ind"),
cs_128(24, "Timeout waiting for SABM"),
cs_94(22, "Timeout waiting for SI"),
cs_132(33, "Timeout waiting for UNIT_DATA_IND"),
cs_52(39, "Timeout waiting for initial power level"),
cs_33(22, "Two RACH in same FN\?!\?"),
cs_21(23, "Unexpected CHAN ACT ACK"),
cs_19(44, "Unexpected CHAN ACT ACK on double activation"),
cs_34(19, "Unexpected CHAN RQD"),
cs_102(21, "Unexpected PAGING REQ"),
cs_69(23, "Unexpected PCH Overload"),
cs_126(23, "Unexpected PDCH ACT ACK"),
cs_99(19, "Unexpected RACH IND"),
cs_131(23, "Unexpected RSL message!"),
cs_90(52, "Unexpected RTS.req for supposedly failing activation"),
cs_107(17, "Unhandled SI type"),
cs_40(20, "Unknown Algorithm ID"),
cs_56(18, "Unsupported band: "),
cs_83(26, "Wrong cause in RSL ERR REP"),
cs_125(']'),
cs_67(40, "bs_ag_blks_res out of valid range (0..7)"),
cs_35(4, "bts "),
cs_63(5, "bts 0"),
cs_105(24, "bts.0.oml_failure_report"),
cs_37(31, "ccch load-indication-threshold "),
cs_38(25, "drop bts connection 0 oml"),
cs_6(6, "enable"),
cs_111(14, "fd00::ca:ff:ee"),
cs_113(31, "gprs nsvc 0 local udp port 1234"),
cs_112(22, "gprs nsvc 0 nsvci 1234"),
cs_108(37, "gprs nsvc 0 remote ip 127.127.127.127"),
cs_110(36, "gprs nsvc 0 remote ip fd00::ca:ff:ee"),
cs_114(32, "gprs nsvc 0 remote udp port 1234"),
cs_116(31, "gprs nsvc 1 local udp port 5678"),
cs_115(22, "gprs nsvc 1 nsvci 5678"),
cs_117(36, "gprs nsvc 1 remote ip fd00::ca:ff:ee"),
cs_118(32, "gprs nsvc 1 remote udp port 5678"),
cs_119(30, "interference-meas avg-period 1"),
cs_120(30, "interference-meas avg-period 6"),
cs_36(7, "network"),
cs_61(24, "no osmotrx ms-power-loop"),
cs_65(24, "no supp-meas-info toa256"),
cs_62(25, "osmotrx ms-power-loop -10"),
cs_60(26, "osmotrx ms-power-loop -100"),
cs_59(5, "phy 0"),
cs_68(23, "received paging on AGCH"),
cs_47(11, "rf_locked 0"),
cs_46(11, "rf_locked 1"),
cs_143(7, "rr_s0_7"),
cs_141(13, "sabm_s0_empty"),
cs_142(10, "sabm_s0_l3"),
cs_57(10, "show bts 0"),
cs_64(21, "supp-meas-info toa256"),
cs_139(11, "ui_s0_empty"),
cs_140(11, "ui_s3_empty"),
cs_138(22, "unsupported frame type"),
cs_148(40, "uplink-power-filtering algo ewma beta 80"),
cs_147(20, "uplink-power-target ");
const unsigned char module_checksum[] = { 0x8f, 0x01, 0xd7, 0x0c, 0x8f, 0x94, 0xf8, 0x62, 0x99, 0xc5, 0xe1, 0xd2, 0x48, 0xdc, 0xd8, 0x80 };

/* Global variable definitions */

CHARSTRING modulepar_mp__rsl__ip;
const CHARSTRING& mp__rsl__ip = modulepar_mp__rsl__ip;
INTEGER modulepar_mp__rsl__port;
const INTEGER& mp__rsl__port = modulepar_mp__rsl__port;
CHARSTRING modulepar_mp__bts__trxc__ip;
const CHARSTRING& mp__bts__trxc__ip = modulepar_mp__bts__trxc__ip;
INTEGER modulepar_mp__bts__trxc__port;
const INTEGER& mp__bts__trxc__port = modulepar_mp__bts__trxc__port;
CHARSTRING modulepar_mp__pcu__socket;
const CHARSTRING& mp__pcu__socket = modulepar_mp__pcu__socket;
CHARSTRING modulepar_mp__ctrl__ip;
const CHARSTRING& mp__ctrl__ip = modulepar_mp__ctrl__ip;
INTEGER modulepar_mp__ctrl__port;
const INTEGER& mp__ctrl__port = modulepar_mp__ctrl__port;
CHARSTRING modulepar_mp__bsc__ctrl__ip;
const CHARSTRING& mp__bsc__ctrl__ip = modulepar_mp__bsc__ctrl__ip;
INTEGER modulepar_mp__bsc__ctrl__port;
const INTEGER& mp__bsc__ctrl__port = modulepar_mp__bsc__ctrl__port;
CHARSTRING modulepar_mp__rtpem__bind__ip;
const CHARSTRING& mp__rtpem__bind__ip = modulepar_mp__rtpem__bind__ip;
INTEGER modulepar_mp__rtpem__bind__port;
const INTEGER& mp__rtpem__bind__port = modulepar_mp__rtpem__bind__port;
CHARSTRING modulepar_mp__osmuxem__bind__ip;
const CHARSTRING& mp__osmuxem__bind__ip = modulepar_mp__osmuxem__bind__ip;
INTEGER modulepar_mp__osmuxem__bind__port;
const INTEGER& mp__osmuxem__bind__port = modulepar_mp__osmuxem__bind__port;
INTEGER modulepar_mp__tolerance__rxqual;
const INTEGER& mp__tolerance__rxqual = modulepar_mp__tolerance__rxqual;
INTEGER modulepar_mp__tolerance__rxlev;
const INTEGER& mp__tolerance__rxlev = modulepar_mp__tolerance__rxlev;
INTEGER modulepar_mp__tolerance__timing__offset__256syms;
const INTEGER& mp__tolerance__timing__offset__256syms = modulepar_mp__tolerance__timing__offset__256syms;
INTEGER modulepar_mp__rxlev__exp;
const INTEGER& mp__rxlev__exp = modulepar_mp__rxlev__exp;
INTEGER modulepar_mp__ul__rxlev__exp;
const INTEGER& mp__ul__rxlev__exp = modulepar_mp__ul__rxlev__exp;
INTEGER modulepar_mp__ms__power__level__exp;
const INTEGER& mp__ms__power__level__exp = modulepar_mp__ms__power__level__exp;
INTEGER modulepar_mp__bts__tx__nom__pwr__exp;
const INTEGER& mp__bts__tx__nom__pwr__exp = modulepar_mp__bts__tx__nom__pwr__exp;
INTEGER modulepar_mp__bts__tx__pwr__att__exp;
const INTEGER& mp__bts__tx__pwr__att__exp = modulepar_mp__bts__tx__pwr__att__exp;
INTEGER modulepar_mp__ms__actual__ta__exp;
const INTEGER& mp__ms__actual__ta__exp = modulepar_mp__ms__actual__ta__exp;
INTEGER modulepar_mp__timing__offset__256syms__exp;
const INTEGER& mp__timing__offset__256syms__exp = modulepar_mp__timing__offset__256syms__exp;
INTEGER modulepar_mp__uplink__power__target;
const INTEGER& mp__uplink__power__target = modulepar_mp__uplink__power__target;
INTEGER modulepar_mp__uplink__power__hysteresis;
const INTEGER& mp__uplink__power__hysteresis = modulepar_mp__uplink__power__hysteresis;
FLOAT modulepar_mp__ipa__up__timeout;
const FLOAT& mp__ipa__up__timeout = modulepar_mp__ipa__up__timeout;
FLOAT modulepar_mp__ipa__up__delay;
const FLOAT& mp__ipa__up__delay = modulepar_mp__ipa__up__delay;
BOOLEAN modulepar_mp__l1__supports__gprs;
const BOOLEAN& mp__l1__supports__gprs = modulepar_mp__l1__supports__gprs;
INTEGER modulepar_mp__transceiver__num;
const INTEGER& mp__transceiver__num = modulepar_mp__transceiver__num;
BOOLEAN modulepar_mp__freq__hop__enabled;
const BOOLEAN& mp__freq__hop__enabled = modulepar_mp__freq__hop__enabled;
// No XER for FreqHopConfig
const TTCN_Typedescriptor_t FreqHopConfig_descr_ = { "@BTS_Tests.FreqHopConfig", NULL, NULL, NULL, NULL, NULL, NULL, NULL, &FreqHopGroups_descr_, TTCN_Typedescriptor_t::DONTCARE };
// No XER for FreqHopGroups
const TTCN_Typedescriptor_t FreqHopGroups_descr_ = { "@BTS_Tests.FreqHopGroups", NULL, NULL, NULL, NULL, NULL, NULL, NULL, &FreqHopGroup_descr_, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       FreqHopGroup_hsn_xer_ = { {"hsn>\n", "hsn>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t FreqHopGroup_hsn_descr_ = { "@BTS_Tests.FreqHopGroup.hsn", &INTEGER_ber_, &Osmocom__Types::uint6__t_raw_, &INTEGER_text_, &FreqHopGroup_hsn_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING FreqHopGroup_hsn_default_coding("RAW");
// No XER for FreqHopGroupItems
const TTCN_Typedescriptor_t FreqHopGroupItems_descr_ = { "@BTS_Tests.FreqHopGroupItems", NULL, NULL, NULL, NULL, NULL, NULL, NULL, &FreqHopGroupItem_descr_, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       FreqHopGroupItem_trx__nr_xer_ = { {"trx_nr>\n", "trx_nr>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t FreqHopGroupItem_trx__nr_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t FreqHopGroupItem_trx__nr_descr_ = { "@BTS_Tests.FreqHopGroupItem.trx_nr", &INTEGER_ber_, &Osmocom__Types::uint8__t_raw_, &INTEGER_text_, &FreqHopGroupItem_trx__nr_xer_, &INTEGER_json_, &FreqHopGroupItem_trx__nr_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING FreqHopGroupItem_trx__nr_default_coding("RAW");
const XERdescriptor_t       FreqHopGroupItem_maio_xer_ = { {"maio>\n", "maio>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t FreqHopGroupItem_maio_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t FreqHopGroupItem_maio_descr_ = { "@BTS_Tests.FreqHopGroupItem.maio", &INTEGER_ber_, &Osmocom__Types::uint6__t_raw_, &INTEGER_text_, &FreqHopGroupItem_maio_xer_, &INTEGER_json_, &FreqHopGroupItem_maio_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING FreqHopGroupItem_maio_default_coding("RAW");
// No XER for FreqHopGroupItem
const TTCN_Typedescriptor_t FreqHopGroupItem_descr_ = { "@BTS_Tests.FreqHopGroupItem", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for FreqHopGroup
const TTCN_Typedescriptor_t FreqHopGroup_descr_ = { "@BTS_Tests.FreqHopGroup", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
FreqHopConfig modulepar_mp__fh__config;
const FreqHopConfig& mp__fh__config = modulepar_mp__fh__config;
// No XER for TrxPars
const TTCN_Typedescriptor_t TrxPars_descr_ = { "@BTS_Tests.TrxPars", NULL, NULL, NULL, NULL, NULL, NULL, NULL, &TrxParsItem_descr_, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       TrxParsItem_arfcn_xer_ = { {"arfcn>\n", "arfcn>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t TrxParsItem_arfcn_descr_ = { "@BTS_Tests.TrxParsItem.arfcn", &INTEGER_ber_, &GSM__Types::GsmArfcn_raw_, &INTEGER_text_, &TrxParsItem_arfcn_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TrxParsItem_arfcn_default_coding("RAW");
// No XER for TrxTsPars
const TTCN_Typedescriptor_t TrxTsPars_descr_ = { "@BTS_Tests.TrxTsPars", NULL, NULL, NULL, NULL, NULL, NULL, NULL, &TrxTsParsItem_descr_, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TrxTsParsItem_config_default_coding("RAW");
// No XER for TrxTsParsItem
const TTCN_Typedescriptor_t TrxTsParsItem_descr_ = { "@BTS_Tests.TrxTsParsItem", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for TrxParsItem
const TTCN_Typedescriptor_t TrxParsItem_descr_ = { "@BTS_Tests.TrxParsItem", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
TrxPars modulepar_mp__trx__pars;
const TrxPars& mp__trx__pars = modulepar_mp__trx__pars;
INTEGER modulepar_mp__tsc__def;
const INTEGER& mp__tsc__def = modulepar_mp__tsc__def;
INTEGER modulepar_mp__interf__band;
const INTEGER& mp__interf__band = modulepar_mp__interf__band;
INTEGER modulepar_mp__ho__t3105__ms;
const INTEGER& mp__ho__t3105__ms = modulepar_mp__ho__t3105__ms;
INTEGER modulepar_mp__ho__ny1;
const INTEGER& mp__ho__ny1 = modulepar_mp__ho__ny1;
// No XER for ChannelNrs
const TTCN_Typedescriptor_t ChannelNrs_descr_ = { "@BTS_Tests.ChannelNrs", NULL, NULL, NULL, NULL, NULL, NULL, NULL, &GSM__Types::RslChannelNr_descr_, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ChannelNrs_0_default_coding("RAW");
const TTCN_Typedescriptor_t& test__CT_descr_ = COMPONENT_descr_;
COMPONENT test__CT_component_vc__IPA;
COMPONENT test__CT_component_vc__RSL;
RSL__Emulation::RSL__CCHAN__PT test__CT_component_RSL__CCHAN("RSL_CCHAN");
L1CTL__PortType::L1CTL__PT test__CT_component_L1CTL("L1CTL");
TRXC__CodecPort::TRXC__CODEC__PT test__CT_component_BTS__TRXC("BTS_TRXC");
INTEGER test__CT_component_g__bts__trxc__conn__id;
TELNETasp__PortType::TELNETasp__PT test__CT_component_BTSVTY("BTSVTY");
TELNETasp__PortType::TELNETasp__PT test__CT_component_BSCVTY("BSCVTY");
PCUIF__CodecPort::PCUIF__CODEC__PT test__CT_component_PCU("PCU");
INTEGER test__CT_component_g__pcu__conn__id;
PCUIF__Types::PCUIF__Message test__CT_component_g__pcu__last__info;
const XERdescriptor_t       SystemInformationConfig_bcch__extended_xer_ = { {"bcch_extended>\n", "bcch_extended>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SystemInformationConfig_bcch__extended_oer_ext_arr_[0] = {};
const int SystemInformationConfig_bcch__extended_oer_p_[0] = {};
const TTCN_OERdescriptor_t SystemInformationConfig_bcch__extended_oer_ = { -1, TRUE, -1, FALSE, 0, 0, SystemInformationConfig_bcch__extended_oer_ext_arr_, 0, SystemInformationConfig_bcch__extended_oer_p_};
const TTCN_Typedescriptor_t SystemInformationConfig_bcch__extended_descr_ = { "@BTS_Tests.SystemInformationConfig.bcch_extended", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &SystemInformationConfig_bcch__extended_xer_, &BOOLEAN_json_, &SystemInformationConfig_bcch__extended_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       SystemInformationConfig_si1__present_xer_ = { {"si1_present>\n", "si1_present>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SystemInformationConfig_si1__present_oer_ext_arr_[0] = {};
const int SystemInformationConfig_si1__present_oer_p_[0] = {};
const TTCN_OERdescriptor_t SystemInformationConfig_si1__present_oer_ = { -1, TRUE, -1, FALSE, 0, 0, SystemInformationConfig_si1__present_oer_ext_arr_, 0, SystemInformationConfig_si1__present_oer_p_};
const TTCN_Typedescriptor_t SystemInformationConfig_si1__present_descr_ = { "@BTS_Tests.SystemInformationConfig.si1_present", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &SystemInformationConfig_si1__present_xer_, &BOOLEAN_json_, &SystemInformationConfig_si1__present_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       SystemInformationConfig_si2bis__present_xer_ = { {"si2bis_present>\n", "si2bis_present>\n"}, {16, 16}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SystemInformationConfig_si2bis__present_oer_ext_arr_[0] = {};
const int SystemInformationConfig_si2bis__present_oer_p_[0] = {};
const TTCN_OERdescriptor_t SystemInformationConfig_si2bis__present_oer_ = { -1, TRUE, -1, FALSE, 0, 0, SystemInformationConfig_si2bis__present_oer_ext_arr_, 0, SystemInformationConfig_si2bis__present_oer_p_};
const TTCN_Typedescriptor_t SystemInformationConfig_si2bis__present_descr_ = { "@BTS_Tests.SystemInformationConfig.si2bis_present", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &SystemInformationConfig_si2bis__present_xer_, &BOOLEAN_json_, &SystemInformationConfig_si2bis__present_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       SystemInformationConfig_si2ter__present_xer_ = { {"si2ter_present>\n", "si2ter_present>\n"}, {16, 16}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SystemInformationConfig_si2ter__present_oer_ext_arr_[0] = {};
const int SystemInformationConfig_si2ter__present_oer_p_[0] = {};
const TTCN_OERdescriptor_t SystemInformationConfig_si2ter__present_oer_ = { -1, TRUE, -1, FALSE, 0, 0, SystemInformationConfig_si2ter__present_oer_ext_arr_, 0, SystemInformationConfig_si2ter__present_oer_p_};
const TTCN_Typedescriptor_t SystemInformationConfig_si2ter__present_descr_ = { "@BTS_Tests.SystemInformationConfig.si2ter_present", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &SystemInformationConfig_si2ter__present_xer_, &BOOLEAN_json_, &SystemInformationConfig_si2ter__present_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       SystemInformationConfig_si2quater__present_xer_ = { {"si2quater_present>\n", "si2quater_present>\n"}, {19, 19}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SystemInformationConfig_si2quater__present_oer_ext_arr_[0] = {};
const int SystemInformationConfig_si2quater__present_oer_p_[0] = {};
const TTCN_OERdescriptor_t SystemInformationConfig_si2quater__present_oer_ = { -1, TRUE, -1, FALSE, 0, 0, SystemInformationConfig_si2quater__present_oer_ext_arr_, 0, SystemInformationConfig_si2quater__present_oer_p_};
const TTCN_Typedescriptor_t SystemInformationConfig_si2quater__present_descr_ = { "@BTS_Tests.SystemInformationConfig.si2quater_present", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &SystemInformationConfig_si2quater__present_xer_, &BOOLEAN_json_, &SystemInformationConfig_si2quater__present_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       SystemInformationConfig_si7__present_xer_ = { {"si7_present>\n", "si7_present>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SystemInformationConfig_si7__present_oer_ext_arr_[0] = {};
const int SystemInformationConfig_si7__present_oer_p_[0] = {};
const TTCN_OERdescriptor_t SystemInformationConfig_si7__present_oer_ = { -1, TRUE, -1, FALSE, 0, 0, SystemInformationConfig_si7__present_oer_ext_arr_, 0, SystemInformationConfig_si7__present_oer_p_};
const TTCN_Typedescriptor_t SystemInformationConfig_si7__present_descr_ = { "@BTS_Tests.SystemInformationConfig.si7_present", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &SystemInformationConfig_si7__present_xer_, &BOOLEAN_json_, &SystemInformationConfig_si7__present_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       SystemInformationConfig_si8__present_xer_ = { {"si8_present>\n", "si8_present>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SystemInformationConfig_si8__present_oer_ext_arr_[0] = {};
const int SystemInformationConfig_si8__present_oer_p_[0] = {};
const TTCN_OERdescriptor_t SystemInformationConfig_si8__present_oer_ = { -1, TRUE, -1, FALSE, 0, 0, SystemInformationConfig_si8__present_oer_ext_arr_, 0, SystemInformationConfig_si8__present_oer_p_};
const TTCN_Typedescriptor_t SystemInformationConfig_si8__present_descr_ = { "@BTS_Tests.SystemInformationConfig.si8_present", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &SystemInformationConfig_si8__present_xer_, &BOOLEAN_json_, &SystemInformationConfig_si8__present_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       SystemInformationConfig_si9__present_xer_ = { {"si9_present>\n", "si9_present>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SystemInformationConfig_si9__present_oer_ext_arr_[0] = {};
const int SystemInformationConfig_si9__present_oer_p_[0] = {};
const TTCN_OERdescriptor_t SystemInformationConfig_si9__present_oer_ = { -1, TRUE, -1, FALSE, 0, 0, SystemInformationConfig_si9__present_oer_ext_arr_, 0, SystemInformationConfig_si9__present_oer_p_};
const TTCN_Typedescriptor_t SystemInformationConfig_si9__present_descr_ = { "@BTS_Tests.SystemInformationConfig.si9_present", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &SystemInformationConfig_si9__present_xer_, &BOOLEAN_json_, &SystemInformationConfig_si9__present_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       SystemInformationConfig_si13__present_xer_ = { {"si13_present>\n", "si13_present>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SystemInformationConfig_si13__present_oer_ext_arr_[0] = {};
const int SystemInformationConfig_si13__present_oer_p_[0] = {};
const TTCN_OERdescriptor_t SystemInformationConfig_si13__present_oer_ = { -1, TRUE, -1, FALSE, 0, 0, SystemInformationConfig_si13__present_oer_ext_arr_, 0, SystemInformationConfig_si13__present_oer_p_};
const TTCN_Typedescriptor_t SystemInformationConfig_si13__present_descr_ = { "@BTS_Tests.SystemInformationConfig.si13_present", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &SystemInformationConfig_si13__present_xer_, &BOOLEAN_json_, &SystemInformationConfig_si13__present_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       SystemInformationConfig_si13alt__present_xer_ = { {"si13alt_present>\n", "si13alt_present>\n"}, {17, 17}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SystemInformationConfig_si13alt__present_oer_ext_arr_[0] = {};
const int SystemInformationConfig_si13alt__present_oer_p_[0] = {};
const TTCN_OERdescriptor_t SystemInformationConfig_si13alt__present_oer_ = { -1, TRUE, -1, FALSE, 0, 0, SystemInformationConfig_si13alt__present_oer_ext_arr_, 0, SystemInformationConfig_si13alt__present_oer_p_};
const TTCN_Typedescriptor_t SystemInformationConfig_si13alt__present_descr_ = { "@BTS_Tests.SystemInformationConfig.si13alt_present", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &SystemInformationConfig_si13alt__present_xer_, &BOOLEAN_json_, &SystemInformationConfig_si13alt__present_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       SystemInformationConfig_si15__present_xer_ = { {"si15_present>\n", "si15_present>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SystemInformationConfig_si15__present_oer_ext_arr_[0] = {};
const int SystemInformationConfig_si15__present_oer_p_[0] = {};
const TTCN_OERdescriptor_t SystemInformationConfig_si15__present_oer_ = { -1, TRUE, -1, FALSE, 0, 0, SystemInformationConfig_si15__present_oer_ext_arr_, 0, SystemInformationConfig_si15__present_oer_p_};
const TTCN_Typedescriptor_t SystemInformationConfig_si15__present_descr_ = { "@BTS_Tests.SystemInformationConfig.si15_present", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &SystemInformationConfig_si15__present_xer_, &BOOLEAN_json_, &SystemInformationConfig_si15__present_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       SystemInformationConfig_si16__present_xer_ = { {"si16_present>\n", "si16_present>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SystemInformationConfig_si16__present_oer_ext_arr_[0] = {};
const int SystemInformationConfig_si16__present_oer_p_[0] = {};
const TTCN_OERdescriptor_t SystemInformationConfig_si16__present_oer_ = { -1, TRUE, -1, FALSE, 0, 0, SystemInformationConfig_si16__present_oer_ext_arr_, 0, SystemInformationConfig_si16__present_oer_p_};
const TTCN_Typedescriptor_t SystemInformationConfig_si16__present_descr_ = { "@BTS_Tests.SystemInformationConfig.si16_present", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &SystemInformationConfig_si16__present_xer_, &BOOLEAN_json_, &SystemInformationConfig_si16__present_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       SystemInformationConfig_si17__present_xer_ = { {"si17_present>\n", "si17_present>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SystemInformationConfig_si17__present_oer_ext_arr_[0] = {};
const int SystemInformationConfig_si17__present_oer_p_[0] = {};
const TTCN_OERdescriptor_t SystemInformationConfig_si17__present_oer_ = { -1, TRUE, -1, FALSE, 0, 0, SystemInformationConfig_si17__present_oer_ext_arr_, 0, SystemInformationConfig_si17__present_oer_p_};
const TTCN_Typedescriptor_t SystemInformationConfig_si17__present_descr_ = { "@BTS_Tests.SystemInformationConfig.si17_present", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &SystemInformationConfig_si17__present_xer_, &BOOLEAN_json_, &SystemInformationConfig_si17__present_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       SystemInformationConfig_si2n__present_xer_ = { {"si2n_present>\n", "si2n_present>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SystemInformationConfig_si2n__present_oer_ext_arr_[0] = {};
const int SystemInformationConfig_si2n__present_oer_p_[0] = {};
const TTCN_OERdescriptor_t SystemInformationConfig_si2n__present_oer_ = { -1, TRUE, -1, FALSE, 0, 0, SystemInformationConfig_si2n__present_oer_ext_arr_, 0, SystemInformationConfig_si2n__present_oer_p_};
const TTCN_Typedescriptor_t SystemInformationConfig_si2n__present_descr_ = { "@BTS_Tests.SystemInformationConfig.si2n_present", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &SystemInformationConfig_si2n__present_xer_, &BOOLEAN_json_, &SystemInformationConfig_si2n__present_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       SystemInformationConfig_si21__present_xer_ = { {"si21_present>\n", "si21_present>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SystemInformationConfig_si21__present_oer_ext_arr_[0] = {};
const int SystemInformationConfig_si21__present_oer_p_[0] = {};
const TTCN_OERdescriptor_t SystemInformationConfig_si21__present_oer_ = { -1, TRUE, -1, FALSE, 0, 0, SystemInformationConfig_si21__present_oer_ext_arr_, 0, SystemInformationConfig_si21__present_oer_p_};
const TTCN_Typedescriptor_t SystemInformationConfig_si21__present_descr_ = { "@BTS_Tests.SystemInformationConfig.si21_present", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &SystemInformationConfig_si21__present_xer_, &BOOLEAN_json_, &SystemInformationConfig_si21__present_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       SystemInformationConfig_si22__present_xer_ = { {"si22_present>\n", "si22_present>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int SystemInformationConfig_si22__present_oer_ext_arr_[0] = {};
const int SystemInformationConfig_si22__present_oer_p_[0] = {};
const TTCN_OERdescriptor_t SystemInformationConfig_si22__present_oer_ = { -1, TRUE, -1, FALSE, 0, 0, SystemInformationConfig_si22__present_oer_ext_arr_, 0, SystemInformationConfig_si22__present_oer_p_};
const TTCN_Typedescriptor_t SystemInformationConfig_si22__present_descr_ = { "@BTS_Tests.SystemInformationConfig.si22_present", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &SystemInformationConfig_si22__present_xer_, &BOOLEAN_json_, &SystemInformationConfig_si22__present_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for SystemInformationConfig
const TTCN_Typedescriptor_t SystemInformationConfig_descr_ = { "@BTS_Tests.SystemInformationConfig", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
SystemInformationConfig test__CT_component_si__cfg;
ChannelNrs test__CT_component_g__AllChannels;
ChannelNrs test__CT_component_g__AllChanTypes;
const TTCN_Typedescriptor_t& ConnHdlr_descr_ = COMPONENT_descr_;
L1CTL__PortType::L1CTL__PT ConnHdlr_component_L1CTL("L1CTL");
TRXC__CodecPort::TRXC__CODEC__PT ConnHdlr_component_BTS__TRXC("BTS_TRXC");
INTEGER ConnHdlr_component_g__bts__trxc__conn__id;
TELNETasp__PortType::TELNETasp__PT ConnHdlr_component_BSCVTY("BSCVTY");
TIMER ConnHdlr_component_g__Tguard("g_Tguard");
TIMER ConnHdlr_component_g__Tmeas__exp("g_Tmeas_exp", 2.0);
const XERdescriptor_t       ConnHdlrPars_trx__nr_xer_ = { {"trx_nr>\n", "trx_nr>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t ConnHdlrPars_trx__nr_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t ConnHdlrPars_trx__nr_descr_ = { "@BTS_Tests.ConnHdlrPars.trx_nr", &INTEGER_ber_, &Osmocom__Types::uint8__t_raw_, &INTEGER_text_, &ConnHdlrPars_trx__nr_xer_, &INTEGER_json_, &ConnHdlrPars_trx__nr_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ConnHdlrPars_trx__nr_default_coding("RAW");
UNIVERSAL_CHARSTRING ConnHdlrPars_chan__nr_default_coding("RAW");
UNIVERSAL_CHARSTRING ConnHdlrPars_chan__mode_default_coding("RAW");
const XERdescriptor_t       ConnHdlrPars_t__guard_xer_ = { {"t_guard>\n", "t_guard>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int ConnHdlrPars_t__guard_oer_ext_arr_[0] = {};
const int ConnHdlrPars_t__guard_oer_p_[0] = {};
const TTCN_OERdescriptor_t ConnHdlrPars_t__guard_oer_ = { -1, TRUE, -1, FALSE, 0, 0, ConnHdlrPars_t__guard_oer_ext_arr_, 0, ConnHdlrPars_t__guard_oer_p_};
const TTCN_Typedescriptor_t ConnHdlrPars_t__guard_descr_ = { "@BTS_Tests.ConnHdlrPars.t_guard", &FLOAT_ber_, &FLOAT_raw_, NULL, &ConnHdlrPars_t__guard_xer_, &FLOAT_json_, &ConnHdlrPars_t__guard_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       ConnL1Pars_dtx__enabled_xer_ = { {"dtx_enabled>\n", "dtx_enabled>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int ConnL1Pars_dtx__enabled_oer_ext_arr_[0] = {};
const int ConnL1Pars_dtx__enabled_oer_p_[0] = {};
const TTCN_OERdescriptor_t ConnL1Pars_dtx__enabled_oer_ = { -1, TRUE, -1, FALSE, 0, 0, ConnL1Pars_dtx__enabled_oer_ext_arr_, 0, ConnL1Pars_dtx__enabled_oer_p_};
const TTCN_Typedescriptor_t ConnL1Pars_dtx__enabled_descr_ = { "@BTS_Tests.ConnL1Pars.dtx_enabled", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &ConnL1Pars_dtx__enabled_xer_, &BOOLEAN_json_, &ConnL1Pars_dtx__enabled_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       ConnL1Pars_toa256__enabled_xer_ = { {"toa256_enabled>\n", "toa256_enabled>\n"}, {16, 16}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int ConnL1Pars_toa256__enabled_oer_ext_arr_[0] = {};
const int ConnL1Pars_toa256__enabled_oer_p_[0] = {};
const TTCN_OERdescriptor_t ConnL1Pars_toa256__enabled_oer_ = { -1, TRUE, -1, FALSE, 0, 0, ConnL1Pars_toa256__enabled_oer_ext_arr_, 0, ConnL1Pars_toa256__enabled_oer_p_};
const TTCN_Typedescriptor_t ConnL1Pars_toa256__enabled_descr_ = { "@BTS_Tests.ConnL1Pars.toa256_enabled", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &ConnL1Pars_toa256__enabled_xer_, &BOOLEAN_json_, &ConnL1Pars_toa256__enabled_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       ConnL1Pars_meas__valid_xer_ = { {"meas_valid>\n", "meas_valid>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int ConnL1Pars_meas__valid_oer_ext_arr_[0] = {};
const int ConnL1Pars_meas__valid_oer_p_[0] = {};
const TTCN_OERdescriptor_t ConnL1Pars_meas__valid_oer_ = { -1, TRUE, -1, FALSE, 0, 0, ConnL1Pars_meas__valid_oer_ext_arr_, 0, ConnL1Pars_meas__valid_oer_p_};
const TTCN_Typedescriptor_t ConnL1Pars_meas__valid_descr_ = { "@BTS_Tests.ConnL1Pars.meas_valid", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &ConnL1Pars_meas__valid_xer_, &BOOLEAN_json_, &ConnL1Pars_meas__valid_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       MeasElem_rxlev_xer_ = { {"rxlev>\n", "rxlev>\n"}, {7, 7}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t MeasElem_rxlev_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t MeasElem_rxlev_descr_ = { "@BTS_Tests.MeasElem.rxlev", &INTEGER_ber_, &Osmocom__Types::uint6__t_raw_, &INTEGER_text_, &MeasElem_rxlev_xer_, &INTEGER_json_, &MeasElem_rxlev_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MeasElem_rxlev_default_coding("RAW");
const XERdescriptor_t       MeasElem_rxqual_xer_ = { {"rxqual>\n", "rxqual>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t MeasElem_rxqual_descr_ = { "@BTS_Tests.MeasElem.rxqual", &INTEGER_ber_, &Osmocom__Types::uint3__t_raw_, &INTEGER_text_, &MeasElem_rxqual_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING MeasElem_rxqual_default_coding("RAW");
// No XER for MeasElem
const TTCN_Typedescriptor_t MeasElem_descr_ = { "@BTS_Tests.MeasElem", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for MeasElemFS
const TTCN_Typedescriptor_t MeasElemFS_descr_ = { "@BTS_Tests.MeasElemFS", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       ConnL1Pars_timing__offset__256syms_xer_ = { {"timing_offset_256syms>\n", "timing_offset_256syms>\n"}, {23, 23}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t ConnL1Pars_timing__offset__256syms_descr_ = { "@BTS_Tests.ConnL1Pars.timing_offset_256syms", &INTEGER_ber_, &Osmocom__Types::int16__t_raw_, &INTEGER_text_, &ConnL1Pars_timing__offset__256syms_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ConnL1Pars_timing__offset__256syms_default_coding("RAW");
const XERdescriptor_t       ConnL1Pars_bs__power__level_xer_ = { {"bs_power_level>\n", "bs_power_level>\n"}, {16, 16}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t ConnL1Pars_bs__power__level_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t ConnL1Pars_bs__power__level_descr_ = { "@BTS_Tests.ConnL1Pars.bs_power_level", &INTEGER_ber_, &Osmocom__Types::uint4__t_raw_, &INTEGER_text_, &ConnL1Pars_bs__power__level_xer_, &INTEGER_json_, &ConnL1Pars_bs__power__level_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ConnL1Pars_bs__power__level_default_coding("RAW");
const XERdescriptor_t       ConnL1Pars_ms__power__level_xer_ = { {"ms_power_level>\n", "ms_power_level>\n"}, {16, 16}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t ConnL1Pars_ms__power__level_descr_ = { "@BTS_Tests.ConnL1Pars.ms_power_level", &INTEGER_ber_, &Osmocom__Types::uint5__t_raw_, &INTEGER_text_, &ConnL1Pars_ms__power__level_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ConnL1Pars_ms__power__level_default_coding("RAW");
const XERdescriptor_t       ConnL1Pars_ms__actual__ta_xer_ = { {"ms_actual_ta>\n", "ms_actual_ta>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t ConnL1Pars_ms__actual__ta_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t ConnL1Pars_ms__actual__ta_descr_ = { "@BTS_Tests.ConnL1Pars.ms_actual_ta", &INTEGER_ber_, &Osmocom__Types::uint8__t_raw_, &INTEGER_text_, &ConnL1Pars_ms__actual__ta_xer_, &INTEGER_json_, &ConnL1Pars_ms__actual__ta_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ConnL1Pars_ms__actual__ta_default_coding("RAW");
const XERdescriptor_t       ConnL1Pars_facch__enabled_xer_ = { {"facch_enabled>\n", "facch_enabled>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int ConnL1Pars_facch__enabled_oer_ext_arr_[0] = {};
const int ConnL1Pars_facch__enabled_oer_p_[0] = {};
const TTCN_OERdescriptor_t ConnL1Pars_facch__enabled_oer_ = { -1, TRUE, -1, FALSE, 0, 0, ConnL1Pars_facch__enabled_oer_ext_arr_, 0, ConnL1Pars_facch__enabled_oer_p_};
const TTCN_Typedescriptor_t ConnL1Pars_facch__enabled_descr_ = { "@BTS_Tests.ConnL1Pars.facch_enabled", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &ConnL1Pars_facch__enabled_xer_, &BOOLEAN_json_, &ConnL1Pars_facch__enabled_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for ConnL1Pars
const TTCN_Typedescriptor_t ConnL1Pars_descr_ = { "@BTS_Tests.ConnL1Pars", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       ConnHdlrPars_tsc_xer_ = { {"tsc>\n", "tsc>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t ConnHdlrPars_tsc_descr_ = { "@BTS_Tests.ConnHdlrPars.tsc", &INTEGER_ber_, &GSM__Types::GsmTsc_raw_, &INTEGER_text_, &ConnHdlrPars_tsc_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ConnHdlrPars_tsc_default_coding("RAW");
const XERdescriptor_t       FreqHopPars_enabled_xer_ = { {"enabled>\n", "enabled>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int FreqHopPars_enabled_oer_ext_arr_[0] = {};
const int FreqHopPars_enabled_oer_p_[0] = {};
const TTCN_OERdescriptor_t FreqHopPars_enabled_oer_ = { -1, TRUE, -1, FALSE, 0, 0, FreqHopPars_enabled_oer_ext_arr_, 0, FreqHopPars_enabled_oer_p_};
const TTCN_Typedescriptor_t FreqHopPars_enabled_descr_ = { "@BTS_Tests.FreqHopPars.enabled", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &FreqHopPars_enabled_xer_, &BOOLEAN_json_, &FreqHopPars_enabled_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING FreqHopPars_maio__hsn_default_coding("RAW");
UNIVERSAL_CHARSTRING FreqHopPars_ma__map_default_coding("RAW");
UNIVERSAL_CHARSTRING FreqHopPars_ma_default_coding("RAW");
// No XER for FreqHopPars
const TTCN_Typedescriptor_t FreqHopPars_descr_ = { "@BTS_Tests.FreqHopPars", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       ConnHdlrPars_loc__osmux__cid_xer_ = { {"loc_osmux_cid>\n", "loc_osmux_cid>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t ConnHdlrPars_loc__osmux__cid_descr_ = { "@BTS_Tests.ConnHdlrPars.loc_osmux_cid", &INTEGER_ber_, &General__Types::INT1_raw_, &INTEGER_text_, &ConnHdlrPars_loc__osmux__cid_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ConnHdlrPars_loc__osmux__cid_default_coding("RAW");
// No XER for ConnHdlrPars
const TTCN_Typedescriptor_t ConnHdlrPars_descr_ = { "@BTS_Tests.ConnHdlrPars", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ConnHdlrPars_mr__conf_default_coding("RAW");
// No XER for TestSpecUnion
const TTCN_Typedescriptor_t TestSpecUnion_descr_ = { "@BTS_Tests.TestSpecUnion", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       RllTestCase_sapi_xer_ = { {"sapi>\n", "sapi>\n"}, {6, 6}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t RllTestCase_sapi_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t RllTestCase_sapi_descr_ = { "@BTS_Tests.RllTestCase.sapi", &INTEGER_ber_, &Osmocom__Types::uint3__t_raw_, &INTEGER_text_, &RllTestCase_sapi_xer_, &INTEGER_json_, &RllTestCase_sapi_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RllTestCase_sapi_default_coding("RAW");
UNIVERSAL_CHARSTRING RllTestCase_link__id_default_coding("RAW");
const XERdescriptor_t       RllTestCase_l3_xer_ = { {"l3>\n", "l3>\n"}, {4, 4}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int RllTestCase_l3_oer_ext_arr_[0] = {};
const int RllTestCase_l3_oer_p_[0] = {};
const TTCN_OERdescriptor_t RllTestCase_l3_oer_ = { -1, TRUE, -1, FALSE, 0, 0, RllTestCase_l3_oer_ext_arr_, 0, RllTestCase_l3_oer_p_};
const TTCN_Typedescriptor_t RllTestCase_l3_descr_ = { "@BTS_Tests.RllTestCase.l3", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &RllTestCase_l3_xer_, &OCTETSTRING_json_, &RllTestCase_l3_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       RllTestCase_exp_xer_ = { {"exp>\n", "exp>\n"}, {5, 5}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int RllTestCase_exp_oer_ext_arr_[0] = {};
const int RllTestCase_exp_oer_p_[0] = {};
const TTCN_OERdescriptor_t RllTestCase_exp_oer_ = { -1, TRUE, -1, FALSE, 0, 0, RllTestCase_exp_oer_ext_arr_, 0, RllTestCase_exp_oer_p_};
const TTCN_Typedescriptor_t RllTestCase_exp_descr_ = { "@BTS_Tests.RllTestCase.exp", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &RllTestCase_exp_xer_, &BOOLEAN_json_, &RllTestCase_exp_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING RllTestCase_act__type_default_coding("RAW");
// No XER for RllTestCase
const TTCN_Typedescriptor_t RllTestCase_descr_ = { "@BTS_Tests.RllTestCase", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TopTestCase_bs__power_default_coding("RAW");
UNIVERSAL_CHARSTRING TopTestCase_top__cap_default_coding("RAW");
// No XER for TopTestCase_steps
const TTCN_Typedescriptor_t TopTestCase_steps_descr_ = { "@BTS_Tests.TopTestCase.steps", NULL, NULL, NULL, NULL, NULL, NULL, NULL, &TopTestStep_descr_, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       TopTestStep_overpower__sacch_xer_ = { {"overpower_sacch>\n", "overpower_sacch>\n"}, {17, 17}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t TopTestStep_overpower__sacch_descr_ = { "@BTS_Tests.TopTestStep.overpower_sacch", &INTEGER_ber_, &GSM__Types::GsmRxLev_raw_, &INTEGER_text_, &TopTestStep_overpower__sacch_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TopTestStep_overpower__sacch_default_coding("RAW");
const XERdescriptor_t       TopTestStep_overpower__facch_xer_ = { {"overpower_facch>\n", "overpower_facch>\n"}, {17, 17}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t TopTestStep_overpower__facch_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t TopTestStep_overpower__facch_descr_ = { "@BTS_Tests.TopTestStep.overpower_facch", &INTEGER_ber_, &GSM__Types::GsmRxLev_raw_, &INTEGER_text_, &TopTestStep_overpower__facch_xer_, &INTEGER_json_, &TopTestStep_overpower__facch_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TopTestStep_overpower__facch_default_coding("RAW");
// No XER for TopTestStep
const TTCN_Typedescriptor_t TopTestStep_descr_ = { "@BTS_Tests.TopTestStep", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TopTestStep_meas__res_default_coding("RAW");
// No XER for TopTestCase
const TTCN_Typedescriptor_t TopTestCase_descr_ = { "@BTS_Tests.TopTestCase", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ConnHdlrPars_encr_default_coding("RAW");
const XERdescriptor_t       BtsBand_xer_ = { {"BtsBand>\n", "BtsBand>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t BtsBand_descr_ = { "@BTS_Tests.BtsBand", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &BtsBand_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       ConnHdlrPars_bts0__band_xer_ = { {"bts0_band>\n", "bts0_band>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t ConnHdlrPars_bts0__band_descr_ = { "@BTS_Tests.ConnHdlrPars.bts0_band", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &ConnHdlrPars_bts0__band_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       ConnHdlrPars_rem__osmux__cid_xer_ = { {"rem_osmux_cid>\n", "rem_osmux_cid>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED |XER_OPTIONAL, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t ConnHdlrPars_rem__osmux__cid_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t ConnHdlrPars_rem__osmux__cid_descr_ = { "@BTS_Tests.ConnHdlrPars.rem_osmux_cid", &INTEGER_ber_, &General__Types::INT1_raw_, &INTEGER_text_, &ConnHdlrPars_rem__osmux__cid_xer_, &INTEGER_json_, &ConnHdlrPars_rem__osmux__cid_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING ConnHdlrPars_rem__osmux__cid_default_coding("RAW");
ConnHdlrPars ConnHdlr_component_g__pars;
INTEGER ConnHdlr_component_g__next__meas__res__nr;
BOOLEAN ConnHdlr_component_g__first__meas__res;
PCUIF__CodecPort::PCUIF__CODEC__PT ConnHdlr_component_PCU("PCU");
COMPONENT ConnHdlr_component_vc__RTPEM;
RTP__Emulation::RTPEM__CTRL__PT ConnHdlr_component_RTPEM__CTRL("RTPEM_CTRL");
RTP__Emulation::RTPEM__DATA__PT ConnHdlr_component_RTPEM__DATA("RTPEM_DATA");
COMPONENT ConnHdlr_component_vc__OsmuxEM;
OSMUX__Emulation::OsmuxEM__CTRL__PT ConnHdlr_component_OsmuxEM__CTRL("OsmuxEM_CTRL");
OSMUX__Emulation::OsmuxEM__DATA__PT ConnHdlr_component_OsmuxEM__DATA("OsmuxEM_DATA");
GSM__SystemInformation::RachControlParameters_template template_ts__RachCtrl__default;
const GSM__SystemInformation::RachControlParameters_template& ts__RachCtrl__default = template_ts__RachCtrl__default;
GSM__SystemInformation::CellSelectionParameters_template template_ts__CellSelPar__default;
const GSM__SystemInformation::CellSelectionParameters_template& ts__CellSelPar__default = template_ts__CellSelPar__default;
GSM__Types::LocationAreaIdentification_template template_ts__LAI__default;
const GSM__Types::LocationAreaIdentification_template& ts__LAI__default = template_ts__LAI__default;
GSM__RestOctets::GPRSIndicator_template template_ts__GPRSIndicator__def;
const GSM__RestOctets::GPRSIndicator_template& ts__GPRSIndicator__def = template_ts__GPRSIndicator__def;
GSM__RestOctets::SI3RestOctets_template template_ts__SI3RestOctets__def;
const GSM__RestOctets::SI3RestOctets_template& ts__SI3RestOctets__def = template_ts__SI3RestOctets__def;
GSM__RestOctets::SI4RestOctets_template template_ts__SI4RestOctets__def;
const GSM__RestOctets::SI4RestOctets_template& ts__SI4RestOctets__def = template_ts__SI4RestOctets__def;
GSM__SystemInformation::SystemInformation_template template_ts__SI3__default;
const GSM__SystemInformation::SystemInformation_template& ts__SI3__default = template_ts__SI3__default;
GSM__SystemInformation::SystemInformation_template template_ts__SI2__default;
const GSM__SystemInformation::SystemInformation_template& ts__SI2__default = template_ts__SI2__default;
GSM__SystemInformation::SystemInformation_template template_ts__SI4__default;
const GSM__SystemInformation::SystemInformation_template& ts__SI4__default = template_ts__SI4__default;
INTEGER const_f__init_trx__nr_defval;
const INTEGER& f__init_trx__nr_defval = const_f__init_trx__nr_defval;
// No XER for void__fn
const TTCN_Typedescriptor_t void__fn_descr_ = { "@BTS_Tests.void_fn", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
INTEGER const_f__resolve__fh__params_trx__nr_defval;
const INTEGER& f__resolve__fh__params_trx__nr_defval = const_f__resolve__fh__params_trx__nr_defval;
BOOLEAN const_f__start__handler_pcu__comp_defval;
const BOOLEAN& f__start__handler_pcu__comp_defval = const_f__start__handler_pcu__comp_defval;
BOOLEAN const_f__start__handler_trxc__comp_defval;
const BOOLEAN& f__start__handler_trxc__comp_defval = const_f__start__handler_trxc__comp_defval;
BOOLEAN const_f__start__handler_l1ctl_defval;
const BOOLEAN& f__start__handler_l1ctl_defval = const_f__start__handler_l1ctl_defval;
L1CTL__Types::L1ctlCcchMode const_f__l1__tune_ccch__mode_defval;
const L1CTL__Types::L1ctlCcchMode& f__l1__tune_ccch__mode_defval = const_f__l1__tune_ccch__mode_defval;
BOOLEAN const_f__rsl__transceive__ret_ignore__other_defval;
const BOOLEAN& f__rsl__transceive__ret_ignore__other_defval = const_f__rsl__transceive__ret_ignore__other_defval;
BOOLEAN const_f__rsl__transceive_ignore__other_defval;
const BOOLEAN& f__rsl__transceive_ignore__other_defval = const_f__rsl__transceive_ignore__other_defval;
BOOLEAN const_f__rsl__chan__act_encr__enable_defval;
const BOOLEAN& f__rsl__chan__act_encr__enable_defval = const_f__rsl__chan__act_encr__enable_defval;
RSL__Types::RSL__IE__List const_f__rsl__chan__act_more__ies_defval;
const RSL__Types::RSL__IE__List& f__rsl__chan__act_more__ies_defval = const_f__rsl__chan__act_more__ies_defval;
RSL__Types::RSL__IE__ActivationType const_f__rsl__chan__act_act__type_defval;
const RSL__Types::RSL__IE__ActivationType& f__rsl__chan__act_act__type_defval = const_f__rsl__chan__act_act__type_defval;
TestSpecUnion_template template_t__Pars_spec_defval;
const TestSpecUnion_template& t__Pars_spec_defval = template_t__Pars_spec_defval;
INTEGER const_t__Pars_trx__nr_defval;
const INTEGER& t__Pars_trx__nr_defval = const_t__Pars_trx__nr_defval;
FLOAT const_t__Pars_t__guard_defval;
const FLOAT& t__Pars_t__guard_defval = const_t__Pars_t__guard_defval;
OCTETSTRING_template template_as__l1ctl__dl__msg_tr__data_defval;
const OCTETSTRING_template& as__l1ctl__dl__msg_tr__data_defval = template_as__l1ctl__dl__msg_tr__data_defval;
GSM__Types::RslChannelNr_template template_as__l1ctl__dl__msg_chan__nr_defval;
const GSM__Types::RslChannelNr_template& as__l1ctl__dl__msg_chan__nr_defval = template_as__l1ctl__dl__msg_chan__nr_defval;
GSM__Types::RslLinkId_template template_as__l1ctl__dl__msg_link__id_defval;
const GSM__Types::RslLinkId_template& as__l1ctl__dl__msg_link__id_defval = template_as__l1ctl__dl__msg_link__id_defval;
GSM__Types::RslChannelNr_template template_as__dl__lapdm__dummy_chan__nr_defval;
const GSM__Types::RslChannelNr_template& as__dl__lapdm__dummy_chan__nr_defval = template_as__dl__lapdm__dummy_chan__nr_defval;
GSM__Types::RslLinkId_template template_as__dl__lapdm__dummy_link__id_defval;
const GSM__Types::RslLinkId_template& as__dl__lapdm__dummy_link__id_defval = template_as__dl__lapdm__dummy_link__id_defval;
INTEGER_template template_as__dl__lapdm__dummy_sapi_defval;
const INTEGER_template& as__dl__lapdm__dummy_sapi_defval = template_as__dl__lapdm__dummy_sapi_defval;
BOOLEAN const_as__dl__lapdm__dummy_do__repeat_defval;
const BOOLEAN& as__dl__lapdm__dummy_do__repeat_defval = const_as__dl__lapdm__dummy_do__repeat_defval;
LAPDm__Types::LapdmFrameAB_template template_as__dl__dcch__lapdm__ab_tr__frame_defval;
const LAPDm__Types::LapdmFrameAB_template& as__dl__dcch__lapdm__ab_tr__frame_defval = template_as__dl__dcch__lapdm__ab_tr__frame_defval;
GSM__Types::RslLinkId_template template_as__dl__dcch__lapdm__ab_link__id_defval;
const GSM__Types::RslLinkId_template& as__dl__dcch__lapdm__ab_link__id_defval = template_as__dl__dcch__lapdm__ab_link__id_defval;
LAPDm__Types::LapdmFrameAB_template template_as__dl__sacch__lapdm__ab_tr__frame_defval;
const LAPDm__Types::LapdmFrameAB_template& as__dl__sacch__lapdm__ab_tr__frame_defval = template_as__dl__sacch__lapdm__ab_tr__frame_defval;
GSM__RR__Types::SacchL1Header_template template_as__dl__sacch__lapdm__ab_tr__l1h_defval;
const GSM__RR__Types::SacchL1Header_template& as__dl__sacch__lapdm__ab_tr__l1h_defval = template_as__dl__sacch__lapdm__ab_tr__l1h_defval;
INTEGER_template template_as__dl__sacch__lapdm__ab_sapi_defval;
const INTEGER_template& as__dl__sacch__lapdm__ab_sapi_defval = template_as__dl__sacch__lapdm__ab_sapi_defval;
MobileL3__Types::PDU__ML3__NW__MS_template template_as__dl__dcch__pdu_tr__pdu_defval;
const MobileL3__Types::PDU__ML3__NW__MS_template& as__dl__dcch__pdu_tr__pdu_defval = template_as__dl__dcch__pdu_tr__pdu_defval;
INTEGER_template template_as__dl__dcch__pdu_sapi_defval;
const INTEGER_template& as__dl__dcch__pdu_sapi_defval = template_as__dl__dcch__pdu_sapi_defval;
UNIVERSAL_CHARSTRING WrongChanNrCase_chan__nr_default_coding("RAW");
const XERdescriptor_t       WrongChanNrCase_description_xer_ = { {"description>\n", "description>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t WrongChanNrCase_description_descr_ = { "@BTS_Tests.WrongChanNrCase.description", NULL, &CHARSTRING_raw_, &CHARSTRING_text_, &WrongChanNrCase_description_xer_, &CHARSTRING_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for WrongChanNrCase
const TTCN_Typedescriptor_t WrongChanNrCase_descr_ = { "@BTS_Tests.WrongChanNrCase", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for WrongChanNrCases
const TTCN_Typedescriptor_t WrongChanNrCases_descr_ = { "@BTS_Tests.WrongChanNrCases", NULL, NULL, NULL, NULL, NULL, NULL, NULL, &WrongChanNrCase_descr_, TTCN_Typedescriptor_t::DONTCARE };
BOOLEAN const_f__sacch__present_do__fail_defval;
const BOOLEAN& f__sacch__present_do__fail_defval = const_f__sacch__present_do__fail_defval;
INTEGER const_f__vty__load__ind__thresh_period_defval;
const INTEGER& f__vty__load__ind__thresh_period_defval = const_f__vty__load__ind__thresh_period_defval;
INTEGER const_f__vty__load__ind__thresh_bts__nr_defval;
const INTEGER& f__vty__load__ind__thresh_bts__nr_defval = const_f__vty__load__ind__thresh_bts__nr_defval;
INTEGER_template template_tr__rach__slots__per__interval;
const INTEGER_template& tr__rach__slots__per__interval = template_tr__rach__slots__per__interval;
BOOLEAN_template template_ts__LAPDm__AB_c__r_defval;
const BOOLEAN_template& ts__LAPDm__AB_c__r_defval = template_ts__LAPDm__AB_c__r_defval;
BOOLEAN_template template_ts__LAPDm__AB_p_defval;
const BOOLEAN_template& ts__LAPDm__AB_p_defval = template_ts__LAPDm__AB_p_defval;
BOOLEAN const_as__l1__sacch__l1h_do__apply_defval;
const BOOLEAN& as__l1__sacch__l1h_do__apply_defval = const_as__l1__sacch__l1h_do__apply_defval;
BOOLEAN const_as__meas__res_verify__meas_defval;
const BOOLEAN& as__meas__res_verify__meas_defval = const_as__meas__res_verify__meas_defval;
BOOLEAN const_f__est__dchan_encr__enable_defval;
const BOOLEAN& f__est__dchan_encr__enable_defval = const_f__est__dchan_encr__enable_defval;
RSL__Types::RSL__IE__List const_f__est__dchan_more__ies_defval;
const RSL__Types::RSL__IE__List& f__est__dchan_more__ies_defval = const_f__est__dchan_more__ies_defval;
RSL__Types::RSL__IE__ActivationType const_f__est__dchan_act__type_defval;
const RSL__Types::RSL__IE__ActivationType& f__est__dchan_act__type_defval = const_f__est__dchan_act__type_defval;
RTP__Emulation::RtpemConfig const_f__rtpem__activate_cfg_defval;
const RTP__Emulation::RtpemConfig& f__rtpem__activate_cfg_defval = const_f__rtpem__activate_cfg_defval;
RTP__Emulation::RtpemMode const_f__rtpem__activate_mode_defval;
const RTP__Emulation::RtpemMode& f__rtpem__activate_mode_defval = const_f__rtpem__activate_mode_defval;
INTEGER const_f__rtpem__activate_rtp__pt_defval;
const INTEGER& f__rtpem__activate_rtp__pt_defval = const_f__rtpem__activate_rtp__pt_defval;
OSMUX__Emulation::OsmuxemConfig const_f__osmuxem__activate_cfg_defval;
const OSMUX__Emulation::OsmuxemConfig& f__osmuxem__activate_cfg_defval = const_f__osmuxem__activate_cfg_defval;
OSMUX__Emulation::OsmuxemMode const_f__osmuxem__activate_mode_defval;
const OSMUX__Emulation::OsmuxemMode& f__osmuxem__activate_mode_defval = const_f__osmuxem__activate_mode_defval;
CHARSTRING_template template_BtsBand__allGSM;
const CHARSTRING_template& BtsBand__allGSM = template_BtsBand__allGSM;
const XERdescriptor_t       allowedFn_frame__nr_xer_ = { {"frame_nr>\n", "frame_nr>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t allowedFn_frame__nr_descr_ = { "@BTS_Tests.allowedFn.frame_nr", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &allowedFn_frame__nr_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for allowedFn
const TTCN_Typedescriptor_t allowedFn_descr_ = { "@BTS_Tests.allowedFn", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
allowedFn_template template_bs__ag__blks__res__0;
const allowedFn_template& bs__ag__blks__res__0 = template_bs__ag__blks__res__0;
allowedFn_template template_bs__ag__blks__res__1;
const allowedFn_template& bs__ag__blks__res__1 = template_bs__ag__blks__res__1;
allowedFn_template template_bs__ag__blks__res__2;
const allowedFn_template& bs__ag__blks__res__2 = template_bs__ag__blks__res__2;
allowedFn_template template_bs__ag__blks__res__3;
const allowedFn_template& bs__ag__blks__res__3 = template_bs__ag__blks__res__3;
allowedFn_template template_bs__ag__blks__res__4;
const allowedFn_template& bs__ag__blks__res__4 = template_bs__ag__blks__res__4;
allowedFn_template template_bs__ag__blks__res__5;
const allowedFn_template& bs__ag__blks__res__5 = template_bs__ag__blks__res__5;
allowedFn_template template_bs__ag__blks__res__6;
const allowedFn_template& bs__ag__blks__res__6 = template_bs__ag__blks__res__6;
allowedFn_template template_bs__ag__blks__res__7;
const allowedFn_template& bs__ag__blks__res__7 = template_bs__ag__blks__res__7;
const XERdescriptor_t       PagingTestCfg_combined__ccch_xer_ = { {"combined_ccch>\n", "combined_ccch>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int PagingTestCfg_combined__ccch_oer_ext_arr_[0] = {};
const int PagingTestCfg_combined__ccch_oer_p_[0] = {};
const TTCN_OERdescriptor_t PagingTestCfg_combined__ccch_oer_ = { -1, TRUE, -1, FALSE, 0, 0, PagingTestCfg_combined__ccch_oer_ext_arr_, 0, PagingTestCfg_combined__ccch_oer_p_};
const TTCN_Typedescriptor_t PagingTestCfg_combined__ccch_descr_ = { "@BTS_Tests.PagingTestCfg.combined_ccch", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &PagingTestCfg_combined__ccch_xer_, &BOOLEAN_json_, &PagingTestCfg_combined__ccch_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       PagingTestCfg_bs__ag__blks__res_xer_ = { {"bs_ag_blks_res>\n", "bs_ag_blks_res>\n"}, {16, 16}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t PagingTestCfg_bs__ag__blks__res_descr_ = { "@BTS_Tests.PagingTestCfg.bs_ag_blks_res", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &PagingTestCfg_bs__ag__blks__res_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       PagingTestCfg_load__factor_xer_ = { {"load_factor>\n", "load_factor>\n"}, {13, 13}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int PagingTestCfg_load__factor_oer_ext_arr_[0] = {};
const int PagingTestCfg_load__factor_oer_p_[0] = {};
const TTCN_OERdescriptor_t PagingTestCfg_load__factor_oer_ = { -1, TRUE, -1, FALSE, 0, 0, PagingTestCfg_load__factor_oer_ext_arr_, 0, PagingTestCfg_load__factor_oer_p_};
const TTCN_Typedescriptor_t PagingTestCfg_load__factor_descr_ = { "@BTS_Tests.PagingTestCfg.load_factor", &FLOAT_ber_, &FLOAT_raw_, NULL, &PagingTestCfg_load__factor_xer_, &FLOAT_json_, &PagingTestCfg_load__factor_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       PagingTestCfg_ps__load__modulus_xer_ = { {"ps_load_modulus>\n", "ps_load_modulus>\n"}, {17, 17}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t PagingTestCfg_ps__load__modulus_descr_ = { "@BTS_Tests.PagingTestCfg.ps_load_modulus", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &PagingTestCfg_ps__load__modulus_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       PagingTestCfg_ps__wait__cong_xer_ = { {"ps_wait_cong>\n", "ps_wait_cong>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int PagingTestCfg_ps__wait__cong_oer_ext_arr_[0] = {};
const int PagingTestCfg_ps__wait__cong_oer_p_[0] = {};
const TTCN_OERdescriptor_t PagingTestCfg_ps__wait__cong_oer_ = { -1, TRUE, -1, FALSE, 0, 0, PagingTestCfg_ps__wait__cong_oer_ext_arr_, 0, PagingTestCfg_ps__wait__cong_oer_p_};
const TTCN_Typedescriptor_t PagingTestCfg_ps__wait__cong_descr_ = { "@BTS_Tests.PagingTestCfg.ps_wait_cong", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &PagingTestCfg_ps__wait__cong_xer_, &BOOLEAN_json_, &PagingTestCfg_ps__wait__cong_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       PagingTestCfg_queue__drain__timeout_xer_ = { {"queue_drain_timeout>\n", "queue_drain_timeout>\n"}, {21, 21}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int PagingTestCfg_queue__drain__timeout_oer_ext_arr_[0] = {};
const int PagingTestCfg_queue__drain__timeout_oer_p_[0] = {};
const TTCN_OERdescriptor_t PagingTestCfg_queue__drain__timeout_oer_ = { -1, TRUE, -1, FALSE, 0, 0, PagingTestCfg_queue__drain__timeout_oer_ext_arr_, 0, PagingTestCfg_queue__drain__timeout_oer_p_};
const TTCN_Typedescriptor_t PagingTestCfg_queue__drain__timeout_descr_ = { "@BTS_Tests.PagingTestCfg.queue_drain_timeout", &FLOAT_ber_, &FLOAT_raw_, NULL, &PagingTestCfg_queue__drain__timeout_xer_, &FLOAT_json_, &PagingTestCfg_queue__drain__timeout_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       PagingTestCfg_exp__load__ind_xer_ = { {"exp_load_ind>\n", "exp_load_ind>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int PagingTestCfg_exp__load__ind_oer_ext_arr_[0] = {};
const int PagingTestCfg_exp__load__ind_oer_p_[0] = {};
const TTCN_OERdescriptor_t PagingTestCfg_exp__load__ind_oer_ = { -1, TRUE, -1, FALSE, 0, 0, PagingTestCfg_exp__load__ind_oer_ext_arr_, 0, PagingTestCfg_exp__load__ind_oer_p_};
const TTCN_Typedescriptor_t PagingTestCfg_exp__load__ind_descr_ = { "@BTS_Tests.PagingTestCfg.exp_load_ind", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &PagingTestCfg_exp__load__ind_xer_, &BOOLEAN_json_, &PagingTestCfg_exp__load__ind_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       PagingTestCfg_exp__overload_xer_ = { {"exp_overload>\n", "exp_overload>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int PagingTestCfg_exp__overload_oer_ext_arr_[0] = {};
const int PagingTestCfg_exp__overload_oer_p_[0] = {};
const TTCN_OERdescriptor_t PagingTestCfg_exp__overload_oer_ = { -1, TRUE, -1, FALSE, 0, 0, PagingTestCfg_exp__overload_oer_ext_arr_, 0, PagingTestCfg_exp__overload_oer_p_};
const TTCN_Typedescriptor_t PagingTestCfg_exp__overload_descr_ = { "@BTS_Tests.PagingTestCfg.exp_overload", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &PagingTestCfg_exp__overload_xer_, &BOOLEAN_json_, &PagingTestCfg_exp__overload_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       PagingTestCfg_use__tmsi_xer_ = { {"use_tmsi>\n", "use_tmsi>\n"}, {10, 10}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int PagingTestCfg_use__tmsi_oer_ext_arr_[0] = {};
const int PagingTestCfg_use__tmsi_oer_p_[0] = {};
const TTCN_OERdescriptor_t PagingTestCfg_use__tmsi_oer_ = { -1, TRUE, -1, FALSE, 0, 0, PagingTestCfg_use__tmsi_oer_ext_arr_, 0, PagingTestCfg_use__tmsi_oer_p_};
const TTCN_Typedescriptor_t PagingTestCfg_use__tmsi_descr_ = { "@BTS_Tests.PagingTestCfg.use_tmsi", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &PagingTestCfg_use__tmsi_xer_, &BOOLEAN_json_, &PagingTestCfg_use__tmsi_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for PagingTestCfg
const TTCN_Typedescriptor_t PagingTestCfg_descr_ = { "@BTS_Tests.PagingTestCfg", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       PagingTestState_num__paging__sent_xer_ = { {"num_paging_sent>\n", "num_paging_sent>\n"}, {17, 17}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t PagingTestState_num__paging__sent_descr_ = { "@BTS_Tests.PagingTestState.num_paging_sent", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &PagingTestState_num__paging__sent_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       PagingTestState_num__paging__rcv__msgs_xer_ = { {"num_paging_rcv_msgs>\n", "num_paging_rcv_msgs>\n"}, {21, 21}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t PagingTestState_num__paging__rcv__msgs_descr_ = { "@BTS_Tests.PagingTestState.num_paging_rcv_msgs", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &PagingTestState_num__paging__rcv__msgs_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       PagingTestState_num__paging__rcv__ids_xer_ = { {"num_paging_rcv_ids>\n", "num_paging_rcv_ids>\n"}, {20, 20}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t PagingTestState_num__paging__rcv__ids_descr_ = { "@BTS_Tests.PagingTestState.num_paging_rcv_ids", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &PagingTestState_num__paging__rcv__ids_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       PagingTestState_num__overload_xer_ = { {"num_overload>\n", "num_overload>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t PagingTestState_num__overload_descr_ = { "@BTS_Tests.PagingTestState.num_overload", &INTEGER_ber_, &INTEGER_raw_, &INTEGER_text_, &PagingTestState_num__overload_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       PagingTestState_cong__detected_xer_ = { {"cong_detected>\n", "cong_detected>\n"}, {15, 15}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int PagingTestState_cong__detected_oer_ext_arr_[0] = {};
const int PagingTestState_cong__detected_oer_p_[0] = {};
const TTCN_OERdescriptor_t PagingTestState_cong__detected_oer_ = { -1, TRUE, -1, FALSE, 0, 0, PagingTestState_cong__detected_oer_ext_arr_, 0, PagingTestState_cong__detected_oer_p_};
const TTCN_Typedescriptor_t PagingTestState_cong__detected_descr_ = { "@BTS_Tests.PagingTestState.cong_detected", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &PagingTestState_cong__detected_xer_, &BOOLEAN_json_, &PagingTestState_cong__detected_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for PagingTestState
const TTCN_Typedescriptor_t PagingTestState_descr_ = { "@BTS_Tests.PagingTestState", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
GSM__RR__Types::MobileAllocationLV const_c__MA__null;
const GSM__RR__Types::MobileAllocationLV& c__MA__null = const_c__MA__null;
const XERdescriptor_t       SystemInformationFn_frame__number_xer_ = { {"frame_number>\n", "frame_number>\n"}, {14, 14}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t SystemInformationFn_frame__number_descr_ = { "@BTS_Tests.SystemInformationFn.frame_number", &INTEGER_ber_, &GSM__Types::GsmFrameNumber_raw_, &INTEGER_text_, &SystemInformationFn_frame__number_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING SystemInformationFn_frame__number_default_coding("RAW");
UNIVERSAL_CHARSTRING SystemInformationFn_si_default_coding("RAW");
// No XER for SystemInformationFn
const TTCN_Typedescriptor_t SystemInformationFn_descr_ = { "@BTS_Tests.SystemInformationFn", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for SystemInformationVector
const TTCN_Typedescriptor_t SystemInformationVector_descr_ = { "@BTS_Tests.SystemInformationVector", NULL, NULL, NULL, NULL, NULL, NULL, NULL, &SystemInformationFn_descr_, TTCN_Typedescriptor_t::DONTCARE };
// No XER for SystemInformationVectorPerTc
const TTCN_Typedescriptor_t SystemInformationVectorPerTc_descr_ = { "@BTS_Tests.SystemInformationVectorPerTc", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
BOOLEAN const_f__si__vecslot__contains_bcch__ext_defval;
const BOOLEAN& f__si__vecslot__contains_bcch__ext_defval = const_f__si__vecslot__contains_bcch__ext_defval;
BOOLEAN const_f__ensure__si__vec__contains_ext__bcch_defval;
const BOOLEAN& f__ensure__si__vec__contains_ext__bcch_defval = const_f__ensure__si__vec__contains_ext__bcch_defval;
BOOLEAN const_f__si__vecslot__contains__n__of__m_bcch__ext_defval;
const BOOLEAN& f__si__vecslot__contains__n__of__m_bcch__ext_defval = const_f__si__vecslot__contains__n__of__m_bcch__ext_defval;
INTEGER const_f__si__vecslot__contains__n__of__m_n_defval;
const INTEGER& f__si__vecslot__contains__n__of__m_n_defval = const_f__si__vecslot__contains__n__of__m_n_defval;
INTEGER const_f__si__vecslot__contains__n__of__m_m_defval;
const INTEGER& f__si__vecslot__contains__n__of__m_m_defval = const_f__si__vecslot__contains__n__of__m_m_defval;
BOOLEAN const_f__ensure__si__vec__contains__n__of__m_ext__bcch_defval;
const BOOLEAN& f__ensure__si__vec__contains__n__of__m_ext__bcch_defval = const_f__ensure__si__vec__contains__n__of__m_ext__bcch_defval;
BOOLEAN const_f__si__vecslot__contains__only_bcch__ext_defval;
const BOOLEAN& f__si__vecslot__contains__only_bcch__ext_defval = const_f__si__vecslot__contains__only_bcch__ext_defval;
BOOLEAN const_f__ensure__si__vec__contains__only_ext__bcch_defval;
const BOOLEAN& f__ensure__si__vec__contains__only_ext__bcch_defval = const_f__ensure__si__vec__contains__only_ext__bcch_defval;
FLOAT const_f__l1__sample__si_duration_defval;
const FLOAT& f__l1__sample__si_duration_defval = const_f__l1__sample__si_duration_defval;
FLOAT const_f__TC__si__sched_duration_defval;
const FLOAT& f__TC__si__sched_duration_defval = const_f__TC__si__sched_duration_defval;
PCUIF__Types::PCUIF__Message_template template_as__pcuif__msg_tr__msg_defval;
const PCUIF__Types::PCUIF__Message_template& as__pcuif__msg_tr__msg_defval = template_as__pcuif__msg_tr__msg_defval;
INTEGER_template template_as__l1ctl__dl__block__ind_fn_defval;
const INTEGER_template& as__l1ctl__dl__block__ind_fn_defval = template_as__l1ctl__dl__block__ind_fn_defval;
INTEGER_template template_as__l1ctl__dl__block__ind_tn_defval;
const INTEGER_template& as__l1ctl__dl__block__ind_tn_defval = template_as__l1ctl__dl__block__ind_tn_defval;
INTEGER_template template_as__l1ctl__dl__block__ind_usf_defval;
const INTEGER_template& as__l1ctl__dl__block__ind_usf_defval = template_as__l1ctl__dl__block__ind_usf_defval;
OCTETSTRING_template template_as__l1ctl__dl__block__ind_data_defval;
const OCTETSTRING_template& as__l1ctl__dl__block__ind_data_defval = template_as__l1ctl__dl__block__ind_data_defval;
const XERdescriptor_t       TdmaFnTn_fn_xer_ = { {"fn>\n", "fn>\n"}, {4, 4}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t TdmaFnTn_fn_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t TdmaFnTn_fn_descr_ = { "@BTS_Tests.TdmaFnTn.fn", &INTEGER_ber_, &GSM__Types::GsmFrameNumber_raw_, &INTEGER_text_, &TdmaFnTn_fn_xer_, &INTEGER_json_, &TdmaFnTn_fn_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TdmaFnTn_fn_default_coding("RAW");
const XERdescriptor_t       TdmaFnTn_tn_xer_ = { {"tn>\n", "tn>\n"}, {4, 4}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t TdmaFnTn_tn_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t TdmaFnTn_tn_descr_ = { "@BTS_Tests.TdmaFnTn.tn", &INTEGER_ber_, &Osmocom__Types::uint3__t_raw_, &INTEGER_text_, &TdmaFnTn_tn_xer_, &INTEGER_json_, &TdmaFnTn_tn_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING TdmaFnTn_tn_default_coding("RAW");
// No XER for TdmaFnTn
const TTCN_Typedescriptor_t TdmaFnTn_descr_ = { "@BTS_Tests.TdmaFnTn", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
INTEGER_template template_f__TC__pcu__tx__ul__block__req_tn_defval;
const INTEGER_template& f__TC__pcu__tx__ul__block__req_tn_defval = template_f__TC__pcu__tx__ul__block__req_tn_defval;
INTEGER_template template_f__TC__pcu__tx__ul__block__req_usf_defval;
const INTEGER_template& f__TC__pcu__tx__ul__block__req_usf_defval = template_f__TC__pcu__tx__ul__block__req_usf_defval;
OCTETSTRING const_c__PCU__DATA;
const OCTETSTRING& c__PCU__DATA = const_c__PCU__DATA;
BOOLEAN const_f__pcu__to__l1_expect__data_defval;
const BOOLEAN& f__pcu__to__l1_expect__data_defval = const_f__pcu__to__l1_expect__data_defval;
BOOLEAN const_f__pcu__to__l1_wait__rts_defval;
const BOOLEAN& f__pcu__to__l1_wait__rts_defval = const_f__pcu__to__l1_wait__rts_defval;
// No XER for RllTestCases
const TTCN_Typedescriptor_t RllTestCases_descr_ = { "@BTS_Tests.RllTestCases", NULL, NULL, NULL, NULL, NULL, NULL, NULL, &RllTestCase_descr_, TTCN_Typedescriptor_t::DONTCARE };
RSL__Types::RSL__IE__ActivationType const_t__EITC_act__type_defval;
const RSL__Types::RSL__IE__ActivationType& t__EITC_act__type_defval = const_t__EITC_act__type_defval;
FLOAT const_f__l1__exp__lapdm_t_defval;
const FLOAT& f__l1__exp__lapdm_t_defval = const_f__l1__exp__lapdm_t_defval;
BOOLEAN const_f__unitdata__mo_exp__sacch_defval;
const BOOLEAN& f__unitdata__mo_exp__sacch_defval = const_f__unitdata__mo_exp__sacch_defval;
BOOLEAN const_f__unitdata__mo_exp__any_defval;
const BOOLEAN& f__unitdata__mo_exp__any_defval = const_f__unitdata__mo_exp__any_defval;
BOOLEAN const_f__data__mo_exp__sacch_defval;
const BOOLEAN& f__data__mo_exp__sacch_defval = const_f__data__mo_exp__sacch_defval;
BOOLEAN const_f__data__mo_exp__any_defval;
const BOOLEAN& f__data__mo_exp__any_defval = const_f__data__mo_exp__any_defval;
CHARSTRING const_f__assert__lapdm_name_defval;
const CHARSTRING& f__assert__lapdm_name_defval = const_f__assert__lapdm_name_defval;
// No XER for f__TC__ms__pwr__ctrl__cb
const TTCN_Typedescriptor_t f__TC__ms__pwr__ctrl__cb_descr_ = { "@BTS_Tests.f_TC_ms_pwr_ctrl_cb", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
TTCN_Module module_object("BTS_Tests", __DATE__, __TIME__, module_checksum, pre_init_module, NULL, 0U, 4294967295U, 4294967295U, 4294967295U, NULL, 0LU, 0, post_init_module, set_module_param, NULL, log_module_param, init_comp_type, init_system_port, start_ptc_function, module_control_part);

const RuntimeVersionChecker ver_checker(  current_runtime_version.requires_major_version_11,
  current_runtime_version.requires_minor_version_1,
  current_runtime_version.requires_patch_level_0,  current_runtime_version.requires_runtime_1);

/* Member functions of C++ classes */


const FreqHopGroups FreqHopConfig::UNBOUND_ELEM;
FreqHopConfig::FreqHopConfig()
{
val_ptr = NULL;
}

FreqHopConfig::FreqHopConfig(null_type)
{
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
}

FreqHopConfig::FreqHopConfig(const FreqHopConfig& other_value)
{
if (!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BTS_Tests.FreqHopConfig.");
val_ptr = other_value.val_ptr;
val_ptr->ref_count++;
}

FreqHopConfig::~FreqHopConfig()
{
clean_up();
if (val_ptr != NULL) val_ptr = NULL;
}

void FreqHopConfig::clean_up()
{
if (val_ptr != NULL) {
if (val_ptr->ref_count > 1) {
val_ptr->ref_count--;
val_ptr = NULL;
}
else if (val_ptr->ref_count == 1) {
for (int elem_count = 0; elem_count < val_ptr->n_elements;
elem_count++)
if (val_ptr->value_elements[elem_count] != NULL)
delete val_ptr->value_elements[elem_count];
free_pointers((void**)val_ptr->value_elements);
delete val_ptr;
val_ptr = NULL;
}
else
TTCN_error("Internal error: Invalid reference counter in a record of/set of value.");
}
}

FreqHopConfig& FreqHopConfig::operator=(null_type)
{
clean_up();
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
return *this;
}

FreqHopConfig& FreqHopConfig::operator=(const FreqHopConfig& other_value)
{
if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @BTS_Tests.FreqHopConfig.");
if (this != &other_value) {
clean_up();
val_ptr = other_value.val_ptr;
val_ptr->ref_count++;
}
return *this;
}

boolean FreqHopConfig::operator==(null_type) const
{
if (val_ptr == NULL)
TTCN_error("The left operand of comparison is an unbound value of type @BTS_Tests.FreqHopConfig.");
return val_ptr->n_elements == 0 ;
}

boolean FreqHopConfig::operator==(const FreqHopConfig& other_value) const
{
if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @BTS_Tests.FreqHopConfig.");
if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @BTS_Tests.FreqHopConfig.");
if (val_ptr == other_value.val_ptr) return TRUE;
if (val_ptr->n_elements != (other_value.val_ptr)->n_elements)
return FALSE;
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++){
if (val_ptr->value_elements[elem_count] != NULL){
if ((other_value.val_ptr)->value_elements[elem_count] != NULL){
  if (*val_ptr->value_elements[elem_count] != *(other_value.val_ptr)->value_elements[elem_count]) return FALSE;
} else return FALSE;
} else {
if ((other_value.val_ptr)->value_elements[elem_count] != NULL) return FALSE;
}
}
return TRUE;
}

FreqHopGroups& FreqHopConfig::operator[](int index_value)
{
if (index_value < 0) TTCN_error("Accessing an element of type @BTS_Tests.FreqHopConfig using a negative index: %d.", index_value);
if (val_ptr == NULL) {
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
} else if (val_ptr->ref_count > 1) {
struct recordof_setof_struct *new_val_ptr = new recordof_setof_struct;
new_val_ptr->ref_count = 1;
new_val_ptr->n_elements = (index_value >= val_ptr->n_elements) ? index_value + 1 : val_ptr->n_elements;
new_val_ptr->value_elements = (FreqHopGroups**)allocate_pointers(new_val_ptr->n_elements);
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++){
if (val_ptr->value_elements[elem_count] != NULL){
new_val_ptr->value_elements[elem_count] = new FreqHopGroups(*(val_ptr->value_elements[elem_count]));
}
}
clean_up();
val_ptr = new_val_ptr;
}
if (index_value >= val_ptr->n_elements) set_size(index_value + 1);
if (val_ptr->value_elements[index_value] == NULL) {
val_ptr->value_elements[index_value] = new FreqHopGroups;
}
return *val_ptr->value_elements[index_value];
}

FreqHopGroups& FreqHopConfig::operator[](const INTEGER& index_value)
{
index_value.must_bound("Using an unbound integer value for indexing a value of type @BTS_Tests.FreqHopConfig.");
return (*this)[(int)index_value];
}

const FreqHopGroups& FreqHopConfig::operator[](int index_value) const
{
if (val_ptr == NULL)
TTCN_error("Accessing an element in an unbound value of type @BTS_Tests.FreqHopConfig.");
if (index_value < 0) TTCN_error("Accessing an element of type @BTS_Tests.FreqHopConfig using a negative index: %d.", index_value);
if (index_value >= val_ptr->n_elements) TTCN_error("Index overflow in a value of type @BTS_Tests.FreqHopConfig: The index is %d, but the value has only %d elements.", index_value, val_ptr->n_elements);
return (val_ptr->value_elements[index_value] == NULL) ?
UNBOUND_ELEM : *val_ptr->value_elements[index_value];
}

const FreqHopGroups& FreqHopConfig::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a value of type @BTS_Tests.FreqHopConfig.");
return (*this)[(int)index_value];
}

FreqHopConfig FreqHopConfig::operator<<=(int rotate_count) const
{
return *this >>= (-rotate_count);
}

FreqHopConfig FreqHopConfig::operator<<=(const INTEGER& rotate_count) const
{
rotate_count.must_bound("Unbound integer operand of rotate left operator.");
return *this >>= (int)(-rotate_count);
}

FreqHopConfig FreqHopConfig::operator>>=(const INTEGER& rotate_count) const
{
rotate_count.must_bound("Unbound integer operand of rotate right operator.");
return *this >>= (int)rotate_count;
}

FreqHopConfig FreqHopConfig::operator>>=(int rotate_count) const
{
if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @BTS_Tests.FreqHopConfig.");
if (val_ptr->n_elements == 0) return *this;
int rc;
if (rotate_count>=0) rc = rotate_count % val_ptr->n_elements;
else rc = val_ptr->n_elements - ((-rotate_count) % val_ptr->n_elements);
if (rc == 0) return *this;
FreqHopConfig ret_val;
ret_val.set_size(val_ptr->n_elements);
for (int i=0; i<val_ptr->n_elements; i++) {
if (val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[(i+rc)%val_ptr->n_elements] =new FreqHopGroups(*val_ptr->value_elements[i]);
}
}
return ret_val;
}

FreqHopConfig FreqHopConfig::operator+(const FreqHopConfig& other_value) const
{
if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @BTS_Tests.FreqHopConfig concatenation.");
if (val_ptr->n_elements == 0) return other_value;
if (other_value.val_ptr->n_elements == 0) return *this;
FreqHopConfig ret_val;
ret_val.set_size(val_ptr->n_elements+other_value.val_ptr->n_elements);
for (int i=0; i<val_ptr->n_elements; i++) {
if (val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i] = new FreqHopGroups(*val_ptr->value_elements[i]);
}
}
for (int i=0; i<other_value.val_ptr->n_elements; i++) {
if (other_value.val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i+val_ptr->n_elements] = new FreqHopGroups(*other_value.val_ptr->value_elements[i]);
}
}
return ret_val;
}

FreqHopConfig FreqHopConfig::substr(int index, int returncount) const
{
if (val_ptr == NULL) TTCN_error("The first argument of substr() is an unbound value of type @BTS_Tests.FreqHopConfig.");
check_substr_arguments(val_ptr->n_elements, index, returncount, "@BTS_Tests.FreqHopConfig","element");
FreqHopConfig ret_val;
ret_val.set_size(returncount);
for (int i=0; i<returncount; i++) {
if (val_ptr->value_elements[i+index] != NULL) {
ret_val.val_ptr->value_elements[i] = new FreqHopGroups(*val_ptr->value_elements[i+index]);
}
}
return ret_val;
}

FreqHopConfig FreqHopConfig::replace(int index, int len, const FreqHopConfig& repl) const
{
if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @BTS_Tests.FreqHopConfig.");
if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @BTS_Tests.FreqHopConfig.");
check_replace_arguments(val_ptr->n_elements, index, len, "@BTS_Tests.FreqHopConfig","element");
FreqHopConfig ret_val;
ret_val.set_size(val_ptr->n_elements + repl.val_ptr->n_elements - len);
for (int i = 0; i < index; i++) {
if (val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i] = new FreqHopGroups(*val_ptr->value_elements[i]);
}
}
for (int i = 0; i < repl.val_ptr->n_elements; i++) {
if (repl.val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i+index] = new FreqHopGroups(*repl.val_ptr->value_elements[i]);
}
}
for (int i = 0; i < val_ptr->n_elements - index - len; i++) {
if (val_ptr->value_elements[index+i+len] != NULL) {
ret_val.val_ptr->value_elements[index+i+repl.val_ptr->n_elements] = new FreqHopGroups(*val_ptr->value_elements[index+i+len]);
}
}
return ret_val;
}

FreqHopConfig FreqHopConfig::replace(int index, int len, const FreqHopConfig_template& repl) const
{
if (!repl.is_value()) TTCN_error("The fourth argument of function replace() is a template with non-specific value.");
return replace(index, len, repl.valueof());
}

void FreqHopConfig::set_size(int new_size)
{
if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @BTS_Tests.FreqHopConfig.");
if (val_ptr == NULL) {
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
} else if (val_ptr->ref_count > 1) {
struct recordof_setof_struct *new_val_ptr = new recordof_setof_struct;
new_val_ptr->ref_count = 1;
new_val_ptr->n_elements = (new_size < val_ptr->n_elements) ? new_size : val_ptr->n_elements;
new_val_ptr->value_elements = (FreqHopGroups**)allocate_pointers(new_val_ptr->n_elements);
for (int elem_count = 0; elem_count < new_val_ptr->n_elements; elem_count++) {
if (val_ptr->value_elements[elem_count] != NULL){
new_val_ptr->value_elements[elem_count] = new FreqHopGroups(*(val_ptr->value_elements[elem_count]));
}
}
clean_up();
val_ptr = new_val_ptr;
}
if (new_size > val_ptr->n_elements) {
val_ptr->value_elements = (FreqHopGroups**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size);
#ifdef TITAN_MEMORY_DEBUG_SET_RECORD_OF
if((val_ptr->n_elements/1000)!=(new_size/1000)) TTCN_warning("New size of type @BTS_Tests.FreqHopConfig: %d",new_size);
#endif
val_ptr->n_elements = new_size;
} else if (new_size < val_ptr->n_elements) {
for (int elem_count = new_size; elem_count < val_ptr->n_elements; elem_count++)
if (val_ptr->value_elements[elem_count] != NULL)delete val_ptr->value_elements[elem_count];
val_ptr->value_elements = (FreqHopGroups**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size);
val_ptr->n_elements = new_size;
}
}

boolean FreqHopConfig::is_value() const
{
if (val_ptr == NULL) return FALSE;
for(int i = 0; i < val_ptr->n_elements; ++i) {
if (val_ptr->value_elements[i] == NULL || !val_ptr->value_elements[i]->is_value()) return FALSE;
}
return TRUE;
}

int FreqHopConfig::size_of() const
{
if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @BTS_Tests.FreqHopConfig.");
return val_ptr->n_elements;
}

int FreqHopConfig::lengthof() const
{
if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @BTS_Tests.FreqHopConfig.");
for (int my_length=val_ptr->n_elements; my_length>0; my_length--) if (val_ptr->value_elements[my_length-1] != NULL) return my_length;
return 0;
}

void FreqHopConfig::log() const
{
if (val_ptr == NULL) {;
TTCN_Logger::log_event_unbound();
return;
}
switch (val_ptr->n_elements) {
case 0:
TTCN_Logger::log_event_str("{ }");
break;
default:
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
(*this)[elem_count].log();
}
TTCN_Logger::log_event_str(" }");
}
}

void FreqHopConfig::set_implicit_omit()
{
if (val_ptr == NULL) return;
for (int i = 0; i < val_ptr->n_elements; i++) {
if (val_ptr->value_elements[i] != NULL) val_ptr->value_elements[i]->set_implicit_omit();
}
}

void FreqHopConfig::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE|Module_Param::BC_LIST, "record of value");
  switch (param.get_operation_type()) {
  case Module_Param::OT_ASSIGN:
    if (param.get_type()==Module_Param::MP_Value_List && param.get_size()==0) {
      *this = NULL_VALUE;
      return;
    }
    switch (param.get_type()) {
    case Module_Param::MP_Value_List:
      set_size(param.get_size());
      for (size_t i=0; i<param.get_size(); ++i) {
        Module_Param* const curr = param.get_elem(i);
        if (curr->get_type()!=Module_Param::MP_NotUsed) {
          (*this)[i].set_param(*curr);
          if (!(*this)[i].is_bound()) {
            delete val_ptr->value_elements[i];
            val_ptr->value_elements[i] = NULL;
          }
        }
      }
      break;
    case Module_Param::MP_Indexed_List:
      for (size_t i=0; i<param.get_size(); ++i) {
        Module_Param* const curr = param.get_elem(i);
        (*this)[curr->get_id()->get_index()].set_param(*curr);
        if (!(*this)[curr->get_id()->get_index()].is_bound()) {
          delete val_ptr->value_elements[curr->get_id()->get_index()];
          val_ptr->value_elements[curr->get_id()->get_index()] = NULL;
        }
      }
      break;
    default:
      param.type_error("record of value", "@BTS_Tests.FreqHopConfig");
    }
    break;
  case Module_Param::OT_CONCAT:
    switch (param.get_type()) {
    case Module_Param::MP_Value_List: {
      if (!is_bound()) *this = NULL_VALUE;
      int start_idx = lengthof();
      for (size_t i=0; i<param.get_size(); ++i) {
        Module_Param* const curr = param.get_elem(i);
        if ((curr->get_type()!=Module_Param::MP_NotUsed)) {
          (*this)[start_idx+(int)i].set_param(*curr);
        }
      }
    } break;
    case Module_Param::MP_Indexed_List:
      param.error("Cannot concatenate an indexed value list");
      break;
    default:
      param.type_error("record of value", "@BTS_Tests.FreqHopConfig");
    }
    break;
  default:
    TTCN_error("Internal error: Unknown operation type.");
  }
}

void FreqHopConfig::encode_text(Text_Buf& text_buf) const
{
if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @BTS_Tests.FreqHopConfig.");
text_buf.push_int(val_ptr->n_elements);
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++)
(*this)[elem_count].encode_text(text_buf);
}

void FreqHopConfig::decode_text(Text_Buf& text_buf)
{
clean_up();
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = text_buf.pull_int().get_val();
if (val_ptr->n_elements < 0) TTCN_error("Text decoder: Negative size was received for a value of type @BTS_Tests.FreqHopConfig.");
val_ptr->value_elements = (FreqHopGroups**)allocate_pointers(val_ptr->n_elements);
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) {
val_ptr->value_elements[elem_count] = new FreqHopGroups;
val_ptr->value_elements[elem_count]->decode_text(text_buf);
}
}

void FreqHopConfig_template::copy_value(const FreqHopConfig& other_value)
{
if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @BTS_Tests.FreqHopConfig with an unbound value.");
single_value.n_elements = other_value.size_of();
single_value.value_elements = (FreqHopGroups_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (other_value[elem_count].is_bound()) {
single_value.value_elements[elem_count] = new FreqHopGroups_template(other_value[elem_count]);
} else {
single_value.value_elements[elem_count] = new FreqHopGroups_template;
}
}
set_selection(SPECIFIC_VALUE);
}

void FreqHopConfig_template::copy_template(const FreqHopConfig_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value.n_elements = other_value.single_value.n_elements;
single_value.value_elements = (FreqHopGroups_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (UNINITIALIZED_TEMPLATE != other_value.single_value.value_elements[elem_count]->get_selection()) {
single_value.value_elements[elem_count] = new FreqHopGroups_template(*other_value.single_value.value_elements[elem_count]);
} else {
single_value.value_elements[elem_count] = new FreqHopGroups_template;
}
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new FreqHopConfig_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new FreqHopConfig_template(*other_value.implication_.precondition);
implication_.implied_template = new FreqHopConfig_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BTS_Tests.FreqHopConfig.");
break;
}
set_selection(other_value);
}

boolean FreqHopConfig_template::match_function_specific(const Base_Type *value_ptr, int value_index, const Restricted_Length_Template *template_ptr, int template_index, boolean legacy)
{
if (value_index >= 0) return ((const FreqHopConfig_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const FreqHopConfig*)value_ptr)[value_index], legacy);
else return ((const FreqHopConfig_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit();
}

FreqHopConfig_template::FreqHopConfig_template()
{
}

FreqHopConfig_template::FreqHopConfig_template(template_sel other_value)
 : Base_Record_Of_Template(other_value)
{
check_single_selection(other_value);
}

FreqHopConfig_template::FreqHopConfig_template(null_type)
 : Base_Record_Of_Template(SPECIFIC_VALUE)
{
single_value.n_elements = 0;
single_value.value_elements = NULL;
}

FreqHopConfig_template::FreqHopConfig_template(const FreqHopConfig& other_value)
{
copy_value(other_value);
}

FreqHopConfig_template::FreqHopConfig_template(const OPTIONAL<FreqHopConfig>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const FreqHopConfig&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BTS_Tests.FreqHopConfig from an unbound optional field.");
}
}

FreqHopConfig_template::FreqHopConfig_template(FreqHopConfig_template* p_precondition, FreqHopConfig_template* p_implied_template)
 : Base_Record_Of_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

FreqHopConfig_template::FreqHopConfig_template(Dynamic_Match_Interface<FreqHopConfig>* p_dyn_match)
 : Base_Record_Of_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<FreqHopConfig>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

FreqHopConfig_template::FreqHopConfig_template(const FreqHopConfig_template& other_value)
 : Base_Record_Of_Template()
{
copy_template(other_value);
}

FreqHopConfig_template::~FreqHopConfig_template()
{
clean_up();
}

void FreqHopConfig_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
delete single_value.value_elements[elem_count];
free_pointers((void**)single_value.value_elements);
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

FreqHopConfig_template& FreqHopConfig_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

FreqHopConfig_template& FreqHopConfig_template::operator=(null_type)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value.n_elements = 0;
single_value.value_elements = NULL;
return *this;
}

FreqHopConfig_template& FreqHopConfig_template::operator=(const FreqHopConfig& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

FreqHopConfig_template& FreqHopConfig_template::operator=(const OPTIONAL<FreqHopConfig>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const FreqHopConfig&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @BTS_Tests.FreqHopConfig.");
}
return *this;
}

FreqHopConfig_template& FreqHopConfig_template::operator=(const FreqHopConfig_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

FreqHopGroups_template& FreqHopConfig_template::operator[](int index_value)
{
if (index_value < 0) TTCN_error("Accessing an element of a template for type @BTS_Tests.FreqHopConfig using a negative index: %d.", index_value);
switch (template_selection)
{
  case SPECIFIC_VALUE:
    if(index_value < single_value.n_elements) break;
    // no break
  case OMIT_VALUE:
  case ANY_VALUE:
  case ANY_OR_OMIT:
  case UNINITIALIZED_TEMPLATE:
    set_size(index_value + 1);
    break;
  default:
    TTCN_error("Accessing an element of a non-specific template for type @BTS_Tests.FreqHopConfig.");
    break;
}
return *single_value.value_elements[index_value];
}

FreqHopGroups_template& FreqHopConfig_template::operator[](const INTEGER& index_value)
{
index_value.must_bound("Using an unbound integer value for indexing a template of type @BTS_Tests.FreqHopConfig.");
return (*this)[(int)index_value];
}

const FreqHopGroups_template& FreqHopConfig_template::operator[](int index_value) const
{
if (index_value < 0) TTCN_error("Accessing an element of a template for type @BTS_Tests.FreqHopConfig using a negative index: %d.", index_value);
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing an element of a non-specific template for type @BTS_Tests.FreqHopConfig.");
if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @BTS_Tests.FreqHopConfig: The index is %d, but the template has only %d elements.", index_value, single_value.n_elements);
return *single_value.value_elements[index_value];
}

const FreqHopGroups_template& FreqHopConfig_template::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a template of type @BTS_Tests.FreqHopConfig.");
return (*this)[(int)index_value];
}

void FreqHopConfig_template::set_size(int new_size)
{
if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a template of type @BTS_Tests.FreqHopConfig.");
template_sel old_selection = template_selection;
if (old_selection != SPECIFIC_VALUE) {
clean_up();
set_selection(SPECIFIC_VALUE);
single_value.n_elements = 0;
single_value.value_elements = NULL;
}
if (new_size > single_value.n_elements) {
single_value.value_elements = (FreqHopGroups_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
for (int elem_count = single_value.n_elements; elem_count < new_size; elem_count++)
single_value.value_elements[elem_count] = new FreqHopGroups_template(ANY_VALUE);
} else {
for (int elem_count = single_value.n_elements; elem_count < new_size; elem_count++)
single_value.value_elements[elem_count] = new FreqHopGroups_template;
}
single_value.n_elements = new_size;
} else if (new_size < single_value.n_elements) {
for (int elem_count = new_size; elem_count < single_value.n_elements; elem_count++)
delete single_value.value_elements[elem_count];
single_value.value_elements = (FreqHopGroups_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size);
single_value.n_elements = new_size;
}
}

int FreqHopConfig_template::n_elem() const
{
  switch (template_selection) {
  case SPECIFIC_VALUE:
    return single_value.n_elements;
    break;
  case VALUE_LIST:
    return value_list.n_values;
    break;
  default:
    TTCN_error("Performing n_elem");
  }
}

int FreqHopConfig_template::size_of(boolean is_size) const
{
const char* op_name = is_size ? "size" : "length";
int min_size;
boolean has_any_or_none;
if (is_ifpresent) TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.FreqHopConfig which has an ifpresent attribute.", op_name);
switch (template_selection)
{
case SPECIFIC_VALUE: {
  min_size = 0;
  has_any_or_none = FALSE;
  int elem_count = single_value.n_elements;
  if (!is_size) { while (elem_count>0 && !single_value.value_elements[elem_count-1]->is_bound()) elem_count--; }
  for (int i=0; i<elem_count; i++) {
    switch (single_value.value_elements[i]->get_selection()) {
    case OMIT_VALUE:
      TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.FreqHopConfig containing omit element.", op_name);
    case ANY_OR_OMIT:
      has_any_or_none = TRUE;
      break;
    default:
      min_size++;
      break;
    }
  }
} break;
case OMIT_VALUE:
  TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.FreqHopConfig containing omit value.", op_name);
case ANY_VALUE:
case ANY_OR_OMIT:
  min_size = 0;
  has_any_or_none = TRUE;
  break;
case VALUE_LIST:
{
  if (value_list.n_values<1)
    TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.FreqHopConfig containing an empty list.", op_name);
  int item_size = value_list.list_value[0].size_of(is_size);
  for (unsigned int i = 1; i < value_list.n_values; i++) {
    if (value_list.list_value[i].size_of(is_size)!=item_size)
      TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.FreqHopConfig containing a value list with different sizes.", op_name);
  }
  min_size = item_size;
  has_any_or_none = FALSE;
  break;
}
case COMPLEMENTED_LIST:
  TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.FreqHopConfig containing complemented list.", op_name);
default:
  TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @BTS_Tests.FreqHopConfig.", op_name);
}
return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @BTS_Tests.FreqHopConfig");
}

boolean FreqHopConfig_template::match(const FreqHopConfig& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
int value_length = other_value.size_of();
if (!match_length(value_length)) return FALSE;
switch (template_selection) {
case SPECIFIC_VALUE:
return match_record_of(&other_value, value_length, this, single_value.n_elements, match_function_specific, legacy);
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching with an uninitialized/unsupported template of type @BTS_Tests.FreqHopConfig.");
}
return FALSE;
}

boolean FreqHopConfig_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
if (!single_value.value_elements[elem_count]->is_value()) return FALSE;
return TRUE;
}

FreqHopConfig FreqHopConfig_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of type @BTS_Tests.FreqHopConfig.");
FreqHopConfig ret_val;
ret_val.set_size(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
if (single_value.value_elements[elem_count]->is_bound()) {
ret_val[elem_count] = single_value.value_elements[elem_count]->valueof();
}
return ret_val;
}

FreqHopConfig FreqHopConfig_template::substr(int index, int returncount) const
{
if (!is_value()) TTCN_error("The first argument of function substr() is a template with non-specific value.");
return valueof().substr(index, returncount);
}

FreqHopConfig FreqHopConfig_template::replace(int index, int len, const FreqHopConfig_template& repl) const
{
if (!is_value()) TTCN_error("The first argument of function replace() is a template with non-specific value.");
if (!repl.is_value()) TTCN_error("The fourth argument of function replace() is a template with non-specific value.");
return valueof().replace(index, len, repl.valueof());
}

FreqHopConfig FreqHopConfig_template::replace(int index, int len, const FreqHopConfig& repl) const
{
if (!is_value()) TTCN_error("The first argument of function replace() is a template with non-specific value.");
return valueof().replace(index, len, repl);
}

void FreqHopConfig_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = list_length;
value_list.list_value = new FreqHopConfig_template[list_length];
break;
default:
TTCN_error("Internal error: Setting an invalid type for a template of type @BTS_Tests.FreqHopConfig.");
}
set_selection(template_type);
}

FreqHopConfig_template& FreqHopConfig_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Internal error: Accessing a list element of a non-list template of type @BTS_Tests.FreqHopConfig.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @BTS_Tests.FreqHopConfig.");
return value_list.list_value[list_index];
}

void FreqHopConfig_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.n_elements > 0) {
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
if (permutation_starts_at(elem_count)) TTCN_Logger::log_event_str("permutation(");
single_value.value_elements[elem_count]->log();
if (permutation_ends_at(elem_count)) TTCN_Logger::log_char(')');
}
TTCN_Logger::log_event_str(" }");
} else TTCN_Logger::log_event_str("{ }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_restricted();
log_ifpresent();
}

void FreqHopConfig_template::log_match(const FreqHopConfig& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
}else{
if (template_selection == SPECIFIC_VALUE && single_value.n_elements > 0 && get_number_of_permutations() == 0 && single_value.n_elements == match_value.size_of()) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if(!single_value.value_elements[elem_count]->match(match_value[elem_count], legacy)){
TTCN_Logger::log_logmatch_info("[%d]", elem_count);
single_value.value_elements[elem_count]->log_match(match_value[elem_count], legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
log_match_length(single_value.n_elements);
} else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE && single_value.n_elements > 0 && get_number_of_permutations() == 0 && single_value.n_elements == match_value.size_of()) {
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
single_value.value_elements[elem_count]->log_match(match_value[elem_count], legacy);
}
TTCN_Logger::log_event_str(" }");
log_match_length(single_value.n_elements);
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void FreqHopConfig_template::encode_text(Text_Buf& text_buf) const
{
encode_text_permutation(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
single_value.value_elements[elem_count]->encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BTS_Tests.FreqHopConfig.");
}
}

void FreqHopConfig_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_permutation(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value.n_elements = text_buf.pull_int().get_val();
if (single_value.n_elements < 0) TTCN_error("Text decoder: Negative size was received for a template of type @BTS_Tests.FreqHopConfig.");
single_value.value_elements = (FreqHopGroups_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
single_value.value_elements[elem_count] = new FreqHopGroups_template;
single_value.value_elements[elem_count]->decode_text(text_buf);
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new FreqHopConfig_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of type @BTS_Tests.FreqHopConfig.");
}
}

boolean FreqHopConfig_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean FreqHopConfig_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void FreqHopConfig_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
for (int i = 0; i < single_value.n_elements; i++) {
if (single_value.value_elements[i] != NULL) single_value.value_elements[i]->set_implicit_omit();
}
}

void FreqHopConfig_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE|Module_Param::BC_LIST, "record of template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    FreqHopConfig_template temp;
    temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = temp;
    break; }
  case Module_Param::MP_Indexed_List:
    if (template_selection!=SPECIFIC_VALUE) set_size(0);
    for (size_t p_i=0; p_i<param.get_size(); ++p_i) {
      (*this)[(int)(param.get_elem(p_i)->get_id()->get_index())].set_param(*param.get_elem(p_i));
    }
    break;
  case Module_Param::MP_Value_List: {
    set_size(param.get_size());
    int curr_idx = 0;
    for (size_t p_i=0; p_i<param.get_size(); ++p_i) {
      switch (param.get_elem(p_i)->get_type()) {
      case Module_Param::MP_NotUsed:
        curr_idx++;
        break;
      case Module_Param::MP_Permutation_Template: {
        int perm_start_idx = curr_idx;
        Module_Param* param_i = param.get_elem(p_i);
        for (size_t perm_i=0; perm_i<param_i->get_size(); perm_i++) {
          (*this)[curr_idx].set_param(*(param_i->get_elem(perm_i)));
          curr_idx++;
        }
        int perm_end_idx = curr_idx - 1;
        add_permutation(perm_start_idx, perm_end_idx);
      } break;
      default:
        (*this)[curr_idx].set_param(*param.get_elem(p_i));
        curr_idx++;
      }
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    FreqHopConfig_template* precondition = new FreqHopConfig_template;
    precondition->set_param(*param.get_elem(0));
    FreqHopConfig_template* implied_template = new FreqHopConfig_template;
    implied_template->set_param(*param.get_elem(1));
    *this = FreqHopConfig_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record of template", "@BTS_Tests.FreqHopConfig");
  }
  is_ifpresent = param.get_ifpresent();
  set_length_range(param);
}

void FreqHopConfig_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
for (int i=0; i<single_value.n_elements; i++) single_value.value_elements[i]->check_restriction(t_res, t_name ? t_name : "@BTS_Tests.FreqHopConfig");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@BTS_Tests.FreqHopConfig");
}

boolean FreqHopConfig_template::get_istemplate_kind(const char* type) const {
if (!strcmp(type, "AnyElement")) {
  if (template_selection != SPECIFIC_VALUE) {
    return FALSE;
  }
  for (int i = 0; i < single_value.n_elements; i++) {
    if (single_value.value_elements[i]->get_selection() == ANY_VALUE) {
      return TRUE;
    }
  }
  return FALSE;
} else if (!strcmp(type, "AnyElementsOrNone")) {
  if (template_selection != SPECIFIC_VALUE) {
    return FALSE;
  }
  for (int i = 0; i < single_value.n_elements; i++) {
    if (single_value.value_elements[i]->get_selection() == ANY_OR_OMIT) {
      return TRUE;
    }
  }
  return FALSE;
} else if (!strcmp(type, "permutation")) {
  return number_of_permutations;
} else if (!strcmp(type, "length")) {
  return length_restriction_type != NO_LENGTH_RESTRICTION;
} else {
  return Base_Template::get_istemplate_kind(type);
}
}

const FreqHopGroup FreqHopGroups::UNBOUND_ELEM;
FreqHopGroups::FreqHopGroups()
{
val_ptr = NULL;
}

FreqHopGroups::FreqHopGroups(null_type)
{
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
}

FreqHopGroups::FreqHopGroups(const FreqHopGroups& other_value)
{
if (!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BTS_Tests.FreqHopGroups.");
val_ptr = other_value.val_ptr;
val_ptr->ref_count++;
}

FreqHopGroups::~FreqHopGroups()
{
clean_up();
if (val_ptr != NULL) val_ptr = NULL;
}

void FreqHopGroups::clean_up()
{
if (val_ptr != NULL) {
if (val_ptr->ref_count > 1) {
val_ptr->ref_count--;
val_ptr = NULL;
}
else if (val_ptr->ref_count == 1) {
for (int elem_count = 0; elem_count < val_ptr->n_elements;
elem_count++)
if (val_ptr->value_elements[elem_count] != NULL)
delete val_ptr->value_elements[elem_count];
free_pointers((void**)val_ptr->value_elements);
delete val_ptr;
val_ptr = NULL;
}
else
TTCN_error("Internal error: Invalid reference counter in a record of/set of value.");
}
}

FreqHopGroups& FreqHopGroups::operator=(null_type)
{
clean_up();
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
return *this;
}

FreqHopGroups& FreqHopGroups::operator=(const FreqHopGroups& other_value)
{
if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @BTS_Tests.FreqHopGroups.");
if (this != &other_value) {
clean_up();
val_ptr = other_value.val_ptr;
val_ptr->ref_count++;
}
return *this;
}

boolean FreqHopGroups::operator==(null_type) const
{
if (val_ptr == NULL)
TTCN_error("The left operand of comparison is an unbound value of type @BTS_Tests.FreqHopGroups.");
return val_ptr->n_elements == 0 ;
}

boolean FreqHopGroups::operator==(const FreqHopGroups& other_value) const
{
if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @BTS_Tests.FreqHopGroups.");
if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @BTS_Tests.FreqHopGroups.");
if (val_ptr == other_value.val_ptr) return TRUE;
if (val_ptr->n_elements != (other_value.val_ptr)->n_elements)
return FALSE;
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++){
if (val_ptr->value_elements[elem_count] != NULL){
if ((other_value.val_ptr)->value_elements[elem_count] != NULL){
  if (*val_ptr->value_elements[elem_count] != *(other_value.val_ptr)->value_elements[elem_count]) return FALSE;
} else return FALSE;
} else {
if ((other_value.val_ptr)->value_elements[elem_count] != NULL) return FALSE;
}
}
return TRUE;
}

FreqHopGroup& FreqHopGroups::operator[](int index_value)
{
if (index_value < 0) TTCN_error("Accessing an element of type @BTS_Tests.FreqHopGroups using a negative index: %d.", index_value);
if (val_ptr == NULL) {
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
} else if (val_ptr->ref_count > 1) {
struct recordof_setof_struct *new_val_ptr = new recordof_setof_struct;
new_val_ptr->ref_count = 1;
new_val_ptr->n_elements = (index_value >= val_ptr->n_elements) ? index_value + 1 : val_ptr->n_elements;
new_val_ptr->value_elements = (FreqHopGroup**)allocate_pointers(new_val_ptr->n_elements);
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++){
if (val_ptr->value_elements[elem_count] != NULL){
new_val_ptr->value_elements[elem_count] = new FreqHopGroup(*(val_ptr->value_elements[elem_count]));
}
}
clean_up();
val_ptr = new_val_ptr;
}
if (index_value >= val_ptr->n_elements) set_size(index_value + 1);
if (val_ptr->value_elements[index_value] == NULL) {
val_ptr->value_elements[index_value] = new FreqHopGroup;
}
return *val_ptr->value_elements[index_value];
}

FreqHopGroup& FreqHopGroups::operator[](const INTEGER& index_value)
{
index_value.must_bound("Using an unbound integer value for indexing a value of type @BTS_Tests.FreqHopGroups.");
return (*this)[(int)index_value];
}

const FreqHopGroup& FreqHopGroups::operator[](int index_value) const
{
if (val_ptr == NULL)
TTCN_error("Accessing an element in an unbound value of type @BTS_Tests.FreqHopGroups.");
if (index_value < 0) TTCN_error("Accessing an element of type @BTS_Tests.FreqHopGroups using a negative index: %d.", index_value);
if (index_value >= val_ptr->n_elements) TTCN_error("Index overflow in a value of type @BTS_Tests.FreqHopGroups: The index is %d, but the value has only %d elements.", index_value, val_ptr->n_elements);
return (val_ptr->value_elements[index_value] == NULL) ?
UNBOUND_ELEM : *val_ptr->value_elements[index_value];
}

const FreqHopGroup& FreqHopGroups::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a value of type @BTS_Tests.FreqHopGroups.");
return (*this)[(int)index_value];
}

FreqHopGroups FreqHopGroups::operator<<=(int rotate_count) const
{
return *this >>= (-rotate_count);
}

FreqHopGroups FreqHopGroups::operator<<=(const INTEGER& rotate_count) const
{
rotate_count.must_bound("Unbound integer operand of rotate left operator.");
return *this >>= (int)(-rotate_count);
}

FreqHopGroups FreqHopGroups::operator>>=(const INTEGER& rotate_count) const
{
rotate_count.must_bound("Unbound integer operand of rotate right operator.");
return *this >>= (int)rotate_count;
}

FreqHopGroups FreqHopGroups::operator>>=(int rotate_count) const
{
if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @BTS_Tests.FreqHopGroups.");
if (val_ptr->n_elements == 0) return *this;
int rc;
if (rotate_count>=0) rc = rotate_count % val_ptr->n_elements;
else rc = val_ptr->n_elements - ((-rotate_count) % val_ptr->n_elements);
if (rc == 0) return *this;
FreqHopGroups ret_val;
ret_val.set_size(val_ptr->n_elements);
for (int i=0; i<val_ptr->n_elements; i++) {
if (val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[(i+rc)%val_ptr->n_elements] =new FreqHopGroup(*val_ptr->value_elements[i]);
}
}
return ret_val;
}

FreqHopGroups FreqHopGroups::operator+(const FreqHopGroups& other_value) const
{
if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @BTS_Tests.FreqHopGroups concatenation.");
if (val_ptr->n_elements == 0) return other_value;
if (other_value.val_ptr->n_elements == 0) return *this;
FreqHopGroups ret_val;
ret_val.set_size(val_ptr->n_elements+other_value.val_ptr->n_elements);
for (int i=0; i<val_ptr->n_elements; i++) {
if (val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i] = new FreqHopGroup(*val_ptr->value_elements[i]);
}
}
for (int i=0; i<other_value.val_ptr->n_elements; i++) {
if (other_value.val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i+val_ptr->n_elements] = new FreqHopGroup(*other_value.val_ptr->value_elements[i]);
}
}
return ret_val;
}

FreqHopGroups FreqHopGroups::substr(int index, int returncount) const
{
if (val_ptr == NULL) TTCN_error("The first argument of substr() is an unbound value of type @BTS_Tests.FreqHopGroups.");
check_substr_arguments(val_ptr->n_elements, index, returncount, "@BTS_Tests.FreqHopGroups","element");
FreqHopGroups ret_val;
ret_val.set_size(returncount);
for (int i=0; i<returncount; i++) {
if (val_ptr->value_elements[i+index] != NULL) {
ret_val.val_ptr->value_elements[i] = new FreqHopGroup(*val_ptr->value_elements[i+index]);
}
}
return ret_val;
}

FreqHopGroups FreqHopGroups::replace(int index, int len, const FreqHopGroups& repl) const
{
if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @BTS_Tests.FreqHopGroups.");
if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @BTS_Tests.FreqHopGroups.");
check_replace_arguments(val_ptr->n_elements, index, len, "@BTS_Tests.FreqHopGroups","element");
FreqHopGroups ret_val;
ret_val.set_size(val_ptr->n_elements + repl.val_ptr->n_elements - len);
for (int i = 0; i < index; i++) {
if (val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i] = new FreqHopGroup(*val_ptr->value_elements[i]);
}
}
for (int i = 0; i < repl.val_ptr->n_elements; i++) {
if (repl.val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i+index] = new FreqHopGroup(*repl.val_ptr->value_elements[i]);
}
}
for (int i = 0; i < val_ptr->n_elements - index - len; i++) {
if (val_ptr->value_elements[index+i+len] != NULL) {
ret_val.val_ptr->value_elements[index+i+repl.val_ptr->n_elements] = new FreqHopGroup(*val_ptr->value_elements[index+i+len]);
}
}
return ret_val;
}

FreqHopGroups FreqHopGroups::replace(int index, int len, const FreqHopGroups_template& repl) const
{
if (!repl.is_value()) TTCN_error("The fourth argument of function replace() is a template with non-specific value.");
return replace(index, len, repl.valueof());
}

void FreqHopGroups::set_size(int new_size)
{
if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @BTS_Tests.FreqHopGroups.");
if (val_ptr == NULL) {
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
} else if (val_ptr->ref_count > 1) {
struct recordof_setof_struct *new_val_ptr = new recordof_setof_struct;
new_val_ptr->ref_count = 1;
new_val_ptr->n_elements = (new_size < val_ptr->n_elements) ? new_size : val_ptr->n_elements;
new_val_ptr->value_elements = (FreqHopGroup**)allocate_pointers(new_val_ptr->n_elements);
for (int elem_count = 0; elem_count < new_val_ptr->n_elements; elem_count++) {
if (val_ptr->value_elements[elem_count] != NULL){
new_val_ptr->value_elements[elem_count] = new FreqHopGroup(*(val_ptr->value_elements[elem_count]));
}
}
clean_up();
val_ptr = new_val_ptr;
}
if (new_size > val_ptr->n_elements) {
val_ptr->value_elements = (FreqHopGroup**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size);
#ifdef TITAN_MEMORY_DEBUG_SET_RECORD_OF
if((val_ptr->n_elements/1000)!=(new_size/1000)) TTCN_warning("New size of type @BTS_Tests.FreqHopGroups: %d",new_size);
#endif
val_ptr->n_elements = new_size;
} else if (new_size < val_ptr->n_elements) {
for (int elem_count = new_size; elem_count < val_ptr->n_elements; elem_count++)
if (val_ptr->value_elements[elem_count] != NULL)delete val_ptr->value_elements[elem_count];
val_ptr->value_elements = (FreqHopGroup**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size);
val_ptr->n_elements = new_size;
}
}

boolean FreqHopGroups::is_value() const
{
if (val_ptr == NULL) return FALSE;
for(int i = 0; i < val_ptr->n_elements; ++i) {
if (val_ptr->value_elements[i] == NULL || !val_ptr->value_elements[i]->is_value()) return FALSE;
}
return TRUE;
}

int FreqHopGroups::size_of() const
{
if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @BTS_Tests.FreqHopGroups.");
return val_ptr->n_elements;
}

int FreqHopGroups::lengthof() const
{
if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @BTS_Tests.FreqHopGroups.");
for (int my_length=val_ptr->n_elements; my_length>0; my_length--) if (val_ptr->value_elements[my_length-1] != NULL) return my_length;
return 0;
}

void FreqHopGroups::log() const
{
if (val_ptr == NULL) {;
TTCN_Logger::log_event_unbound();
return;
}
switch (val_ptr->n_elements) {
case 0:
TTCN_Logger::log_event_str("{ }");
break;
default:
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
(*this)[elem_count].log();
}
TTCN_Logger::log_event_str(" }");
}
}

void FreqHopGroups::set_implicit_omit()
{
if (val_ptr == NULL) return;
for (int i = 0; i < val_ptr->n_elements; i++) {
if (val_ptr->value_elements[i] != NULL) val_ptr->value_elements[i]->set_implicit_omit();
}
}

void FreqHopGroups::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE|Module_Param::BC_LIST, "record of value");
  switch (param.get_operation_type()) {
  case Module_Param::OT_ASSIGN:
    if (param.get_type()==Module_Param::MP_Value_List && param.get_size()==0) {
      *this = NULL_VALUE;
      return;
    }
    switch (param.get_type()) {
    case Module_Param::MP_Value_List:
      set_size(param.get_size());
      for (size_t i=0; i<param.get_size(); ++i) {
        Module_Param* const curr = param.get_elem(i);
        if (curr->get_type()!=Module_Param::MP_NotUsed) {
          (*this)[i].set_param(*curr);
          if (!(*this)[i].is_bound()) {
            delete val_ptr->value_elements[i];
            val_ptr->value_elements[i] = NULL;
          }
        }
      }
      break;
    case Module_Param::MP_Indexed_List:
      for (size_t i=0; i<param.get_size(); ++i) {
        Module_Param* const curr = param.get_elem(i);
        (*this)[curr->get_id()->get_index()].set_param(*curr);
        if (!(*this)[curr->get_id()->get_index()].is_bound()) {
          delete val_ptr->value_elements[curr->get_id()->get_index()];
          val_ptr->value_elements[curr->get_id()->get_index()] = NULL;
        }
      }
      break;
    default:
      param.type_error("record of value", "@BTS_Tests.FreqHopGroups");
    }
    break;
  case Module_Param::OT_CONCAT:
    switch (param.get_type()) {
    case Module_Param::MP_Value_List: {
      if (!is_bound()) *this = NULL_VALUE;
      int start_idx = lengthof();
      for (size_t i=0; i<param.get_size(); ++i) {
        Module_Param* const curr = param.get_elem(i);
        if ((curr->get_type()!=Module_Param::MP_NotUsed)) {
          (*this)[start_idx+(int)i].set_param(*curr);
        }
      }
    } break;
    case Module_Param::MP_Indexed_List:
      param.error("Cannot concatenate an indexed value list");
      break;
    default:
      param.type_error("record of value", "@BTS_Tests.FreqHopGroups");
    }
    break;
  default:
    TTCN_error("Internal error: Unknown operation type.");
  }
}

void FreqHopGroups::encode_text(Text_Buf& text_buf) const
{
if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @BTS_Tests.FreqHopGroups.");
text_buf.push_int(val_ptr->n_elements);
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++)
(*this)[elem_count].encode_text(text_buf);
}

void FreqHopGroups::decode_text(Text_Buf& text_buf)
{
clean_up();
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = text_buf.pull_int().get_val();
if (val_ptr->n_elements < 0) TTCN_error("Text decoder: Negative size was received for a value of type @BTS_Tests.FreqHopGroups.");
val_ptr->value_elements = (FreqHopGroup**)allocate_pointers(val_ptr->n_elements);
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) {
val_ptr->value_elements[elem_count] = new FreqHopGroup;
val_ptr->value_elements[elem_count]->decode_text(text_buf);
}
}

void FreqHopGroups_template::copy_value(const FreqHopGroups& other_value)
{
if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @BTS_Tests.FreqHopGroups with an unbound value.");
single_value.n_elements = other_value.size_of();
single_value.value_elements = (FreqHopGroup_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (other_value[elem_count].is_bound()) {
single_value.value_elements[elem_count] = new FreqHopGroup_template(other_value[elem_count]);
} else {
single_value.value_elements[elem_count] = new FreqHopGroup_template;
}
}
set_selection(SPECIFIC_VALUE);
}

void FreqHopGroups_template::copy_template(const FreqHopGroups_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value.n_elements = other_value.single_value.n_elements;
single_value.value_elements = (FreqHopGroup_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (UNINITIALIZED_TEMPLATE != other_value.single_value.value_elements[elem_count]->get_selection()) {
single_value.value_elements[elem_count] = new FreqHopGroup_template(*other_value.single_value.value_elements[elem_count]);
} else {
single_value.value_elements[elem_count] = new FreqHopGroup_template;
}
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new FreqHopGroups_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new FreqHopGroups_template(*other_value.implication_.precondition);
implication_.implied_template = new FreqHopGroups_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BTS_Tests.FreqHopGroups.");
break;
}
set_selection(other_value);
}

boolean FreqHopGroups_template::match_function_specific(const Base_Type *value_ptr, int value_index, const Restricted_Length_Template *template_ptr, int template_index, boolean legacy)
{
if (value_index >= 0) return ((const FreqHopGroups_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const FreqHopGroups*)value_ptr)[value_index], legacy);
else return ((const FreqHopGroups_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit();
}

FreqHopGroups_template::FreqHopGroups_template()
{
}

FreqHopGroups_template::FreqHopGroups_template(template_sel other_value)
 : Base_Record_Of_Template(other_value)
{
check_single_selection(other_value);
}

FreqHopGroups_template::FreqHopGroups_template(null_type)
 : Base_Record_Of_Template(SPECIFIC_VALUE)
{
single_value.n_elements = 0;
single_value.value_elements = NULL;
}

FreqHopGroups_template::FreqHopGroups_template(const FreqHopGroups& other_value)
{
copy_value(other_value);
}

FreqHopGroups_template::FreqHopGroups_template(const OPTIONAL<FreqHopGroups>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const FreqHopGroups&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BTS_Tests.FreqHopGroups from an unbound optional field.");
}
}

FreqHopGroups_template::FreqHopGroups_template(FreqHopGroups_template* p_precondition, FreqHopGroups_template* p_implied_template)
 : Base_Record_Of_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

FreqHopGroups_template::FreqHopGroups_template(Dynamic_Match_Interface<FreqHopGroups>* p_dyn_match)
 : Base_Record_Of_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<FreqHopGroups>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

FreqHopGroups_template::FreqHopGroups_template(const FreqHopGroups_template& other_value)
 : Base_Record_Of_Template()
{
copy_template(other_value);
}

FreqHopGroups_template::~FreqHopGroups_template()
{
clean_up();
}

void FreqHopGroups_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
delete single_value.value_elements[elem_count];
free_pointers((void**)single_value.value_elements);
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

FreqHopGroups_template& FreqHopGroups_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

FreqHopGroups_template& FreqHopGroups_template::operator=(null_type)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value.n_elements = 0;
single_value.value_elements = NULL;
return *this;
}

FreqHopGroups_template& FreqHopGroups_template::operator=(const FreqHopGroups& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

FreqHopGroups_template& FreqHopGroups_template::operator=(const OPTIONAL<FreqHopGroups>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const FreqHopGroups&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @BTS_Tests.FreqHopGroups.");
}
return *this;
}

FreqHopGroups_template& FreqHopGroups_template::operator=(const FreqHopGroups_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

FreqHopGroup_template& FreqHopGroups_template::operator[](int index_value)
{
if (index_value < 0) TTCN_error("Accessing an element of a template for type @BTS_Tests.FreqHopGroups using a negative index: %d.", index_value);
switch (template_selection)
{
  case SPECIFIC_VALUE:
    if(index_value < single_value.n_elements) break;
    // no break
  case OMIT_VALUE:
  case ANY_VALUE:
  case ANY_OR_OMIT:
  case UNINITIALIZED_TEMPLATE:
    set_size(index_value + 1);
    break;
  default:
    TTCN_error("Accessing an element of a non-specific template for type @BTS_Tests.FreqHopGroups.");
    break;
}
return *single_value.value_elements[index_value];
}

FreqHopGroup_template& FreqHopGroups_template::operator[](const INTEGER& index_value)
{
index_value.must_bound("Using an unbound integer value for indexing a template of type @BTS_Tests.FreqHopGroups.");
return (*this)[(int)index_value];
}

const FreqHopGroup_template& FreqHopGroups_template::operator[](int index_value) const
{
if (index_value < 0) TTCN_error("Accessing an element of a template for type @BTS_Tests.FreqHopGroups using a negative index: %d.", index_value);
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing an element of a non-specific template for type @BTS_Tests.FreqHopGroups.");
if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @BTS_Tests.FreqHopGroups: The index is %d, but the template has only %d elements.", index_value, single_value.n_elements);
return *single_value.value_elements[index_value];
}

const FreqHopGroup_template& FreqHopGroups_template::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a template of type @BTS_Tests.FreqHopGroups.");
return (*this)[(int)index_value];
}

void FreqHopGroups_template::set_size(int new_size)
{
if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a template of type @BTS_Tests.FreqHopGroups.");
template_sel old_selection = template_selection;
if (old_selection != SPECIFIC_VALUE) {
clean_up();
set_selection(SPECIFIC_VALUE);
single_value.n_elements = 0;
single_value.value_elements = NULL;
}
if (new_size > single_value.n_elements) {
single_value.value_elements = (FreqHopGroup_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
for (int elem_count = single_value.n_elements; elem_count < new_size; elem_count++)
single_value.value_elements[elem_count] = new FreqHopGroup_template(ANY_VALUE);
} else {
for (int elem_count = single_value.n_elements; elem_count < new_size; elem_count++)
single_value.value_elements[elem_count] = new FreqHopGroup_template;
}
single_value.n_elements = new_size;
} else if (new_size < single_value.n_elements) {
for (int elem_count = new_size; elem_count < single_value.n_elements; elem_count++)
delete single_value.value_elements[elem_count];
single_value.value_elements = (FreqHopGroup_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size);
single_value.n_elements = new_size;
}
}

int FreqHopGroups_template::n_elem() const
{
  switch (template_selection) {
  case SPECIFIC_VALUE:
    return single_value.n_elements;
    break;
  case VALUE_LIST:
    return value_list.n_values;
    break;
  default:
    TTCN_error("Performing n_elem");
  }
}

int FreqHopGroups_template::size_of(boolean is_size) const
{
const char* op_name = is_size ? "size" : "length";
int min_size;
boolean has_any_or_none;
if (is_ifpresent) TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.FreqHopGroups which has an ifpresent attribute.", op_name);
switch (template_selection)
{
case SPECIFIC_VALUE: {
  min_size = 0;
  has_any_or_none = FALSE;
  int elem_count = single_value.n_elements;
  if (!is_size) { while (elem_count>0 && !single_value.value_elements[elem_count-1]->is_bound()) elem_count--; }
  for (int i=0; i<elem_count; i++) {
    switch (single_value.value_elements[i]->get_selection()) {
    case OMIT_VALUE:
      TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.FreqHopGroups containing omit element.", op_name);
    case ANY_OR_OMIT:
      has_any_or_none = TRUE;
      break;
    default:
      min_size++;
      break;
    }
  }
} break;
case OMIT_VALUE:
  TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.FreqHopGroups containing omit value.", op_name);
case ANY_VALUE:
case ANY_OR_OMIT:
  min_size = 0;
  has_any_or_none = TRUE;
  break;
case VALUE_LIST:
{
  if (value_list.n_values<1)
    TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.FreqHopGroups containing an empty list.", op_name);
  int item_size = value_list.list_value[0].size_of(is_size);
  for (unsigned int i = 1; i < value_list.n_values; i++) {
    if (value_list.list_value[i].size_of(is_size)!=item_size)
      TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.FreqHopGroups containing a value list with different sizes.", op_name);
  }
  min_size = item_size;
  has_any_or_none = FALSE;
  break;
}
case COMPLEMENTED_LIST:
  TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.FreqHopGroups containing complemented list.", op_name);
default:
  TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @BTS_Tests.FreqHopGroups.", op_name);
}
return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @BTS_Tests.FreqHopGroups");
}

boolean FreqHopGroups_template::match(const FreqHopGroups& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
int value_length = other_value.size_of();
if (!match_length(value_length)) return FALSE;
switch (template_selection) {
case SPECIFIC_VALUE:
return match_record_of(&other_value, value_length, this, single_value.n_elements, match_function_specific, legacy);
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching with an uninitialized/unsupported template of type @BTS_Tests.FreqHopGroups.");
}
return FALSE;
}

boolean FreqHopGroups_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
if (!single_value.value_elements[elem_count]->is_value()) return FALSE;
return TRUE;
}

FreqHopGroups FreqHopGroups_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of type @BTS_Tests.FreqHopGroups.");
FreqHopGroups ret_val;
ret_val.set_size(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
if (single_value.value_elements[elem_count]->is_bound()) {
ret_val[elem_count] = single_value.value_elements[elem_count]->valueof();
}
return ret_val;
}

FreqHopGroups FreqHopGroups_template::substr(int index, int returncount) const
{
if (!is_value()) TTCN_error("The first argument of function substr() is a template with non-specific value.");
return valueof().substr(index, returncount);
}

FreqHopGroups FreqHopGroups_template::replace(int index, int len, const FreqHopGroups_template& repl) const
{
if (!is_value()) TTCN_error("The first argument of function replace() is a template with non-specific value.");
if (!repl.is_value()) TTCN_error("The fourth argument of function replace() is a template with non-specific value.");
return valueof().replace(index, len, repl.valueof());
}

FreqHopGroups FreqHopGroups_template::replace(int index, int len, const FreqHopGroups& repl) const
{
if (!is_value()) TTCN_error("The first argument of function replace() is a template with non-specific value.");
return valueof().replace(index, len, repl);
}

void FreqHopGroups_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = list_length;
value_list.list_value = new FreqHopGroups_template[list_length];
break;
default:
TTCN_error("Internal error: Setting an invalid type for a template of type @BTS_Tests.FreqHopGroups.");
}
set_selection(template_type);
}

FreqHopGroups_template& FreqHopGroups_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Internal error: Accessing a list element of a non-list template of type @BTS_Tests.FreqHopGroups.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @BTS_Tests.FreqHopGroups.");
return value_list.list_value[list_index];
}

void FreqHopGroups_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.n_elements > 0) {
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
if (permutation_starts_at(elem_count)) TTCN_Logger::log_event_str("permutation(");
single_value.value_elements[elem_count]->log();
if (permutation_ends_at(elem_count)) TTCN_Logger::log_char(')');
}
TTCN_Logger::log_event_str(" }");
} else TTCN_Logger::log_event_str("{ }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_restricted();
log_ifpresent();
}

void FreqHopGroups_template::log_match(const FreqHopGroups& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
}else{
if (template_selection == SPECIFIC_VALUE && single_value.n_elements > 0 && get_number_of_permutations() == 0 && single_value.n_elements == match_value.size_of()) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if(!single_value.value_elements[elem_count]->match(match_value[elem_count], legacy)){
TTCN_Logger::log_logmatch_info("[%d]", elem_count);
single_value.value_elements[elem_count]->log_match(match_value[elem_count], legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
log_match_length(single_value.n_elements);
} else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE && single_value.n_elements > 0 && get_number_of_permutations() == 0 && single_value.n_elements == match_value.size_of()) {
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
single_value.value_elements[elem_count]->log_match(match_value[elem_count], legacy);
}
TTCN_Logger::log_event_str(" }");
log_match_length(single_value.n_elements);
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void FreqHopGroups_template::encode_text(Text_Buf& text_buf) const
{
encode_text_permutation(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
single_value.value_elements[elem_count]->encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BTS_Tests.FreqHopGroups.");
}
}

void FreqHopGroups_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_permutation(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value.n_elements = text_buf.pull_int().get_val();
if (single_value.n_elements < 0) TTCN_error("Text decoder: Negative size was received for a template of type @BTS_Tests.FreqHopGroups.");
single_value.value_elements = (FreqHopGroup_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
single_value.value_elements[elem_count] = new FreqHopGroup_template;
single_value.value_elements[elem_count]->decode_text(text_buf);
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new FreqHopGroups_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of type @BTS_Tests.FreqHopGroups.");
}
}

boolean FreqHopGroups_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean FreqHopGroups_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void FreqHopGroups_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
for (int i = 0; i < single_value.n_elements; i++) {
if (single_value.value_elements[i] != NULL) single_value.value_elements[i]->set_implicit_omit();
}
}

void FreqHopGroups_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE|Module_Param::BC_LIST, "record of template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    FreqHopGroups_template temp;
    temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = temp;
    break; }
  case Module_Param::MP_Indexed_List:
    if (template_selection!=SPECIFIC_VALUE) set_size(0);
    for (size_t p_i=0; p_i<param.get_size(); ++p_i) {
      (*this)[(int)(param.get_elem(p_i)->get_id()->get_index())].set_param(*param.get_elem(p_i));
    }
    break;
  case Module_Param::MP_Value_List: {
    set_size(param.get_size());
    int curr_idx = 0;
    for (size_t p_i=0; p_i<param.get_size(); ++p_i) {
      switch (param.get_elem(p_i)->get_type()) {
      case Module_Param::MP_NotUsed:
        curr_idx++;
        break;
      case Module_Param::MP_Permutation_Template: {
        int perm_start_idx = curr_idx;
        Module_Param* param_i = param.get_elem(p_i);
        for (size_t perm_i=0; perm_i<param_i->get_size(); perm_i++) {
          (*this)[curr_idx].set_param(*(param_i->get_elem(perm_i)));
          curr_idx++;
        }
        int perm_end_idx = curr_idx - 1;
        add_permutation(perm_start_idx, perm_end_idx);
      } break;
      default:
        (*this)[curr_idx].set_param(*param.get_elem(p_i));
        curr_idx++;
      }
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    FreqHopGroups_template* precondition = new FreqHopGroups_template;
    precondition->set_param(*param.get_elem(0));
    FreqHopGroups_template* implied_template = new FreqHopGroups_template;
    implied_template->set_param(*param.get_elem(1));
    *this = FreqHopGroups_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record of template", "@BTS_Tests.FreqHopGroups");
  }
  is_ifpresent = param.get_ifpresent();
  set_length_range(param);
}

void FreqHopGroups_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
for (int i=0; i<single_value.n_elements; i++) single_value.value_elements[i]->check_restriction(t_res, t_name ? t_name : "@BTS_Tests.FreqHopGroups");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@BTS_Tests.FreqHopGroups");
}

boolean FreqHopGroups_template::get_istemplate_kind(const char* type) const {
if (!strcmp(type, "AnyElement")) {
  if (template_selection != SPECIFIC_VALUE) {
    return FALSE;
  }
  for (int i = 0; i < single_value.n_elements; i++) {
    if (single_value.value_elements[i]->get_selection() == ANY_VALUE) {
      return TRUE;
    }
  }
  return FALSE;
} else if (!strcmp(type, "AnyElementsOrNone")) {
  if (template_selection != SPECIFIC_VALUE) {
    return FALSE;
  }
  for (int i = 0; i < single_value.n_elements; i++) {
    if (single_value.value_elements[i]->get_selection() == ANY_OR_OMIT) {
      return TRUE;
    }
  }
  return FALSE;
} else if (!strcmp(type, "permutation")) {
  return number_of_permutations;
} else if (!strcmp(type, "length")) {
  return length_restriction_type != NO_LENGTH_RESTRICTION;
} else {
  return Base_Template::get_istemplate_kind(type);
}
}

const FreqHopGroupItem FreqHopGroupItems::UNBOUND_ELEM;
FreqHopGroupItems::FreqHopGroupItems()
{
val_ptr = NULL;
}

FreqHopGroupItems::FreqHopGroupItems(null_type)
{
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
}

FreqHopGroupItems::FreqHopGroupItems(const FreqHopGroupItems& other_value)
{
if (!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BTS_Tests.FreqHopGroupItems.");
val_ptr = other_value.val_ptr;
val_ptr->ref_count++;
}

FreqHopGroupItems::~FreqHopGroupItems()
{
clean_up();
if (val_ptr != NULL) val_ptr = NULL;
}

void FreqHopGroupItems::clean_up()
{
if (val_ptr != NULL) {
if (val_ptr->ref_count > 1) {
val_ptr->ref_count--;
val_ptr = NULL;
}
else if (val_ptr->ref_count == 1) {
for (int elem_count = 0; elem_count < val_ptr->n_elements;
elem_count++)
if (val_ptr->value_elements[elem_count] != NULL)
delete val_ptr->value_elements[elem_count];
free_pointers((void**)val_ptr->value_elements);
delete val_ptr;
val_ptr = NULL;
}
else
TTCN_error("Internal error: Invalid reference counter in a record of/set of value.");
}
}

FreqHopGroupItems& FreqHopGroupItems::operator=(null_type)
{
clean_up();
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
return *this;
}

FreqHopGroupItems& FreqHopGroupItems::operator=(const FreqHopGroupItems& other_value)
{
if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @BTS_Tests.FreqHopGroupItems.");
if (this != &other_value) {
clean_up();
val_ptr = other_value.val_ptr;
val_ptr->ref_count++;
}
return *this;
}

boolean FreqHopGroupItems::operator==(null_type) const
{
if (val_ptr == NULL)
TTCN_error("The left operand of comparison is an unbound value of type @BTS_Tests.FreqHopGroupItems.");
return val_ptr->n_elements == 0 ;
}

boolean FreqHopGroupItems::operator==(const FreqHopGroupItems& other_value) const
{
if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @BTS_Tests.FreqHopGroupItems.");
if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @BTS_Tests.FreqHopGroupItems.");
if (val_ptr == other_value.val_ptr) return TRUE;
if (val_ptr->n_elements != (other_value.val_ptr)->n_elements)
return FALSE;
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++){
if (val_ptr->value_elements[elem_count] != NULL){
if ((other_value.val_ptr)->value_elements[elem_count] != NULL){
  if (*val_ptr->value_elements[elem_count] != *(other_value.val_ptr)->value_elements[elem_count]) return FALSE;
} else return FALSE;
} else {
if ((other_value.val_ptr)->value_elements[elem_count] != NULL) return FALSE;
}
}
return TRUE;
}

FreqHopGroupItem& FreqHopGroupItems::operator[](int index_value)
{
if (index_value < 0) TTCN_error("Accessing an element of type @BTS_Tests.FreqHopGroupItems using a negative index: %d.", index_value);
if (val_ptr == NULL) {
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
} else if (val_ptr->ref_count > 1) {
struct recordof_setof_struct *new_val_ptr = new recordof_setof_struct;
new_val_ptr->ref_count = 1;
new_val_ptr->n_elements = (index_value >= val_ptr->n_elements) ? index_value + 1 : val_ptr->n_elements;
new_val_ptr->value_elements = (FreqHopGroupItem**)allocate_pointers(new_val_ptr->n_elements);
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++){
if (val_ptr->value_elements[elem_count] != NULL){
new_val_ptr->value_elements[elem_count] = new FreqHopGroupItem(*(val_ptr->value_elements[elem_count]));
}
}
clean_up();
val_ptr = new_val_ptr;
}
if (index_value >= val_ptr->n_elements) set_size(index_value + 1);
if (val_ptr->value_elements[index_value] == NULL) {
val_ptr->value_elements[index_value] = new FreqHopGroupItem;
}
return *val_ptr->value_elements[index_value];
}

FreqHopGroupItem& FreqHopGroupItems::operator[](const INTEGER& index_value)
{
index_value.must_bound("Using an unbound integer value for indexing a value of type @BTS_Tests.FreqHopGroupItems.");
return (*this)[(int)index_value];
}

const FreqHopGroupItem& FreqHopGroupItems::operator[](int index_value) const
{
if (val_ptr == NULL)
TTCN_error("Accessing an element in an unbound value of type @BTS_Tests.FreqHopGroupItems.");
if (index_value < 0) TTCN_error("Accessing an element of type @BTS_Tests.FreqHopGroupItems using a negative index: %d.", index_value);
if (index_value >= val_ptr->n_elements) TTCN_error("Index overflow in a value of type @BTS_Tests.FreqHopGroupItems: The index is %d, but the value has only %d elements.", index_value, val_ptr->n_elements);
return (val_ptr->value_elements[index_value] == NULL) ?
UNBOUND_ELEM : *val_ptr->value_elements[index_value];
}

const FreqHopGroupItem& FreqHopGroupItems::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a value of type @BTS_Tests.FreqHopGroupItems.");
return (*this)[(int)index_value];
}

FreqHopGroupItems FreqHopGroupItems::operator<<=(int rotate_count) const
{
return *this >>= (-rotate_count);
}

FreqHopGroupItems FreqHopGroupItems::operator<<=(const INTEGER& rotate_count) const
{
rotate_count.must_bound("Unbound integer operand of rotate left operator.");
return *this >>= (int)(-rotate_count);
}

FreqHopGroupItems FreqHopGroupItems::operator>>=(const INTEGER& rotate_count) const
{
rotate_count.must_bound("Unbound integer operand of rotate right operator.");
return *this >>= (int)rotate_count;
}

FreqHopGroupItems FreqHopGroupItems::operator>>=(int rotate_count) const
{
if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @BTS_Tests.FreqHopGroupItems.");
if (val_ptr->n_elements == 0) return *this;
int rc;
if (rotate_count>=0) rc = rotate_count % val_ptr->n_elements;
else rc = val_ptr->n_elements - ((-rotate_count) % val_ptr->n_elements);
if (rc == 0) return *this;
FreqHopGroupItems ret_val;
ret_val.set_size(val_ptr->n_elements);
for (int i=0; i<val_ptr->n_elements; i++) {
if (val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[(i+rc)%val_ptr->n_elements] =new FreqHopGroupItem(*val_ptr->value_elements[i]);
}
}
return ret_val;
}

FreqHopGroupItems FreqHopGroupItems::operator+(const FreqHopGroupItems& other_value) const
{
if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @BTS_Tests.FreqHopGroupItems concatenation.");
if (val_ptr->n_elements == 0) return other_value;
if (other_value.val_ptr->n_elements == 0) return *this;
FreqHopGroupItems ret_val;
ret_val.set_size(val_ptr->n_elements+other_value.val_ptr->n_elements);
for (int i=0; i<val_ptr->n_elements; i++) {
if (val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i] = new FreqHopGroupItem(*val_ptr->value_elements[i]);
}
}
for (int i=0; i<other_value.val_ptr->n_elements; i++) {
if (other_value.val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i+val_ptr->n_elements] = new FreqHopGroupItem(*other_value.val_ptr->value_elements[i]);
}
}
return ret_val;
}

FreqHopGroupItems FreqHopGroupItems::substr(int index, int returncount) const
{
if (val_ptr == NULL) TTCN_error("The first argument of substr() is an unbound value of type @BTS_Tests.FreqHopGroupItems.");
check_substr_arguments(val_ptr->n_elements, index, returncount, "@BTS_Tests.FreqHopGroupItems","element");
FreqHopGroupItems ret_val;
ret_val.set_size(returncount);
for (int i=0; i<returncount; i++) {
if (val_ptr->value_elements[i+index] != NULL) {
ret_val.val_ptr->value_elements[i] = new FreqHopGroupItem(*val_ptr->value_elements[i+index]);
}
}
return ret_val;
}

FreqHopGroupItems FreqHopGroupItems::replace(int index, int len, const FreqHopGroupItems& repl) const
{
if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @BTS_Tests.FreqHopGroupItems.");
if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @BTS_Tests.FreqHopGroupItems.");
check_replace_arguments(val_ptr->n_elements, index, len, "@BTS_Tests.FreqHopGroupItems","element");
FreqHopGroupItems ret_val;
ret_val.set_size(val_ptr->n_elements + repl.val_ptr->n_elements - len);
for (int i = 0; i < index; i++) {
if (val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i] = new FreqHopGroupItem(*val_ptr->value_elements[i]);
}
}
for (int i = 0; i < repl.val_ptr->n_elements; i++) {
if (repl.val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i+index] = new FreqHopGroupItem(*repl.val_ptr->value_elements[i]);
}
}
for (int i = 0; i < val_ptr->n_elements - index - len; i++) {
if (val_ptr->value_elements[index+i+len] != NULL) {
ret_val.val_ptr->value_elements[index+i+repl.val_ptr->n_elements] = new FreqHopGroupItem(*val_ptr->value_elements[index+i+len]);
}
}
return ret_val;
}

FreqHopGroupItems FreqHopGroupItems::replace(int index, int len, const FreqHopGroupItems_template& repl) const
{
if (!repl.is_value()) TTCN_error("The fourth argument of function replace() is a template with non-specific value.");
return replace(index, len, repl.valueof());
}

void FreqHopGroupItems::set_size(int new_size)
{
if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @BTS_Tests.FreqHopGroupItems.");
if (val_ptr == NULL) {
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
} else if (val_ptr->ref_count > 1) {
struct recordof_setof_struct *new_val_ptr = new recordof_setof_struct;
new_val_ptr->ref_count = 1;
new_val_ptr->n_elements = (new_size < val_ptr->n_elements) ? new_size : val_ptr->n_elements;
new_val_ptr->value_elements = (FreqHopGroupItem**)allocate_pointers(new_val_ptr->n_elements);
for (int elem_count = 0; elem_count < new_val_ptr->n_elements; elem_count++) {
if (val_ptr->value_elements[elem_count] != NULL){
new_val_ptr->value_elements[elem_count] = new FreqHopGroupItem(*(val_ptr->value_elements[elem_count]));
}
}
clean_up();
val_ptr = new_val_ptr;
}
if (new_size > val_ptr->n_elements) {
val_ptr->value_elements = (FreqHopGroupItem**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size);
#ifdef TITAN_MEMORY_DEBUG_SET_RECORD_OF
if((val_ptr->n_elements/1000)!=(new_size/1000)) TTCN_warning("New size of type @BTS_Tests.FreqHopGroupItems: %d",new_size);
#endif
val_ptr->n_elements = new_size;
} else if (new_size < val_ptr->n_elements) {
for (int elem_count = new_size; elem_count < val_ptr->n_elements; elem_count++)
if (val_ptr->value_elements[elem_count] != NULL)delete val_ptr->value_elements[elem_count];
val_ptr->value_elements = (FreqHopGroupItem**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size);
val_ptr->n_elements = new_size;
}
}

boolean FreqHopGroupItems::is_value() const
{
if (val_ptr == NULL) return FALSE;
for(int i = 0; i < val_ptr->n_elements; ++i) {
if (val_ptr->value_elements[i] == NULL || !val_ptr->value_elements[i]->is_value()) return FALSE;
}
return TRUE;
}

int FreqHopGroupItems::size_of() const
{
if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @BTS_Tests.FreqHopGroupItems.");
return val_ptr->n_elements;
}

int FreqHopGroupItems::lengthof() const
{
if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @BTS_Tests.FreqHopGroupItems.");
for (int my_length=val_ptr->n_elements; my_length>0; my_length--) if (val_ptr->value_elements[my_length-1] != NULL) return my_length;
return 0;
}

void FreqHopGroupItems::log() const
{
if (val_ptr == NULL) {;
TTCN_Logger::log_event_unbound();
return;
}
switch (val_ptr->n_elements) {
case 0:
TTCN_Logger::log_event_str("{ }");
break;
default:
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
(*this)[elem_count].log();
}
TTCN_Logger::log_event_str(" }");
}
}

void FreqHopGroupItems::set_implicit_omit()
{
if (val_ptr == NULL) return;
for (int i = 0; i < val_ptr->n_elements; i++) {
if (val_ptr->value_elements[i] != NULL) val_ptr->value_elements[i]->set_implicit_omit();
}
}

void FreqHopGroupItems::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE|Module_Param::BC_LIST, "record of value");
  switch (param.get_operation_type()) {
  case Module_Param::OT_ASSIGN:
    if (param.get_type()==Module_Param::MP_Value_List && param.get_size()==0) {
      *this = NULL_VALUE;
      return;
    }
    switch (param.get_type()) {
    case Module_Param::MP_Value_List:
      set_size(param.get_size());
      for (size_t i=0; i<param.get_size(); ++i) {
        Module_Param* const curr = param.get_elem(i);
        if (curr->get_type()!=Module_Param::MP_NotUsed) {
          (*this)[i].set_param(*curr);
          if (!(*this)[i].is_bound()) {
            delete val_ptr->value_elements[i];
            val_ptr->value_elements[i] = NULL;
          }
        }
      }
      break;
    case Module_Param::MP_Indexed_List:
      for (size_t i=0; i<param.get_size(); ++i) {
        Module_Param* const curr = param.get_elem(i);
        (*this)[curr->get_id()->get_index()].set_param(*curr);
        if (!(*this)[curr->get_id()->get_index()].is_bound()) {
          delete val_ptr->value_elements[curr->get_id()->get_index()];
          val_ptr->value_elements[curr->get_id()->get_index()] = NULL;
        }
      }
      break;
    default:
      param.type_error("record of value", "@BTS_Tests.FreqHopGroupItems");
    }
    break;
  case Module_Param::OT_CONCAT:
    switch (param.get_type()) {
    case Module_Param::MP_Value_List: {
      if (!is_bound()) *this = NULL_VALUE;
      int start_idx = lengthof();
      for (size_t i=0; i<param.get_size(); ++i) {
        Module_Param* const curr = param.get_elem(i);
        if ((curr->get_type()!=Module_Param::MP_NotUsed)) {
          (*this)[start_idx+(int)i].set_param(*curr);
        }
      }
    } break;
    case Module_Param::MP_Indexed_List:
      param.error("Cannot concatenate an indexed value list");
      break;
    default:
      param.type_error("record of value", "@BTS_Tests.FreqHopGroupItems");
    }
    break;
  default:
    TTCN_error("Internal error: Unknown operation type.");
  }
}

void FreqHopGroupItems::encode_text(Text_Buf& text_buf) const
{
if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @BTS_Tests.FreqHopGroupItems.");
text_buf.push_int(val_ptr->n_elements);
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++)
(*this)[elem_count].encode_text(text_buf);
}

void FreqHopGroupItems::decode_text(Text_Buf& text_buf)
{
clean_up();
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = text_buf.pull_int().get_val();
if (val_ptr->n_elements < 0) TTCN_error("Text decoder: Negative size was received for a value of type @BTS_Tests.FreqHopGroupItems.");
val_ptr->value_elements = (FreqHopGroupItem**)allocate_pointers(val_ptr->n_elements);
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) {
val_ptr->value_elements[elem_count] = new FreqHopGroupItem;
val_ptr->value_elements[elem_count]->decode_text(text_buf);
}
}

void FreqHopGroupItems_template::copy_value(const FreqHopGroupItems& other_value)
{
if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @BTS_Tests.FreqHopGroupItems with an unbound value.");
single_value.n_elements = other_value.size_of();
single_value.value_elements = (FreqHopGroupItem_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (other_value[elem_count].is_bound()) {
single_value.value_elements[elem_count] = new FreqHopGroupItem_template(other_value[elem_count]);
} else {
single_value.value_elements[elem_count] = new FreqHopGroupItem_template;
}
}
set_selection(SPECIFIC_VALUE);
}

void FreqHopGroupItems_template::copy_template(const FreqHopGroupItems_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value.n_elements = other_value.single_value.n_elements;
single_value.value_elements = (FreqHopGroupItem_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (UNINITIALIZED_TEMPLATE != other_value.single_value.value_elements[elem_count]->get_selection()) {
single_value.value_elements[elem_count] = new FreqHopGroupItem_template(*other_value.single_value.value_elements[elem_count]);
} else {
single_value.value_elements[elem_count] = new FreqHopGroupItem_template;
}
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new FreqHopGroupItems_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new FreqHopGroupItems_template(*other_value.implication_.precondition);
implication_.implied_template = new FreqHopGroupItems_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BTS_Tests.FreqHopGroupItems.");
break;
}
set_selection(other_value);
}

boolean FreqHopGroupItems_template::match_function_specific(const Base_Type *value_ptr, int value_index, const Restricted_Length_Template *template_ptr, int template_index, boolean legacy)
{
if (value_index >= 0) return ((const FreqHopGroupItems_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const FreqHopGroupItems*)value_ptr)[value_index], legacy);
else return ((const FreqHopGroupItems_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit();
}

FreqHopGroupItems_template::FreqHopGroupItems_template()
{
}

FreqHopGroupItems_template::FreqHopGroupItems_template(template_sel other_value)
 : Base_Record_Of_Template(other_value)
{
check_single_selection(other_value);
}

FreqHopGroupItems_template::FreqHopGroupItems_template(null_type)
 : Base_Record_Of_Template(SPECIFIC_VALUE)
{
single_value.n_elements = 0;
single_value.value_elements = NULL;
}

FreqHopGroupItems_template::FreqHopGroupItems_template(const FreqHopGroupItems& other_value)
{
copy_value(other_value);
}

FreqHopGroupItems_template::FreqHopGroupItems_template(const OPTIONAL<FreqHopGroupItems>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const FreqHopGroupItems&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BTS_Tests.FreqHopGroupItems from an unbound optional field.");
}
}

FreqHopGroupItems_template::FreqHopGroupItems_template(FreqHopGroupItems_template* p_precondition, FreqHopGroupItems_template* p_implied_template)
 : Base_Record_Of_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

FreqHopGroupItems_template::FreqHopGroupItems_template(Dynamic_Match_Interface<FreqHopGroupItems>* p_dyn_match)
 : Base_Record_Of_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<FreqHopGroupItems>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

FreqHopGroupItems_template::FreqHopGroupItems_template(const FreqHopGroupItems_template& other_value)
 : Base_Record_Of_Template()
{
copy_template(other_value);
}

FreqHopGroupItems_template::~FreqHopGroupItems_template()
{
clean_up();
}

void FreqHopGroupItems_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
delete single_value.value_elements[elem_count];
free_pointers((void**)single_value.value_elements);
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

FreqHopGroupItems_template& FreqHopGroupItems_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

FreqHopGroupItems_template& FreqHopGroupItems_template::operator=(null_type)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value.n_elements = 0;
single_value.value_elements = NULL;
return *this;
}

FreqHopGroupItems_template& FreqHopGroupItems_template::operator=(const FreqHopGroupItems& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

FreqHopGroupItems_template& FreqHopGroupItems_template::operator=(const OPTIONAL<FreqHopGroupItems>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const FreqHopGroupItems&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @BTS_Tests.FreqHopGroupItems.");
}
return *this;
}

FreqHopGroupItems_template& FreqHopGroupItems_template::operator=(const FreqHopGroupItems_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

FreqHopGroupItem_template& FreqHopGroupItems_template::operator[](int index_value)
{
if (index_value < 0) TTCN_error("Accessing an element of a template for type @BTS_Tests.FreqHopGroupItems using a negative index: %d.", index_value);
switch (template_selection)
{
  case SPECIFIC_VALUE:
    if(index_value < single_value.n_elements) break;
    // no break
  case OMIT_VALUE:
  case ANY_VALUE:
  case ANY_OR_OMIT:
  case UNINITIALIZED_TEMPLATE:
    set_size(index_value + 1);
    break;
  default:
    TTCN_error("Accessing an element of a non-specific template for type @BTS_Tests.FreqHopGroupItems.");
    break;
}
return *single_value.value_elements[index_value];
}

FreqHopGroupItem_template& FreqHopGroupItems_template::operator[](const INTEGER& index_value)
{
index_value.must_bound("Using an unbound integer value for indexing a template of type @BTS_Tests.FreqHopGroupItems.");
return (*this)[(int)index_value];
}

const FreqHopGroupItem_template& FreqHopGroupItems_template::operator[](int index_value) const
{
if (index_value < 0) TTCN_error("Accessing an element of a template for type @BTS_Tests.FreqHopGroupItems using a negative index: %d.", index_value);
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing an element of a non-specific template for type @BTS_Tests.FreqHopGroupItems.");
if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @BTS_Tests.FreqHopGroupItems: The index is %d, but the template has only %d elements.", index_value, single_value.n_elements);
return *single_value.value_elements[index_value];
}

const FreqHopGroupItem_template& FreqHopGroupItems_template::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a template of type @BTS_Tests.FreqHopGroupItems.");
return (*this)[(int)index_value];
}

void FreqHopGroupItems_template::set_size(int new_size)
{
if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a template of type @BTS_Tests.FreqHopGroupItems.");
template_sel old_selection = template_selection;
if (old_selection != SPECIFIC_VALUE) {
clean_up();
set_selection(SPECIFIC_VALUE);
single_value.n_elements = 0;
single_value.value_elements = NULL;
}
if (new_size > single_value.n_elements) {
single_value.value_elements = (FreqHopGroupItem_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
for (int elem_count = single_value.n_elements; elem_count < new_size; elem_count++)
single_value.value_elements[elem_count] = new FreqHopGroupItem_template(ANY_VALUE);
} else {
for (int elem_count = single_value.n_elements; elem_count < new_size; elem_count++)
single_value.value_elements[elem_count] = new FreqHopGroupItem_template;
}
single_value.n_elements = new_size;
} else if (new_size < single_value.n_elements) {
for (int elem_count = new_size; elem_count < single_value.n_elements; elem_count++)
delete single_value.value_elements[elem_count];
single_value.value_elements = (FreqHopGroupItem_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size);
single_value.n_elements = new_size;
}
}

int FreqHopGroupItems_template::n_elem() const
{
  switch (template_selection) {
  case SPECIFIC_VALUE:
    return single_value.n_elements;
    break;
  case VALUE_LIST:
    return value_list.n_values;
    break;
  default:
    TTCN_error("Performing n_elem");
  }
}

int FreqHopGroupItems_template::size_of(boolean is_size) const
{
const char* op_name = is_size ? "size" : "length";
int min_size;
boolean has_any_or_none;
if (is_ifpresent) TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.FreqHopGroupItems which has an ifpresent attribute.", op_name);
switch (template_selection)
{
case SPECIFIC_VALUE: {
  min_size = 0;
  has_any_or_none = FALSE;
  int elem_count = single_value.n_elements;
  if (!is_size) { while (elem_count>0 && !single_value.value_elements[elem_count-1]->is_bound()) elem_count--; }
  for (int i=0; i<elem_count; i++) {
    switch (single_value.value_elements[i]->get_selection()) {
    case OMIT_VALUE:
      TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.FreqHopGroupItems containing omit element.", op_name);
    case ANY_OR_OMIT:
      has_any_or_none = TRUE;
      break;
    default:
      min_size++;
      break;
    }
  }
} break;
case OMIT_VALUE:
  TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.FreqHopGroupItems containing omit value.", op_name);
case ANY_VALUE:
case ANY_OR_OMIT:
  min_size = 0;
  has_any_or_none = TRUE;
  break;
case VALUE_LIST:
{
  if (value_list.n_values<1)
    TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.FreqHopGroupItems containing an empty list.", op_name);
  int item_size = value_list.list_value[0].size_of(is_size);
  for (unsigned int i = 1; i < value_list.n_values; i++) {
    if (value_list.list_value[i].size_of(is_size)!=item_size)
      TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.FreqHopGroupItems containing a value list with different sizes.", op_name);
  }
  min_size = item_size;
  has_any_or_none = FALSE;
  break;
}
case COMPLEMENTED_LIST:
  TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.FreqHopGroupItems containing complemented list.", op_name);
default:
  TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @BTS_Tests.FreqHopGroupItems.", op_name);
}
return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @BTS_Tests.FreqHopGroupItems");
}

boolean FreqHopGroupItems_template::match(const FreqHopGroupItems& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
int value_length = other_value.size_of();
if (!match_length(value_length)) return FALSE;
switch (template_selection) {
case SPECIFIC_VALUE:
return match_record_of(&other_value, value_length, this, single_value.n_elements, match_function_specific, legacy);
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching with an uninitialized/unsupported template of type @BTS_Tests.FreqHopGroupItems.");
}
return FALSE;
}

boolean FreqHopGroupItems_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
if (!single_value.value_elements[elem_count]->is_value()) return FALSE;
return TRUE;
}

FreqHopGroupItems FreqHopGroupItems_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of type @BTS_Tests.FreqHopGroupItems.");
FreqHopGroupItems ret_val;
ret_val.set_size(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
if (single_value.value_elements[elem_count]->is_bound()) {
ret_val[elem_count] = single_value.value_elements[elem_count]->valueof();
}
return ret_val;
}

FreqHopGroupItems FreqHopGroupItems_template::substr(int index, int returncount) const
{
if (!is_value()) TTCN_error("The first argument of function substr() is a template with non-specific value.");
return valueof().substr(index, returncount);
}

FreqHopGroupItems FreqHopGroupItems_template::replace(int index, int len, const FreqHopGroupItems_template& repl) const
{
if (!is_value()) TTCN_error("The first argument of function replace() is a template with non-specific value.");
if (!repl.is_value()) TTCN_error("The fourth argument of function replace() is a template with non-specific value.");
return valueof().replace(index, len, repl.valueof());
}

FreqHopGroupItems FreqHopGroupItems_template::replace(int index, int len, const FreqHopGroupItems& repl) const
{
if (!is_value()) TTCN_error("The first argument of function replace() is a template with non-specific value.");
return valueof().replace(index, len, repl);
}

void FreqHopGroupItems_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = list_length;
value_list.list_value = new FreqHopGroupItems_template[list_length];
break;
default:
TTCN_error("Internal error: Setting an invalid type for a template of type @BTS_Tests.FreqHopGroupItems.");
}
set_selection(template_type);
}

FreqHopGroupItems_template& FreqHopGroupItems_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Internal error: Accessing a list element of a non-list template of type @BTS_Tests.FreqHopGroupItems.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @BTS_Tests.FreqHopGroupItems.");
return value_list.list_value[list_index];
}

void FreqHopGroupItems_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.n_elements > 0) {
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
if (permutation_starts_at(elem_count)) TTCN_Logger::log_event_str("permutation(");
single_value.value_elements[elem_count]->log();
if (permutation_ends_at(elem_count)) TTCN_Logger::log_char(')');
}
TTCN_Logger::log_event_str(" }");
} else TTCN_Logger::log_event_str("{ }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_restricted();
log_ifpresent();
}

void FreqHopGroupItems_template::log_match(const FreqHopGroupItems& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
}else{
if (template_selection == SPECIFIC_VALUE && single_value.n_elements > 0 && get_number_of_permutations() == 0 && single_value.n_elements == match_value.size_of()) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if(!single_value.value_elements[elem_count]->match(match_value[elem_count], legacy)){
TTCN_Logger::log_logmatch_info("[%d]", elem_count);
single_value.value_elements[elem_count]->log_match(match_value[elem_count], legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
log_match_length(single_value.n_elements);
} else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE && single_value.n_elements > 0 && get_number_of_permutations() == 0 && single_value.n_elements == match_value.size_of()) {
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
single_value.value_elements[elem_count]->log_match(match_value[elem_count], legacy);
}
TTCN_Logger::log_event_str(" }");
log_match_length(single_value.n_elements);
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void FreqHopGroupItems_template::encode_text(Text_Buf& text_buf) const
{
encode_text_permutation(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
single_value.value_elements[elem_count]->encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BTS_Tests.FreqHopGroupItems.");
}
}

void FreqHopGroupItems_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_permutation(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value.n_elements = text_buf.pull_int().get_val();
if (single_value.n_elements < 0) TTCN_error("Text decoder: Negative size was received for a template of type @BTS_Tests.FreqHopGroupItems.");
single_value.value_elements = (FreqHopGroupItem_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
single_value.value_elements[elem_count] = new FreqHopGroupItem_template;
single_value.value_elements[elem_count]->decode_text(text_buf);
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new FreqHopGroupItems_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of type @BTS_Tests.FreqHopGroupItems.");
}
}

boolean FreqHopGroupItems_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean FreqHopGroupItems_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void FreqHopGroupItems_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
for (int i = 0; i < single_value.n_elements; i++) {
if (single_value.value_elements[i] != NULL) single_value.value_elements[i]->set_implicit_omit();
}
}

void FreqHopGroupItems_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE|Module_Param::BC_LIST, "record of template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    FreqHopGroupItems_template temp;
    temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = temp;
    break; }
  case Module_Param::MP_Indexed_List:
    if (template_selection!=SPECIFIC_VALUE) set_size(0);
    for (size_t p_i=0; p_i<param.get_size(); ++p_i) {
      (*this)[(int)(param.get_elem(p_i)->get_id()->get_index())].set_param(*param.get_elem(p_i));
    }
    break;
  case Module_Param::MP_Value_List: {
    set_size(param.get_size());
    int curr_idx = 0;
    for (size_t p_i=0; p_i<param.get_size(); ++p_i) {
      switch (param.get_elem(p_i)->get_type()) {
      case Module_Param::MP_NotUsed:
        curr_idx++;
        break;
      case Module_Param::MP_Permutation_Template: {
        int perm_start_idx = curr_idx;
        Module_Param* param_i = param.get_elem(p_i);
        for (size_t perm_i=0; perm_i<param_i->get_size(); perm_i++) {
          (*this)[curr_idx].set_param(*(param_i->get_elem(perm_i)));
          curr_idx++;
        }
        int perm_end_idx = curr_idx - 1;
        add_permutation(perm_start_idx, perm_end_idx);
      } break;
      default:
        (*this)[curr_idx].set_param(*param.get_elem(p_i));
        curr_idx++;
      }
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    FreqHopGroupItems_template* precondition = new FreqHopGroupItems_template;
    precondition->set_param(*param.get_elem(0));
    FreqHopGroupItems_template* implied_template = new FreqHopGroupItems_template;
    implied_template->set_param(*param.get_elem(1));
    *this = FreqHopGroupItems_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record of template", "@BTS_Tests.FreqHopGroupItems");
  }
  is_ifpresent = param.get_ifpresent();
  set_length_range(param);
}

void FreqHopGroupItems_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
for (int i=0; i<single_value.n_elements; i++) single_value.value_elements[i]->check_restriction(t_res, t_name ? t_name : "@BTS_Tests.FreqHopGroupItems");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@BTS_Tests.FreqHopGroupItems");
}

boolean FreqHopGroupItems_template::get_istemplate_kind(const char* type) const {
if (!strcmp(type, "AnyElement")) {
  if (template_selection != SPECIFIC_VALUE) {
    return FALSE;
  }
  for (int i = 0; i < single_value.n_elements; i++) {
    if (single_value.value_elements[i]->get_selection() == ANY_VALUE) {
      return TRUE;
    }
  }
  return FALSE;
} else if (!strcmp(type, "AnyElementsOrNone")) {
  if (template_selection != SPECIFIC_VALUE) {
    return FALSE;
  }
  for (int i = 0; i < single_value.n_elements; i++) {
    if (single_value.value_elements[i]->get_selection() == ANY_OR_OMIT) {
      return TRUE;
    }
  }
  return FALSE;
} else if (!strcmp(type, "permutation")) {
  return number_of_permutations;
} else if (!strcmp(type, "length")) {
  return length_restriction_type != NO_LENGTH_RESTRICTION;
} else {
  return Base_Template::get_istemplate_kind(type);
}
}
FreqHopGroupItem::FreqHopGroupItem()
{
}

FreqHopGroupItem::FreqHopGroupItem(const INTEGER& par_trx__nr,
    const INTEGER& par_maio)
  :   field_trx__nr(par_trx__nr),
  field_maio(par_maio)
{
}

FreqHopGroupItem::FreqHopGroupItem(const FreqHopGroupItem& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BTS_Tests.FreqHopGroupItem.");
if (other_value.trx__nr().is_bound()) field_trx__nr = other_value.trx__nr();
else field_trx__nr.clean_up();
if (other_value.maio().is_bound()) field_maio = other_value.maio();
else field_maio.clean_up();
}

void FreqHopGroupItem::clean_up()
{
field_trx__nr.clean_up();
field_maio.clean_up();
}

const TTCN_Typedescriptor_t* FreqHopGroupItem::get_descriptor() const { return &FreqHopGroupItem_descr_; }
FreqHopGroupItem& FreqHopGroupItem::operator=(const FreqHopGroupItem& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BTS_Tests.FreqHopGroupItem.");
  if (other_value.trx__nr().is_bound()) field_trx__nr = other_value.trx__nr();
  else field_trx__nr.clean_up();
  if (other_value.maio().is_bound()) field_maio = other_value.maio();
  else field_maio.clean_up();
}
return *this;
}

boolean FreqHopGroupItem::operator==(const FreqHopGroupItem& other_value) const
{
return field_trx__nr==other_value.field_trx__nr
  && field_maio==other_value.field_maio;
}

boolean FreqHopGroupItem::is_bound() const
{
return (field_trx__nr.is_bound())
  || (field_maio.is_bound());
}
boolean FreqHopGroupItem::is_value() const
{
return field_trx__nr.is_value()
  && field_maio.is_value();
}
void FreqHopGroupItem::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ trx_nr := ");
field_trx__nr.log();
TTCN_Logger::log_event_str(", maio := ");
field_maio.log();
TTCN_Logger::log_event_str(" }");
}

void FreqHopGroupItem::set_implicit_omit()
{
if (trx__nr().is_bound()) trx__nr().set_implicit_omit();
if (maio().is_bound()) maio().set_implicit_omit();
}

void FreqHopGroupItem::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record value of type @BTS_Tests.FreqHopGroupItem has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) trx__nr().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) maio().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "trx_nr")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          trx__nr().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "maio")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          maio().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BTS_Tests.FreqHopGroupItem: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BTS_Tests.FreqHopGroupItem");
  }
}

void FreqHopGroupItem::encode_text(Text_Buf& text_buf) const
{
field_trx__nr.encode_text(text_buf);
field_maio.encode_text(text_buf);
}

void FreqHopGroupItem::decode_text(Text_Buf& text_buf)
{
field_trx__nr.decode_text(text_buf);
field_maio.decode_text(text_buf);
}

struct FreqHopGroupItem_template::single_value_struct {
INTEGER_template field_trx__nr;
INTEGER_template field_maio;
};

void FreqHopGroupItem_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_trx__nr = ANY_VALUE;
single_value->field_maio = ANY_VALUE;
}
}
}

void FreqHopGroupItem_template::copy_value(const FreqHopGroupItem& other_value)
{
single_value = new single_value_struct;
if (other_value.trx__nr().is_bound()) {
  single_value->field_trx__nr = other_value.trx__nr();
} else {
  single_value->field_trx__nr.clean_up();
}
if (other_value.maio().is_bound()) {
  single_value->field_maio = other_value.maio();
} else {
  single_value->field_maio.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void FreqHopGroupItem_template::copy_template(const FreqHopGroupItem_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.trx__nr().get_selection()) {
single_value->field_trx__nr = other_value.trx__nr();
} else {
single_value->field_trx__nr.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.maio().get_selection()) {
single_value->field_maio = other_value.maio();
} else {
single_value->field_maio.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new FreqHopGroupItem_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new FreqHopGroupItem_template(*other_value.implication_.precondition);
implication_.implied_template = new FreqHopGroupItem_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BTS_Tests.FreqHopGroupItem.");
break;
}
set_selection(other_value);
}

FreqHopGroupItem_template::FreqHopGroupItem_template()
{
}

FreqHopGroupItem_template::FreqHopGroupItem_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

FreqHopGroupItem_template::FreqHopGroupItem_template(const FreqHopGroupItem& other_value)
{
copy_value(other_value);
}

FreqHopGroupItem_template::FreqHopGroupItem_template(const OPTIONAL<FreqHopGroupItem>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const FreqHopGroupItem&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BTS_Tests.FreqHopGroupItem from an unbound optional field.");
}
}

FreqHopGroupItem_template::FreqHopGroupItem_template(FreqHopGroupItem_template* p_precondition, FreqHopGroupItem_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

FreqHopGroupItem_template::FreqHopGroupItem_template(Dynamic_Match_Interface<FreqHopGroupItem>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<FreqHopGroupItem>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

FreqHopGroupItem_template::FreqHopGroupItem_template(const FreqHopGroupItem_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

FreqHopGroupItem_template::~FreqHopGroupItem_template()
{
clean_up();
}

FreqHopGroupItem_template& FreqHopGroupItem_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

FreqHopGroupItem_template& FreqHopGroupItem_template::operator=(const FreqHopGroupItem& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

FreqHopGroupItem_template& FreqHopGroupItem_template::operator=(const OPTIONAL<FreqHopGroupItem>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const FreqHopGroupItem&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @BTS_Tests.FreqHopGroupItem.");
}
return *this;
}

FreqHopGroupItem_template& FreqHopGroupItem_template::operator=(const FreqHopGroupItem_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean FreqHopGroupItem_template::match(const FreqHopGroupItem& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.trx__nr().is_bound()) return FALSE;
if(!single_value->field_trx__nr.match(other_value.trx__nr(), legacy))return FALSE;
if(!other_value.maio().is_bound()) return FALSE;
if(!single_value->field_maio.match(other_value.maio(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BTS_Tests.FreqHopGroupItem.");
}
return FALSE;
}

boolean FreqHopGroupItem_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_trx__nr.is_bound()
 || single_value->field_maio.is_bound();
}

boolean FreqHopGroupItem_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_trx__nr.is_value()
 && single_value->field_maio.is_value();
}

void FreqHopGroupItem_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

FreqHopGroupItem FreqHopGroupItem_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BTS_Tests.FreqHopGroupItem.");
FreqHopGroupItem ret_val;
if (single_value->field_trx__nr.is_bound()) {
ret_val.trx__nr() = single_value->field_trx__nr.valueof();
}
if (single_value->field_maio.is_bound()) {
ret_val.maio() = single_value->field_maio.valueof();
}
return ret_val;
}

void FreqHopGroupItem_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @BTS_Tests.FreqHopGroupItem.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new FreqHopGroupItem_template[list_length];
}

FreqHopGroupItem_template& FreqHopGroupItem_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @BTS_Tests.FreqHopGroupItem.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BTS_Tests.FreqHopGroupItem.");
return value_list.list_value[list_index];
}

INTEGER_template& FreqHopGroupItem_template::trx__nr()
{
set_specific();
return single_value->field_trx__nr;
}

const INTEGER_template& FreqHopGroupItem_template::trx__nr() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field trx_nr of a non-specific template of type @BTS_Tests.FreqHopGroupItem.");
return single_value->field_trx__nr;
}

INTEGER_template& FreqHopGroupItem_template::maio()
{
set_specific();
return single_value->field_maio;
}

const INTEGER_template& FreqHopGroupItem_template::maio() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field maio of a non-specific template of type @BTS_Tests.FreqHopGroupItem.");
return single_value->field_maio;
}

int FreqHopGroupItem_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.FreqHopGroupItem which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 2;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @BTS_Tests.FreqHopGroupItem containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.FreqHopGroupItem containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.FreqHopGroupItem containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.FreqHopGroupItem containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.FreqHopGroupItem containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.FreqHopGroupItem containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.FreqHopGroupItem containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.FreqHopGroupItem containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BTS_Tests.FreqHopGroupItem.");
  }
  return 0;
}

void FreqHopGroupItem_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ trx_nr := ");
single_value->field_trx__nr.log();
TTCN_Logger::log_event_str(", maio := ");
single_value->field_maio.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void FreqHopGroupItem_template::log_match(const FreqHopGroupItem& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_trx__nr.match(match_value.trx__nr(), legacy)){
TTCN_Logger::log_logmatch_info(".trx_nr");
single_value->field_trx__nr.log_match(match_value.trx__nr(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_maio.match(match_value.maio(), legacy)){
TTCN_Logger::log_logmatch_info(".maio");
single_value->field_maio.log_match(match_value.maio(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ trx_nr := ");
single_value->field_trx__nr.log_match(match_value.trx__nr(), legacy);
TTCN_Logger::log_event_str(", maio := ");
single_value->field_maio.log_match(match_value.maio(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void FreqHopGroupItem_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (trx__nr().is_bound()) trx__nr().set_implicit_omit();
if (maio().is_bound()) maio().set_implicit_omit();
}

void FreqHopGroupItem_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_trx__nr.encode_text(text_buf);
single_value->field_maio.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BTS_Tests.FreqHopGroupItem.");
}
}

void FreqHopGroupItem_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_trx__nr.decode_text(text_buf);
single_value->field_maio.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new FreqHopGroupItem_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @BTS_Tests.FreqHopGroupItem.");
}
}

void FreqHopGroupItem_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    FreqHopGroupItem_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record template of type @BTS_Tests.FreqHopGroupItem has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) trx__nr().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) maio().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "trx_nr")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          trx__nr().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "maio")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          maio().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BTS_Tests.FreqHopGroupItem: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    FreqHopGroupItem_template* precondition = new FreqHopGroupItem_template;
    precondition->set_param(*param.get_elem(0));
    FreqHopGroupItem_template* implied_template = new FreqHopGroupItem_template;
    implied_template->set_param(*param.get_elem(1));
    *this = FreqHopGroupItem_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BTS_Tests.FreqHopGroupItem");
  }
  is_ifpresent = param.get_ifpresent();
}

void FreqHopGroupItem_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_trx__nr.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.FreqHopGroupItem");
single_value->field_maio.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.FreqHopGroupItem");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@BTS_Tests.FreqHopGroupItem");
}

boolean FreqHopGroupItem_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean FreqHopGroupItem_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

FreqHopGroup::FreqHopGroup()
{
}

FreqHopGroup::FreqHopGroup(const INTEGER& par_hsn,
    const FreqHopGroupItems& par_trx__maio)
  :   field_hsn(par_hsn),
  field_trx__maio(par_trx__maio)
{
}

FreqHopGroup::FreqHopGroup(const FreqHopGroup& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BTS_Tests.FreqHopGroup.");
if (other_value.hsn().is_bound()) field_hsn = other_value.hsn();
else field_hsn.clean_up();
if (other_value.trx__maio().is_bound()) field_trx__maio = other_value.trx__maio();
else field_trx__maio.clean_up();
}

void FreqHopGroup::clean_up()
{
field_hsn.clean_up();
field_trx__maio.clean_up();
}

const TTCN_Typedescriptor_t* FreqHopGroup::get_descriptor() const { return &FreqHopGroup_descr_; }
FreqHopGroup& FreqHopGroup::operator=(const FreqHopGroup& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BTS_Tests.FreqHopGroup.");
  if (other_value.hsn().is_bound()) field_hsn = other_value.hsn();
  else field_hsn.clean_up();
  if (other_value.trx__maio().is_bound()) field_trx__maio = other_value.trx__maio();
  else field_trx__maio.clean_up();
}
return *this;
}

boolean FreqHopGroup::operator==(const FreqHopGroup& other_value) const
{
return field_hsn==other_value.field_hsn
  && field_trx__maio==other_value.field_trx__maio;
}

boolean FreqHopGroup::is_bound() const
{
return (field_hsn.is_bound())
  || (field_trx__maio.is_bound());
}
boolean FreqHopGroup::is_value() const
{
return field_hsn.is_value()
  && field_trx__maio.is_value();
}
void FreqHopGroup::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ hsn := ");
field_hsn.log();
TTCN_Logger::log_event_str(", trx_maio := ");
field_trx__maio.log();
TTCN_Logger::log_event_str(" }");
}

void FreqHopGroup::set_implicit_omit()
{
if (hsn().is_bound()) hsn().set_implicit_omit();
if (trx__maio().is_bound()) trx__maio().set_implicit_omit();
}

void FreqHopGroup::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record value of type @BTS_Tests.FreqHopGroup has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) hsn().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) trx__maio().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "hsn")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          hsn().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "trx_maio")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          trx__maio().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BTS_Tests.FreqHopGroup: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BTS_Tests.FreqHopGroup");
  }
}

void FreqHopGroup::encode_text(Text_Buf& text_buf) const
{
field_hsn.encode_text(text_buf);
field_trx__maio.encode_text(text_buf);
}

void FreqHopGroup::decode_text(Text_Buf& text_buf)
{
field_hsn.decode_text(text_buf);
field_trx__maio.decode_text(text_buf);
}

struct FreqHopGroup_template::single_value_struct {
INTEGER_template field_hsn;
FreqHopGroupItems_template field_trx__maio;
};

void FreqHopGroup_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_hsn = ANY_VALUE;
single_value->field_trx__maio = ANY_VALUE;
}
}
}

void FreqHopGroup_template::copy_value(const FreqHopGroup& other_value)
{
single_value = new single_value_struct;
if (other_value.hsn().is_bound()) {
  single_value->field_hsn = other_value.hsn();
} else {
  single_value->field_hsn.clean_up();
}
if (other_value.trx__maio().is_bound()) {
  single_value->field_trx__maio = other_value.trx__maio();
} else {
  single_value->field_trx__maio.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void FreqHopGroup_template::copy_template(const FreqHopGroup_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.hsn().get_selection()) {
single_value->field_hsn = other_value.hsn();
} else {
single_value->field_hsn.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.trx__maio().get_selection()) {
single_value->field_trx__maio = other_value.trx__maio();
} else {
single_value->field_trx__maio.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new FreqHopGroup_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new FreqHopGroup_template(*other_value.implication_.precondition);
implication_.implied_template = new FreqHopGroup_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BTS_Tests.FreqHopGroup.");
break;
}
set_selection(other_value);
}

FreqHopGroup_template::FreqHopGroup_template()
{
}

FreqHopGroup_template::FreqHopGroup_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

FreqHopGroup_template::FreqHopGroup_template(const FreqHopGroup& other_value)
{
copy_value(other_value);
}

FreqHopGroup_template::FreqHopGroup_template(const OPTIONAL<FreqHopGroup>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const FreqHopGroup&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BTS_Tests.FreqHopGroup from an unbound optional field.");
}
}

FreqHopGroup_template::FreqHopGroup_template(FreqHopGroup_template* p_precondition, FreqHopGroup_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

FreqHopGroup_template::FreqHopGroup_template(Dynamic_Match_Interface<FreqHopGroup>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<FreqHopGroup>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

FreqHopGroup_template::FreqHopGroup_template(const FreqHopGroup_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

FreqHopGroup_template::~FreqHopGroup_template()
{
clean_up();
}

FreqHopGroup_template& FreqHopGroup_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

FreqHopGroup_template& FreqHopGroup_template::operator=(const FreqHopGroup& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

FreqHopGroup_template& FreqHopGroup_template::operator=(const OPTIONAL<FreqHopGroup>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const FreqHopGroup&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @BTS_Tests.FreqHopGroup.");
}
return *this;
}

FreqHopGroup_template& FreqHopGroup_template::operator=(const FreqHopGroup_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean FreqHopGroup_template::match(const FreqHopGroup& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.hsn().is_bound()) return FALSE;
if(!single_value->field_hsn.match(other_value.hsn(), legacy))return FALSE;
if(!other_value.trx__maio().is_bound()) return FALSE;
if(!single_value->field_trx__maio.match(other_value.trx__maio(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BTS_Tests.FreqHopGroup.");
}
return FALSE;
}

boolean FreqHopGroup_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_hsn.is_bound()
 || single_value->field_trx__maio.is_bound();
}

boolean FreqHopGroup_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_hsn.is_value()
 && single_value->field_trx__maio.is_value();
}

void FreqHopGroup_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

FreqHopGroup FreqHopGroup_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BTS_Tests.FreqHopGroup.");
FreqHopGroup ret_val;
if (single_value->field_hsn.is_bound()) {
ret_val.hsn() = single_value->field_hsn.valueof();
}
if (single_value->field_trx__maio.is_bound()) {
ret_val.trx__maio() = single_value->field_trx__maio.valueof();
}
return ret_val;
}

void FreqHopGroup_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @BTS_Tests.FreqHopGroup.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new FreqHopGroup_template[list_length];
}

FreqHopGroup_template& FreqHopGroup_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @BTS_Tests.FreqHopGroup.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BTS_Tests.FreqHopGroup.");
return value_list.list_value[list_index];
}

INTEGER_template& FreqHopGroup_template::hsn()
{
set_specific();
return single_value->field_hsn;
}

const INTEGER_template& FreqHopGroup_template::hsn() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field hsn of a non-specific template of type @BTS_Tests.FreqHopGroup.");
return single_value->field_hsn;
}

FreqHopGroupItems_template& FreqHopGroup_template::trx__maio()
{
set_specific();
return single_value->field_trx__maio;
}

const FreqHopGroupItems_template& FreqHopGroup_template::trx__maio() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field trx_maio of a non-specific template of type @BTS_Tests.FreqHopGroup.");
return single_value->field_trx__maio;
}

int FreqHopGroup_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.FreqHopGroup which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 2;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @BTS_Tests.FreqHopGroup containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.FreqHopGroup containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.FreqHopGroup containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.FreqHopGroup containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.FreqHopGroup containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.FreqHopGroup containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.FreqHopGroup containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.FreqHopGroup containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BTS_Tests.FreqHopGroup.");
  }
  return 0;
}

void FreqHopGroup_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ hsn := ");
single_value->field_hsn.log();
TTCN_Logger::log_event_str(", trx_maio := ");
single_value->field_trx__maio.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void FreqHopGroup_template::log_match(const FreqHopGroup& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_hsn.match(match_value.hsn(), legacy)){
TTCN_Logger::log_logmatch_info(".hsn");
single_value->field_hsn.log_match(match_value.hsn(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_trx__maio.match(match_value.trx__maio(), legacy)){
TTCN_Logger::log_logmatch_info(".trx_maio");
single_value->field_trx__maio.log_match(match_value.trx__maio(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ hsn := ");
single_value->field_hsn.log_match(match_value.hsn(), legacy);
TTCN_Logger::log_event_str(", trx_maio := ");
single_value->field_trx__maio.log_match(match_value.trx__maio(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void FreqHopGroup_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (hsn().is_bound()) hsn().set_implicit_omit();
if (trx__maio().is_bound()) trx__maio().set_implicit_omit();
}

void FreqHopGroup_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_hsn.encode_text(text_buf);
single_value->field_trx__maio.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BTS_Tests.FreqHopGroup.");
}
}

void FreqHopGroup_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_hsn.decode_text(text_buf);
single_value->field_trx__maio.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new FreqHopGroup_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @BTS_Tests.FreqHopGroup.");
}
}

void FreqHopGroup_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    FreqHopGroup_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record template of type @BTS_Tests.FreqHopGroup has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) hsn().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) trx__maio().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "hsn")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          hsn().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "trx_maio")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          trx__maio().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BTS_Tests.FreqHopGroup: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    FreqHopGroup_template* precondition = new FreqHopGroup_template;
    precondition->set_param(*param.get_elem(0));
    FreqHopGroup_template* implied_template = new FreqHopGroup_template;
    implied_template->set_param(*param.get_elem(1));
    *this = FreqHopGroup_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BTS_Tests.FreqHopGroup");
  }
  is_ifpresent = param.get_ifpresent();
}

void FreqHopGroup_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_hsn.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.FreqHopGroup");
single_value->field_trx__maio.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.FreqHopGroup");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@BTS_Tests.FreqHopGroup");
}

boolean FreqHopGroup_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean FreqHopGroup_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}


const TrxParsItem TrxPars::UNBOUND_ELEM;
TrxPars::TrxPars()
{
val_ptr = NULL;
}

TrxPars::TrxPars(null_type)
{
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
}

TrxPars::TrxPars(const TrxPars& other_value)
{
if (!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BTS_Tests.TrxPars.");
val_ptr = other_value.val_ptr;
val_ptr->ref_count++;
}

TrxPars::~TrxPars()
{
clean_up();
if (val_ptr != NULL) val_ptr = NULL;
}

void TrxPars::clean_up()
{
if (val_ptr != NULL) {
if (val_ptr->ref_count > 1) {
val_ptr->ref_count--;
val_ptr = NULL;
}
else if (val_ptr->ref_count == 1) {
for (int elem_count = 0; elem_count < val_ptr->n_elements;
elem_count++)
if (val_ptr->value_elements[elem_count] != NULL)
delete val_ptr->value_elements[elem_count];
free_pointers((void**)val_ptr->value_elements);
delete val_ptr;
val_ptr = NULL;
}
else
TTCN_error("Internal error: Invalid reference counter in a record of/set of value.");
}
}

TrxPars& TrxPars::operator=(null_type)
{
clean_up();
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
return *this;
}

TrxPars& TrxPars::operator=(const TrxPars& other_value)
{
if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @BTS_Tests.TrxPars.");
if (this != &other_value) {
clean_up();
val_ptr = other_value.val_ptr;
val_ptr->ref_count++;
}
return *this;
}

boolean TrxPars::operator==(null_type) const
{
if (val_ptr == NULL)
TTCN_error("The left operand of comparison is an unbound value of type @BTS_Tests.TrxPars.");
return val_ptr->n_elements == 0 ;
}

boolean TrxPars::operator==(const TrxPars& other_value) const
{
if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @BTS_Tests.TrxPars.");
if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @BTS_Tests.TrxPars.");
if (val_ptr == other_value.val_ptr) return TRUE;
if (val_ptr->n_elements != (other_value.val_ptr)->n_elements)
return FALSE;
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++){
if (val_ptr->value_elements[elem_count] != NULL){
if ((other_value.val_ptr)->value_elements[elem_count] != NULL){
  if (*val_ptr->value_elements[elem_count] != *(other_value.val_ptr)->value_elements[elem_count]) return FALSE;
} else return FALSE;
} else {
if ((other_value.val_ptr)->value_elements[elem_count] != NULL) return FALSE;
}
}
return TRUE;
}

TrxParsItem& TrxPars::operator[](int index_value)
{
if (index_value < 0) TTCN_error("Accessing an element of type @BTS_Tests.TrxPars using a negative index: %d.", index_value);
if (val_ptr == NULL) {
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
} else if (val_ptr->ref_count > 1) {
struct recordof_setof_struct *new_val_ptr = new recordof_setof_struct;
new_val_ptr->ref_count = 1;
new_val_ptr->n_elements = (index_value >= val_ptr->n_elements) ? index_value + 1 : val_ptr->n_elements;
new_val_ptr->value_elements = (TrxParsItem**)allocate_pointers(new_val_ptr->n_elements);
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++){
if (val_ptr->value_elements[elem_count] != NULL){
new_val_ptr->value_elements[elem_count] = new TrxParsItem(*(val_ptr->value_elements[elem_count]));
}
}
clean_up();
val_ptr = new_val_ptr;
}
if (index_value >= val_ptr->n_elements) set_size(index_value + 1);
if (val_ptr->value_elements[index_value] == NULL) {
val_ptr->value_elements[index_value] = new TrxParsItem;
}
return *val_ptr->value_elements[index_value];
}

TrxParsItem& TrxPars::operator[](const INTEGER& index_value)
{
index_value.must_bound("Using an unbound integer value for indexing a value of type @BTS_Tests.TrxPars.");
return (*this)[(int)index_value];
}

const TrxParsItem& TrxPars::operator[](int index_value) const
{
if (val_ptr == NULL)
TTCN_error("Accessing an element in an unbound value of type @BTS_Tests.TrxPars.");
if (index_value < 0) TTCN_error("Accessing an element of type @BTS_Tests.TrxPars using a negative index: %d.", index_value);
if (index_value >= val_ptr->n_elements) TTCN_error("Index overflow in a value of type @BTS_Tests.TrxPars: The index is %d, but the value has only %d elements.", index_value, val_ptr->n_elements);
return (val_ptr->value_elements[index_value] == NULL) ?
UNBOUND_ELEM : *val_ptr->value_elements[index_value];
}

const TrxParsItem& TrxPars::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a value of type @BTS_Tests.TrxPars.");
return (*this)[(int)index_value];
}

TrxPars TrxPars::operator<<=(int rotate_count) const
{
return *this >>= (-rotate_count);
}

TrxPars TrxPars::operator<<=(const INTEGER& rotate_count) const
{
rotate_count.must_bound("Unbound integer operand of rotate left operator.");
return *this >>= (int)(-rotate_count);
}

TrxPars TrxPars::operator>>=(const INTEGER& rotate_count) const
{
rotate_count.must_bound("Unbound integer operand of rotate right operator.");
return *this >>= (int)rotate_count;
}

TrxPars TrxPars::operator>>=(int rotate_count) const
{
if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @BTS_Tests.TrxPars.");
if (val_ptr->n_elements == 0) return *this;
int rc;
if (rotate_count>=0) rc = rotate_count % val_ptr->n_elements;
else rc = val_ptr->n_elements - ((-rotate_count) % val_ptr->n_elements);
if (rc == 0) return *this;
TrxPars ret_val;
ret_val.set_size(val_ptr->n_elements);
for (int i=0; i<val_ptr->n_elements; i++) {
if (val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[(i+rc)%val_ptr->n_elements] =new TrxParsItem(*val_ptr->value_elements[i]);
}
}
return ret_val;
}

TrxPars TrxPars::operator+(const TrxPars& other_value) const
{
if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @BTS_Tests.TrxPars concatenation.");
if (val_ptr->n_elements == 0) return other_value;
if (other_value.val_ptr->n_elements == 0) return *this;
TrxPars ret_val;
ret_val.set_size(val_ptr->n_elements+other_value.val_ptr->n_elements);
for (int i=0; i<val_ptr->n_elements; i++) {
if (val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i] = new TrxParsItem(*val_ptr->value_elements[i]);
}
}
for (int i=0; i<other_value.val_ptr->n_elements; i++) {
if (other_value.val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i+val_ptr->n_elements] = new TrxParsItem(*other_value.val_ptr->value_elements[i]);
}
}
return ret_val;
}

TrxPars TrxPars::substr(int index, int returncount) const
{
if (val_ptr == NULL) TTCN_error("The first argument of substr() is an unbound value of type @BTS_Tests.TrxPars.");
check_substr_arguments(val_ptr->n_elements, index, returncount, "@BTS_Tests.TrxPars","element");
TrxPars ret_val;
ret_val.set_size(returncount);
for (int i=0; i<returncount; i++) {
if (val_ptr->value_elements[i+index] != NULL) {
ret_val.val_ptr->value_elements[i] = new TrxParsItem(*val_ptr->value_elements[i+index]);
}
}
return ret_val;
}

TrxPars TrxPars::replace(int index, int len, const TrxPars& repl) const
{
if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @BTS_Tests.TrxPars.");
if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @BTS_Tests.TrxPars.");
check_replace_arguments(val_ptr->n_elements, index, len, "@BTS_Tests.TrxPars","element");
TrxPars ret_val;
ret_val.set_size(val_ptr->n_elements + repl.val_ptr->n_elements - len);
for (int i = 0; i < index; i++) {
if (val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i] = new TrxParsItem(*val_ptr->value_elements[i]);
}
}
for (int i = 0; i < repl.val_ptr->n_elements; i++) {
if (repl.val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i+index] = new TrxParsItem(*repl.val_ptr->value_elements[i]);
}
}
for (int i = 0; i < val_ptr->n_elements - index - len; i++) {
if (val_ptr->value_elements[index+i+len] != NULL) {
ret_val.val_ptr->value_elements[index+i+repl.val_ptr->n_elements] = new TrxParsItem(*val_ptr->value_elements[index+i+len]);
}
}
return ret_val;
}

TrxPars TrxPars::replace(int index, int len, const TrxPars_template& repl) const
{
if (!repl.is_value()) TTCN_error("The fourth argument of function replace() is a template with non-specific value.");
return replace(index, len, repl.valueof());
}

void TrxPars::set_size(int new_size)
{
if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @BTS_Tests.TrxPars.");
if (val_ptr == NULL) {
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
} else if (val_ptr->ref_count > 1) {
struct recordof_setof_struct *new_val_ptr = new recordof_setof_struct;
new_val_ptr->ref_count = 1;
new_val_ptr->n_elements = (new_size < val_ptr->n_elements) ? new_size : val_ptr->n_elements;
new_val_ptr->value_elements = (TrxParsItem**)allocate_pointers(new_val_ptr->n_elements);
for (int elem_count = 0; elem_count < new_val_ptr->n_elements; elem_count++) {
if (val_ptr->value_elements[elem_count] != NULL){
new_val_ptr->value_elements[elem_count] = new TrxParsItem(*(val_ptr->value_elements[elem_count]));
}
}
clean_up();
val_ptr = new_val_ptr;
}
if (new_size > val_ptr->n_elements) {
val_ptr->value_elements = (TrxParsItem**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size);
#ifdef TITAN_MEMORY_DEBUG_SET_RECORD_OF
if((val_ptr->n_elements/1000)!=(new_size/1000)) TTCN_warning("New size of type @BTS_Tests.TrxPars: %d",new_size);
#endif
val_ptr->n_elements = new_size;
} else if (new_size < val_ptr->n_elements) {
for (int elem_count = new_size; elem_count < val_ptr->n_elements; elem_count++)
if (val_ptr->value_elements[elem_count] != NULL)delete val_ptr->value_elements[elem_count];
val_ptr->value_elements = (TrxParsItem**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size);
val_ptr->n_elements = new_size;
}
}

boolean TrxPars::is_value() const
{
if (val_ptr == NULL) return FALSE;
for(int i = 0; i < val_ptr->n_elements; ++i) {
if (val_ptr->value_elements[i] == NULL || !val_ptr->value_elements[i]->is_value()) return FALSE;
}
return TRUE;
}

int TrxPars::size_of() const
{
if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @BTS_Tests.TrxPars.");
return val_ptr->n_elements;
}

int TrxPars::lengthof() const
{
if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @BTS_Tests.TrxPars.");
for (int my_length=val_ptr->n_elements; my_length>0; my_length--) if (val_ptr->value_elements[my_length-1] != NULL) return my_length;
return 0;
}

void TrxPars::log() const
{
if (val_ptr == NULL) {;
TTCN_Logger::log_event_unbound();
return;
}
switch (val_ptr->n_elements) {
case 0:
TTCN_Logger::log_event_str("{ }");
break;
default:
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
(*this)[elem_count].log();
}
TTCN_Logger::log_event_str(" }");
}
}

void TrxPars::set_implicit_omit()
{
if (val_ptr == NULL) return;
for (int i = 0; i < val_ptr->n_elements; i++) {
if (val_ptr->value_elements[i] != NULL) val_ptr->value_elements[i]->set_implicit_omit();
}
}

void TrxPars::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE|Module_Param::BC_LIST, "record of value");
  switch (param.get_operation_type()) {
  case Module_Param::OT_ASSIGN:
    if (param.get_type()==Module_Param::MP_Value_List && param.get_size()==0) {
      *this = NULL_VALUE;
      return;
    }
    switch (param.get_type()) {
    case Module_Param::MP_Value_List:
      set_size(param.get_size());
      for (size_t i=0; i<param.get_size(); ++i) {
        Module_Param* const curr = param.get_elem(i);
        if (curr->get_type()!=Module_Param::MP_NotUsed) {
          (*this)[i].set_param(*curr);
          if (!(*this)[i].is_bound()) {
            delete val_ptr->value_elements[i];
            val_ptr->value_elements[i] = NULL;
          }
        }
      }
      break;
    case Module_Param::MP_Indexed_List:
      for (size_t i=0; i<param.get_size(); ++i) {
        Module_Param* const curr = param.get_elem(i);
        (*this)[curr->get_id()->get_index()].set_param(*curr);
        if (!(*this)[curr->get_id()->get_index()].is_bound()) {
          delete val_ptr->value_elements[curr->get_id()->get_index()];
          val_ptr->value_elements[curr->get_id()->get_index()] = NULL;
        }
      }
      break;
    default:
      param.type_error("record of value", "@BTS_Tests.TrxPars");
    }
    break;
  case Module_Param::OT_CONCAT:
    switch (param.get_type()) {
    case Module_Param::MP_Value_List: {
      if (!is_bound()) *this = NULL_VALUE;
      int start_idx = lengthof();
      for (size_t i=0; i<param.get_size(); ++i) {
        Module_Param* const curr = param.get_elem(i);
        if ((curr->get_type()!=Module_Param::MP_NotUsed)) {
          (*this)[start_idx+(int)i].set_param(*curr);
        }
      }
    } break;
    case Module_Param::MP_Indexed_List:
      param.error("Cannot concatenate an indexed value list");
      break;
    default:
      param.type_error("record of value", "@BTS_Tests.TrxPars");
    }
    break;
  default:
    TTCN_error("Internal error: Unknown operation type.");
  }
}

void TrxPars::encode_text(Text_Buf& text_buf) const
{
if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @BTS_Tests.TrxPars.");
text_buf.push_int(val_ptr->n_elements);
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++)
(*this)[elem_count].encode_text(text_buf);
}

void TrxPars::decode_text(Text_Buf& text_buf)
{
clean_up();
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = text_buf.pull_int().get_val();
if (val_ptr->n_elements < 0) TTCN_error("Text decoder: Negative size was received for a value of type @BTS_Tests.TrxPars.");
val_ptr->value_elements = (TrxParsItem**)allocate_pointers(val_ptr->n_elements);
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) {
val_ptr->value_elements[elem_count] = new TrxParsItem;
val_ptr->value_elements[elem_count]->decode_text(text_buf);
}
}

void TrxPars_template::copy_value(const TrxPars& other_value)
{
if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @BTS_Tests.TrxPars with an unbound value.");
single_value.n_elements = other_value.size_of();
single_value.value_elements = (TrxParsItem_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (other_value[elem_count].is_bound()) {
single_value.value_elements[elem_count] = new TrxParsItem_template(other_value[elem_count]);
} else {
single_value.value_elements[elem_count] = new TrxParsItem_template;
}
}
set_selection(SPECIFIC_VALUE);
}

void TrxPars_template::copy_template(const TrxPars_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value.n_elements = other_value.single_value.n_elements;
single_value.value_elements = (TrxParsItem_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (UNINITIALIZED_TEMPLATE != other_value.single_value.value_elements[elem_count]->get_selection()) {
single_value.value_elements[elem_count] = new TrxParsItem_template(*other_value.single_value.value_elements[elem_count]);
} else {
single_value.value_elements[elem_count] = new TrxParsItem_template;
}
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new TrxPars_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new TrxPars_template(*other_value.implication_.precondition);
implication_.implied_template = new TrxPars_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BTS_Tests.TrxPars.");
break;
}
set_selection(other_value);
}

boolean TrxPars_template::match_function_specific(const Base_Type *value_ptr, int value_index, const Restricted_Length_Template *template_ptr, int template_index, boolean legacy)
{
if (value_index >= 0) return ((const TrxPars_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const TrxPars*)value_ptr)[value_index], legacy);
else return ((const TrxPars_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit();
}

TrxPars_template::TrxPars_template()
{
}

TrxPars_template::TrxPars_template(template_sel other_value)
 : Base_Record_Of_Template(other_value)
{
check_single_selection(other_value);
}

TrxPars_template::TrxPars_template(null_type)
 : Base_Record_Of_Template(SPECIFIC_VALUE)
{
single_value.n_elements = 0;
single_value.value_elements = NULL;
}

TrxPars_template::TrxPars_template(const TrxPars& other_value)
{
copy_value(other_value);
}

TrxPars_template::TrxPars_template(const OPTIONAL<TrxPars>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const TrxPars&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BTS_Tests.TrxPars from an unbound optional field.");
}
}

TrxPars_template::TrxPars_template(TrxPars_template* p_precondition, TrxPars_template* p_implied_template)
 : Base_Record_Of_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

TrxPars_template::TrxPars_template(Dynamic_Match_Interface<TrxPars>* p_dyn_match)
 : Base_Record_Of_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<TrxPars>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

TrxPars_template::TrxPars_template(const TrxPars_template& other_value)
 : Base_Record_Of_Template()
{
copy_template(other_value);
}

TrxPars_template::~TrxPars_template()
{
clean_up();
}

void TrxPars_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
delete single_value.value_elements[elem_count];
free_pointers((void**)single_value.value_elements);
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

TrxPars_template& TrxPars_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

TrxPars_template& TrxPars_template::operator=(null_type)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value.n_elements = 0;
single_value.value_elements = NULL;
return *this;
}

TrxPars_template& TrxPars_template::operator=(const TrxPars& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

TrxPars_template& TrxPars_template::operator=(const OPTIONAL<TrxPars>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const TrxPars&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @BTS_Tests.TrxPars.");
}
return *this;
}

TrxPars_template& TrxPars_template::operator=(const TrxPars_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

TrxParsItem_template& TrxPars_template::operator[](int index_value)
{
if (index_value < 0) TTCN_error("Accessing an element of a template for type @BTS_Tests.TrxPars using a negative index: %d.", index_value);
switch (template_selection)
{
  case SPECIFIC_VALUE:
    if(index_value < single_value.n_elements) break;
    // no break
  case OMIT_VALUE:
  case ANY_VALUE:
  case ANY_OR_OMIT:
  case UNINITIALIZED_TEMPLATE:
    set_size(index_value + 1);
    break;
  default:
    TTCN_error("Accessing an element of a non-specific template for type @BTS_Tests.TrxPars.");
    break;
}
return *single_value.value_elements[index_value];
}

TrxParsItem_template& TrxPars_template::operator[](const INTEGER& index_value)
{
index_value.must_bound("Using an unbound integer value for indexing a template of type @BTS_Tests.TrxPars.");
return (*this)[(int)index_value];
}

const TrxParsItem_template& TrxPars_template::operator[](int index_value) const
{
if (index_value < 0) TTCN_error("Accessing an element of a template for type @BTS_Tests.TrxPars using a negative index: %d.", index_value);
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing an element of a non-specific template for type @BTS_Tests.TrxPars.");
if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @BTS_Tests.TrxPars: The index is %d, but the template has only %d elements.", index_value, single_value.n_elements);
return *single_value.value_elements[index_value];
}

const TrxParsItem_template& TrxPars_template::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a template of type @BTS_Tests.TrxPars.");
return (*this)[(int)index_value];
}

void TrxPars_template::set_size(int new_size)
{
if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a template of type @BTS_Tests.TrxPars.");
template_sel old_selection = template_selection;
if (old_selection != SPECIFIC_VALUE) {
clean_up();
set_selection(SPECIFIC_VALUE);
single_value.n_elements = 0;
single_value.value_elements = NULL;
}
if (new_size > single_value.n_elements) {
single_value.value_elements = (TrxParsItem_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
for (int elem_count = single_value.n_elements; elem_count < new_size; elem_count++)
single_value.value_elements[elem_count] = new TrxParsItem_template(ANY_VALUE);
} else {
for (int elem_count = single_value.n_elements; elem_count < new_size; elem_count++)
single_value.value_elements[elem_count] = new TrxParsItem_template;
}
single_value.n_elements = new_size;
} else if (new_size < single_value.n_elements) {
for (int elem_count = new_size; elem_count < single_value.n_elements; elem_count++)
delete single_value.value_elements[elem_count];
single_value.value_elements = (TrxParsItem_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size);
single_value.n_elements = new_size;
}
}

int TrxPars_template::n_elem() const
{
  switch (template_selection) {
  case SPECIFIC_VALUE:
    return single_value.n_elements;
    break;
  case VALUE_LIST:
    return value_list.n_values;
    break;
  default:
    TTCN_error("Performing n_elem");
  }
}

int TrxPars_template::size_of(boolean is_size) const
{
const char* op_name = is_size ? "size" : "length";
int min_size;
boolean has_any_or_none;
if (is_ifpresent) TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.TrxPars which has an ifpresent attribute.", op_name);
switch (template_selection)
{
case SPECIFIC_VALUE: {
  min_size = 0;
  has_any_or_none = FALSE;
  int elem_count = single_value.n_elements;
  if (!is_size) { while (elem_count>0 && !single_value.value_elements[elem_count-1]->is_bound()) elem_count--; }
  for (int i=0; i<elem_count; i++) {
    switch (single_value.value_elements[i]->get_selection()) {
    case OMIT_VALUE:
      TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.TrxPars containing omit element.", op_name);
    case ANY_OR_OMIT:
      has_any_or_none = TRUE;
      break;
    default:
      min_size++;
      break;
    }
  }
} break;
case OMIT_VALUE:
  TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.TrxPars containing omit value.", op_name);
case ANY_VALUE:
case ANY_OR_OMIT:
  min_size = 0;
  has_any_or_none = TRUE;
  break;
case VALUE_LIST:
{
  if (value_list.n_values<1)
    TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.TrxPars containing an empty list.", op_name);
  int item_size = value_list.list_value[0].size_of(is_size);
  for (unsigned int i = 1; i < value_list.n_values; i++) {
    if (value_list.list_value[i].size_of(is_size)!=item_size)
      TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.TrxPars containing a value list with different sizes.", op_name);
  }
  min_size = item_size;
  has_any_or_none = FALSE;
  break;
}
case COMPLEMENTED_LIST:
  TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.TrxPars containing complemented list.", op_name);
default:
  TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @BTS_Tests.TrxPars.", op_name);
}
return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @BTS_Tests.TrxPars");
}

boolean TrxPars_template::match(const TrxPars& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
int value_length = other_value.size_of();
if (!match_length(value_length)) return FALSE;
switch (template_selection) {
case SPECIFIC_VALUE:
return match_record_of(&other_value, value_length, this, single_value.n_elements, match_function_specific, legacy);
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching with an uninitialized/unsupported template of type @BTS_Tests.TrxPars.");
}
return FALSE;
}

boolean TrxPars_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
if (!single_value.value_elements[elem_count]->is_value()) return FALSE;
return TRUE;
}

TrxPars TrxPars_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of type @BTS_Tests.TrxPars.");
TrxPars ret_val;
ret_val.set_size(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
if (single_value.value_elements[elem_count]->is_bound()) {
ret_val[elem_count] = single_value.value_elements[elem_count]->valueof();
}
return ret_val;
}

TrxPars TrxPars_template::substr(int index, int returncount) const
{
if (!is_value()) TTCN_error("The first argument of function substr() is a template with non-specific value.");
return valueof().substr(index, returncount);
}

TrxPars TrxPars_template::replace(int index, int len, const TrxPars_template& repl) const
{
if (!is_value()) TTCN_error("The first argument of function replace() is a template with non-specific value.");
if (!repl.is_value()) TTCN_error("The fourth argument of function replace() is a template with non-specific value.");
return valueof().replace(index, len, repl.valueof());
}

TrxPars TrxPars_template::replace(int index, int len, const TrxPars& repl) const
{
if (!is_value()) TTCN_error("The first argument of function replace() is a template with non-specific value.");
return valueof().replace(index, len, repl);
}

void TrxPars_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = list_length;
value_list.list_value = new TrxPars_template[list_length];
break;
default:
TTCN_error("Internal error: Setting an invalid type for a template of type @BTS_Tests.TrxPars.");
}
set_selection(template_type);
}

TrxPars_template& TrxPars_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Internal error: Accessing a list element of a non-list template of type @BTS_Tests.TrxPars.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @BTS_Tests.TrxPars.");
return value_list.list_value[list_index];
}

void TrxPars_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.n_elements > 0) {
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
if (permutation_starts_at(elem_count)) TTCN_Logger::log_event_str("permutation(");
single_value.value_elements[elem_count]->log();
if (permutation_ends_at(elem_count)) TTCN_Logger::log_char(')');
}
TTCN_Logger::log_event_str(" }");
} else TTCN_Logger::log_event_str("{ }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_restricted();
log_ifpresent();
}

void TrxPars_template::log_match(const TrxPars& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
}else{
if (template_selection == SPECIFIC_VALUE && single_value.n_elements > 0 && get_number_of_permutations() == 0 && single_value.n_elements == match_value.size_of()) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if(!single_value.value_elements[elem_count]->match(match_value[elem_count], legacy)){
TTCN_Logger::log_logmatch_info("[%d]", elem_count);
single_value.value_elements[elem_count]->log_match(match_value[elem_count], legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
log_match_length(single_value.n_elements);
} else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE && single_value.n_elements > 0 && get_number_of_permutations() == 0 && single_value.n_elements == match_value.size_of()) {
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
single_value.value_elements[elem_count]->log_match(match_value[elem_count], legacy);
}
TTCN_Logger::log_event_str(" }");
log_match_length(single_value.n_elements);
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void TrxPars_template::encode_text(Text_Buf& text_buf) const
{
encode_text_permutation(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
single_value.value_elements[elem_count]->encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BTS_Tests.TrxPars.");
}
}

void TrxPars_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_permutation(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value.n_elements = text_buf.pull_int().get_val();
if (single_value.n_elements < 0) TTCN_error("Text decoder: Negative size was received for a template of type @BTS_Tests.TrxPars.");
single_value.value_elements = (TrxParsItem_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
single_value.value_elements[elem_count] = new TrxParsItem_template;
single_value.value_elements[elem_count]->decode_text(text_buf);
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new TrxPars_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of type @BTS_Tests.TrxPars.");
}
}

boolean TrxPars_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean TrxPars_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void TrxPars_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
for (int i = 0; i < single_value.n_elements; i++) {
if (single_value.value_elements[i] != NULL) single_value.value_elements[i]->set_implicit_omit();
}
}

void TrxPars_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE|Module_Param::BC_LIST, "record of template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    TrxPars_template temp;
    temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = temp;
    break; }
  case Module_Param::MP_Indexed_List:
    if (template_selection!=SPECIFIC_VALUE) set_size(0);
    for (size_t p_i=0; p_i<param.get_size(); ++p_i) {
      (*this)[(int)(param.get_elem(p_i)->get_id()->get_index())].set_param(*param.get_elem(p_i));
    }
    break;
  case Module_Param::MP_Value_List: {
    set_size(param.get_size());
    int curr_idx = 0;
    for (size_t p_i=0; p_i<param.get_size(); ++p_i) {
      switch (param.get_elem(p_i)->get_type()) {
      case Module_Param::MP_NotUsed:
        curr_idx++;
        break;
      case Module_Param::MP_Permutation_Template: {
        int perm_start_idx = curr_idx;
        Module_Param* param_i = param.get_elem(p_i);
        for (size_t perm_i=0; perm_i<param_i->get_size(); perm_i++) {
          (*this)[curr_idx].set_param(*(param_i->get_elem(perm_i)));
          curr_idx++;
        }
        int perm_end_idx = curr_idx - 1;
        add_permutation(perm_start_idx, perm_end_idx);
      } break;
      default:
        (*this)[curr_idx].set_param(*param.get_elem(p_i));
        curr_idx++;
      }
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    TrxPars_template* precondition = new TrxPars_template;
    precondition->set_param(*param.get_elem(0));
    TrxPars_template* implied_template = new TrxPars_template;
    implied_template->set_param(*param.get_elem(1));
    *this = TrxPars_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record of template", "@BTS_Tests.TrxPars");
  }
  is_ifpresent = param.get_ifpresent();
  set_length_range(param);
}

void TrxPars_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
for (int i=0; i<single_value.n_elements; i++) single_value.value_elements[i]->check_restriction(t_res, t_name ? t_name : "@BTS_Tests.TrxPars");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@BTS_Tests.TrxPars");
}

boolean TrxPars_template::get_istemplate_kind(const char* type) const {
if (!strcmp(type, "AnyElement")) {
  if (template_selection != SPECIFIC_VALUE) {
    return FALSE;
  }
  for (int i = 0; i < single_value.n_elements; i++) {
    if (single_value.value_elements[i]->get_selection() == ANY_VALUE) {
      return TRUE;
    }
  }
  return FALSE;
} else if (!strcmp(type, "AnyElementsOrNone")) {
  if (template_selection != SPECIFIC_VALUE) {
    return FALSE;
  }
  for (int i = 0; i < single_value.n_elements; i++) {
    if (single_value.value_elements[i]->get_selection() == ANY_OR_OMIT) {
      return TRUE;
    }
  }
  return FALSE;
} else if (!strcmp(type, "permutation")) {
  return number_of_permutations;
} else if (!strcmp(type, "length")) {
  return length_restriction_type != NO_LENGTH_RESTRICTION;
} else {
  return Base_Template::get_istemplate_kind(type);
}
}

const TrxTsParsItem TrxTsPars::UNBOUND_ELEM;
TrxTsPars::TrxTsPars()
{
val_ptr = NULL;
}

TrxTsPars::TrxTsPars(null_type)
{
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
}

TrxTsPars::TrxTsPars(const TrxTsPars& other_value)
{
if (!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BTS_Tests.TrxTsPars.");
val_ptr = other_value.val_ptr;
val_ptr->ref_count++;
}

TrxTsPars::~TrxTsPars()
{
clean_up();
if (val_ptr != NULL) val_ptr = NULL;
}

void TrxTsPars::clean_up()
{
if (val_ptr != NULL) {
if (val_ptr->ref_count > 1) {
val_ptr->ref_count--;
val_ptr = NULL;
}
else if (val_ptr->ref_count == 1) {
for (int elem_count = 0; elem_count < val_ptr->n_elements;
elem_count++)
if (val_ptr->value_elements[elem_count] != NULL)
delete val_ptr->value_elements[elem_count];
free_pointers((void**)val_ptr->value_elements);
delete val_ptr;
val_ptr = NULL;
}
else
TTCN_error("Internal error: Invalid reference counter in a record of/set of value.");
}
}

TrxTsPars& TrxTsPars::operator=(null_type)
{
clean_up();
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
return *this;
}

TrxTsPars& TrxTsPars::operator=(const TrxTsPars& other_value)
{
if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @BTS_Tests.TrxTsPars.");
if (this != &other_value) {
clean_up();
val_ptr = other_value.val_ptr;
val_ptr->ref_count++;
}
return *this;
}

boolean TrxTsPars::operator==(null_type) const
{
if (val_ptr == NULL)
TTCN_error("The left operand of comparison is an unbound value of type @BTS_Tests.TrxTsPars.");
return val_ptr->n_elements == 0 ;
}

boolean TrxTsPars::operator==(const TrxTsPars& other_value) const
{
if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @BTS_Tests.TrxTsPars.");
if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @BTS_Tests.TrxTsPars.");
if (val_ptr == other_value.val_ptr) return TRUE;
if (val_ptr->n_elements != (other_value.val_ptr)->n_elements)
return FALSE;
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++){
if (val_ptr->value_elements[elem_count] != NULL){
if ((other_value.val_ptr)->value_elements[elem_count] != NULL){
  if (*val_ptr->value_elements[elem_count] != *(other_value.val_ptr)->value_elements[elem_count]) return FALSE;
} else return FALSE;
} else {
if ((other_value.val_ptr)->value_elements[elem_count] != NULL) return FALSE;
}
}
return TRUE;
}

TrxTsParsItem& TrxTsPars::operator[](int index_value)
{
if (index_value < 0) TTCN_error("Accessing an element of type @BTS_Tests.TrxTsPars using a negative index: %d.", index_value);
if (val_ptr == NULL) {
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
} else if (val_ptr->ref_count > 1) {
struct recordof_setof_struct *new_val_ptr = new recordof_setof_struct;
new_val_ptr->ref_count = 1;
new_val_ptr->n_elements = (index_value >= val_ptr->n_elements) ? index_value + 1 : val_ptr->n_elements;
new_val_ptr->value_elements = (TrxTsParsItem**)allocate_pointers(new_val_ptr->n_elements);
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++){
if (val_ptr->value_elements[elem_count] != NULL){
new_val_ptr->value_elements[elem_count] = new TrxTsParsItem(*(val_ptr->value_elements[elem_count]));
}
}
clean_up();
val_ptr = new_val_ptr;
}
if (index_value >= val_ptr->n_elements) set_size(index_value + 1);
if (val_ptr->value_elements[index_value] == NULL) {
val_ptr->value_elements[index_value] = new TrxTsParsItem;
}
return *val_ptr->value_elements[index_value];
}

TrxTsParsItem& TrxTsPars::operator[](const INTEGER& index_value)
{
index_value.must_bound("Using an unbound integer value for indexing a value of type @BTS_Tests.TrxTsPars.");
return (*this)[(int)index_value];
}

const TrxTsParsItem& TrxTsPars::operator[](int index_value) const
{
if (val_ptr == NULL)
TTCN_error("Accessing an element in an unbound value of type @BTS_Tests.TrxTsPars.");
if (index_value < 0) TTCN_error("Accessing an element of type @BTS_Tests.TrxTsPars using a negative index: %d.", index_value);
if (index_value >= val_ptr->n_elements) TTCN_error("Index overflow in a value of type @BTS_Tests.TrxTsPars: The index is %d, but the value has only %d elements.", index_value, val_ptr->n_elements);
return (val_ptr->value_elements[index_value] == NULL) ?
UNBOUND_ELEM : *val_ptr->value_elements[index_value];
}

const TrxTsParsItem& TrxTsPars::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a value of type @BTS_Tests.TrxTsPars.");
return (*this)[(int)index_value];
}

TrxTsPars TrxTsPars::operator<<=(int rotate_count) const
{
return *this >>= (-rotate_count);
}

TrxTsPars TrxTsPars::operator<<=(const INTEGER& rotate_count) const
{
rotate_count.must_bound("Unbound integer operand of rotate left operator.");
return *this >>= (int)(-rotate_count);
}

TrxTsPars TrxTsPars::operator>>=(const INTEGER& rotate_count) const
{
rotate_count.must_bound("Unbound integer operand of rotate right operator.");
return *this >>= (int)rotate_count;
}

TrxTsPars TrxTsPars::operator>>=(int rotate_count) const
{
if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @BTS_Tests.TrxTsPars.");
if (val_ptr->n_elements == 0) return *this;
int rc;
if (rotate_count>=0) rc = rotate_count % val_ptr->n_elements;
else rc = val_ptr->n_elements - ((-rotate_count) % val_ptr->n_elements);
if (rc == 0) return *this;
TrxTsPars ret_val;
ret_val.set_size(val_ptr->n_elements);
for (int i=0; i<val_ptr->n_elements; i++) {
if (val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[(i+rc)%val_ptr->n_elements] =new TrxTsParsItem(*val_ptr->value_elements[i]);
}
}
return ret_val;
}

TrxTsPars TrxTsPars::operator+(const TrxTsPars& other_value) const
{
if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @BTS_Tests.TrxTsPars concatenation.");
if (val_ptr->n_elements == 0) return other_value;
if (other_value.val_ptr->n_elements == 0) return *this;
TrxTsPars ret_val;
ret_val.set_size(val_ptr->n_elements+other_value.val_ptr->n_elements);
for (int i=0; i<val_ptr->n_elements; i++) {
if (val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i] = new TrxTsParsItem(*val_ptr->value_elements[i]);
}
}
for (int i=0; i<other_value.val_ptr->n_elements; i++) {
if (other_value.val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i+val_ptr->n_elements] = new TrxTsParsItem(*other_value.val_ptr->value_elements[i]);
}
}
return ret_val;
}

TrxTsPars TrxTsPars::substr(int index, int returncount) const
{
if (val_ptr == NULL) TTCN_error("The first argument of substr() is an unbound value of type @BTS_Tests.TrxTsPars.");
check_substr_arguments(val_ptr->n_elements, index, returncount, "@BTS_Tests.TrxTsPars","element");
TrxTsPars ret_val;
ret_val.set_size(returncount);
for (int i=0; i<returncount; i++) {
if (val_ptr->value_elements[i+index] != NULL) {
ret_val.val_ptr->value_elements[i] = new TrxTsParsItem(*val_ptr->value_elements[i+index]);
}
}
return ret_val;
}

TrxTsPars TrxTsPars::replace(int index, int len, const TrxTsPars& repl) const
{
if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @BTS_Tests.TrxTsPars.");
if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @BTS_Tests.TrxTsPars.");
check_replace_arguments(val_ptr->n_elements, index, len, "@BTS_Tests.TrxTsPars","element");
TrxTsPars ret_val;
ret_val.set_size(val_ptr->n_elements + repl.val_ptr->n_elements - len);
for (int i = 0; i < index; i++) {
if (val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i] = new TrxTsParsItem(*val_ptr->value_elements[i]);
}
}
for (int i = 0; i < repl.val_ptr->n_elements; i++) {
if (repl.val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i+index] = new TrxTsParsItem(*repl.val_ptr->value_elements[i]);
}
}
for (int i = 0; i < val_ptr->n_elements - index - len; i++) {
if (val_ptr->value_elements[index+i+len] != NULL) {
ret_val.val_ptr->value_elements[index+i+repl.val_ptr->n_elements] = new TrxTsParsItem(*val_ptr->value_elements[index+i+len]);
}
}
return ret_val;
}

TrxTsPars TrxTsPars::replace(int index, int len, const TrxTsPars_template& repl) const
{
if (!repl.is_value()) TTCN_error("The fourth argument of function replace() is a template with non-specific value.");
return replace(index, len, repl.valueof());
}

void TrxTsPars::set_size(int new_size)
{
if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @BTS_Tests.TrxTsPars.");
if (val_ptr == NULL) {
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
} else if (val_ptr->ref_count > 1) {
struct recordof_setof_struct *new_val_ptr = new recordof_setof_struct;
new_val_ptr->ref_count = 1;
new_val_ptr->n_elements = (new_size < val_ptr->n_elements) ? new_size : val_ptr->n_elements;
new_val_ptr->value_elements = (TrxTsParsItem**)allocate_pointers(new_val_ptr->n_elements);
for (int elem_count = 0; elem_count < new_val_ptr->n_elements; elem_count++) {
if (val_ptr->value_elements[elem_count] != NULL){
new_val_ptr->value_elements[elem_count] = new TrxTsParsItem(*(val_ptr->value_elements[elem_count]));
}
}
clean_up();
val_ptr = new_val_ptr;
}
if (new_size > val_ptr->n_elements) {
val_ptr->value_elements = (TrxTsParsItem**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size);
#ifdef TITAN_MEMORY_DEBUG_SET_RECORD_OF
if((val_ptr->n_elements/1000)!=(new_size/1000)) TTCN_warning("New size of type @BTS_Tests.TrxTsPars: %d",new_size);
#endif
val_ptr->n_elements = new_size;
} else if (new_size < val_ptr->n_elements) {
for (int elem_count = new_size; elem_count < val_ptr->n_elements; elem_count++)
if (val_ptr->value_elements[elem_count] != NULL)delete val_ptr->value_elements[elem_count];
val_ptr->value_elements = (TrxTsParsItem**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size);
val_ptr->n_elements = new_size;
}
}

boolean TrxTsPars::is_value() const
{
if (val_ptr == NULL) return FALSE;
for(int i = 0; i < val_ptr->n_elements; ++i) {
if (val_ptr->value_elements[i] == NULL || !val_ptr->value_elements[i]->is_value()) return FALSE;
}
return TRUE;
}

int TrxTsPars::size_of() const
{
if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @BTS_Tests.TrxTsPars.");
return val_ptr->n_elements;
}

int TrxTsPars::lengthof() const
{
if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @BTS_Tests.TrxTsPars.");
for (int my_length=val_ptr->n_elements; my_length>0; my_length--) if (val_ptr->value_elements[my_length-1] != NULL) return my_length;
return 0;
}

void TrxTsPars::log() const
{
if (val_ptr == NULL) {;
TTCN_Logger::log_event_unbound();
return;
}
switch (val_ptr->n_elements) {
case 0:
TTCN_Logger::log_event_str("{ }");
break;
default:
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
(*this)[elem_count].log();
}
TTCN_Logger::log_event_str(" }");
}
}

void TrxTsPars::set_implicit_omit()
{
if (val_ptr == NULL) return;
for (int i = 0; i < val_ptr->n_elements; i++) {
if (val_ptr->value_elements[i] != NULL) val_ptr->value_elements[i]->set_implicit_omit();
}
}

void TrxTsPars::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE|Module_Param::BC_LIST, "record of value");
  switch (param.get_operation_type()) {
  case Module_Param::OT_ASSIGN:
    if (param.get_type()==Module_Param::MP_Value_List && param.get_size()==0) {
      *this = NULL_VALUE;
      return;
    }
    switch (param.get_type()) {
    case Module_Param::MP_Value_List:
      set_size(param.get_size());
      for (size_t i=0; i<param.get_size(); ++i) {
        Module_Param* const curr = param.get_elem(i);
        if (curr->get_type()!=Module_Param::MP_NotUsed) {
          (*this)[i].set_param(*curr);
          if (!(*this)[i].is_bound()) {
            delete val_ptr->value_elements[i];
            val_ptr->value_elements[i] = NULL;
          }
        }
      }
      break;
    case Module_Param::MP_Indexed_List:
      for (size_t i=0; i<param.get_size(); ++i) {
        Module_Param* const curr = param.get_elem(i);
        (*this)[curr->get_id()->get_index()].set_param(*curr);
        if (!(*this)[curr->get_id()->get_index()].is_bound()) {
          delete val_ptr->value_elements[curr->get_id()->get_index()];
          val_ptr->value_elements[curr->get_id()->get_index()] = NULL;
        }
      }
      break;
    default:
      param.type_error("record of value", "@BTS_Tests.TrxTsPars");
    }
    break;
  case Module_Param::OT_CONCAT:
    switch (param.get_type()) {
    case Module_Param::MP_Value_List: {
      if (!is_bound()) *this = NULL_VALUE;
      int start_idx = lengthof();
      for (size_t i=0; i<param.get_size(); ++i) {
        Module_Param* const curr = param.get_elem(i);
        if ((curr->get_type()!=Module_Param::MP_NotUsed)) {
          (*this)[start_idx+(int)i].set_param(*curr);
        }
      }
    } break;
    case Module_Param::MP_Indexed_List:
      param.error("Cannot concatenate an indexed value list");
      break;
    default:
      param.type_error("record of value", "@BTS_Tests.TrxTsPars");
    }
    break;
  default:
    TTCN_error("Internal error: Unknown operation type.");
  }
}

void TrxTsPars::encode_text(Text_Buf& text_buf) const
{
if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @BTS_Tests.TrxTsPars.");
text_buf.push_int(val_ptr->n_elements);
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++)
(*this)[elem_count].encode_text(text_buf);
}

void TrxTsPars::decode_text(Text_Buf& text_buf)
{
clean_up();
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = text_buf.pull_int().get_val();
if (val_ptr->n_elements < 0) TTCN_error("Text decoder: Negative size was received for a value of type @BTS_Tests.TrxTsPars.");
val_ptr->value_elements = (TrxTsParsItem**)allocate_pointers(val_ptr->n_elements);
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) {
val_ptr->value_elements[elem_count] = new TrxTsParsItem;
val_ptr->value_elements[elem_count]->decode_text(text_buf);
}
}

void TrxTsPars_template::copy_value(const TrxTsPars& other_value)
{
if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @BTS_Tests.TrxTsPars with an unbound value.");
single_value.n_elements = other_value.size_of();
single_value.value_elements = (TrxTsParsItem_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (other_value[elem_count].is_bound()) {
single_value.value_elements[elem_count] = new TrxTsParsItem_template(other_value[elem_count]);
} else {
single_value.value_elements[elem_count] = new TrxTsParsItem_template;
}
}
set_selection(SPECIFIC_VALUE);
}

void TrxTsPars_template::copy_template(const TrxTsPars_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value.n_elements = other_value.single_value.n_elements;
single_value.value_elements = (TrxTsParsItem_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (UNINITIALIZED_TEMPLATE != other_value.single_value.value_elements[elem_count]->get_selection()) {
single_value.value_elements[elem_count] = new TrxTsParsItem_template(*other_value.single_value.value_elements[elem_count]);
} else {
single_value.value_elements[elem_count] = new TrxTsParsItem_template;
}
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new TrxTsPars_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new TrxTsPars_template(*other_value.implication_.precondition);
implication_.implied_template = new TrxTsPars_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BTS_Tests.TrxTsPars.");
break;
}
set_selection(other_value);
}

boolean TrxTsPars_template::match_function_specific(const Base_Type *value_ptr, int value_index, const Restricted_Length_Template *template_ptr, int template_index, boolean legacy)
{
if (value_index >= 0) return ((const TrxTsPars_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const TrxTsPars*)value_ptr)[value_index], legacy);
else return ((const TrxTsPars_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit();
}

TrxTsPars_template::TrxTsPars_template()
{
}

TrxTsPars_template::TrxTsPars_template(template_sel other_value)
 : Base_Record_Of_Template(other_value)
{
check_single_selection(other_value);
}

TrxTsPars_template::TrxTsPars_template(null_type)
 : Base_Record_Of_Template(SPECIFIC_VALUE)
{
single_value.n_elements = 0;
single_value.value_elements = NULL;
}

TrxTsPars_template::TrxTsPars_template(const TrxTsPars& other_value)
{
copy_value(other_value);
}

TrxTsPars_template::TrxTsPars_template(const OPTIONAL<TrxTsPars>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const TrxTsPars&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BTS_Tests.TrxTsPars from an unbound optional field.");
}
}

TrxTsPars_template::TrxTsPars_template(TrxTsPars_template* p_precondition, TrxTsPars_template* p_implied_template)
 : Base_Record_Of_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

TrxTsPars_template::TrxTsPars_template(Dynamic_Match_Interface<TrxTsPars>* p_dyn_match)
 : Base_Record_Of_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<TrxTsPars>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

TrxTsPars_template::TrxTsPars_template(const TrxTsPars_template& other_value)
 : Base_Record_Of_Template()
{
copy_template(other_value);
}

TrxTsPars_template::~TrxTsPars_template()
{
clean_up();
}

void TrxTsPars_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
delete single_value.value_elements[elem_count];
free_pointers((void**)single_value.value_elements);
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

TrxTsPars_template& TrxTsPars_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

TrxTsPars_template& TrxTsPars_template::operator=(null_type)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value.n_elements = 0;
single_value.value_elements = NULL;
return *this;
}

TrxTsPars_template& TrxTsPars_template::operator=(const TrxTsPars& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

TrxTsPars_template& TrxTsPars_template::operator=(const OPTIONAL<TrxTsPars>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const TrxTsPars&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @BTS_Tests.TrxTsPars.");
}
return *this;
}

TrxTsPars_template& TrxTsPars_template::operator=(const TrxTsPars_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

TrxTsParsItem_template& TrxTsPars_template::operator[](int index_value)
{
if (index_value < 0) TTCN_error("Accessing an element of a template for type @BTS_Tests.TrxTsPars using a negative index: %d.", index_value);
switch (template_selection)
{
  case SPECIFIC_VALUE:
    if(index_value < single_value.n_elements) break;
    // no break
  case OMIT_VALUE:
  case ANY_VALUE:
  case ANY_OR_OMIT:
  case UNINITIALIZED_TEMPLATE:
    set_size(index_value + 1);
    break;
  default:
    TTCN_error("Accessing an element of a non-specific template for type @BTS_Tests.TrxTsPars.");
    break;
}
return *single_value.value_elements[index_value];
}

TrxTsParsItem_template& TrxTsPars_template::operator[](const INTEGER& index_value)
{
index_value.must_bound("Using an unbound integer value for indexing a template of type @BTS_Tests.TrxTsPars.");
return (*this)[(int)index_value];
}

const TrxTsParsItem_template& TrxTsPars_template::operator[](int index_value) const
{
if (index_value < 0) TTCN_error("Accessing an element of a template for type @BTS_Tests.TrxTsPars using a negative index: %d.", index_value);
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing an element of a non-specific template for type @BTS_Tests.TrxTsPars.");
if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @BTS_Tests.TrxTsPars: The index is %d, but the template has only %d elements.", index_value, single_value.n_elements);
return *single_value.value_elements[index_value];
}

const TrxTsParsItem_template& TrxTsPars_template::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a template of type @BTS_Tests.TrxTsPars.");
return (*this)[(int)index_value];
}

void TrxTsPars_template::set_size(int new_size)
{
if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a template of type @BTS_Tests.TrxTsPars.");
template_sel old_selection = template_selection;
if (old_selection != SPECIFIC_VALUE) {
clean_up();
set_selection(SPECIFIC_VALUE);
single_value.n_elements = 0;
single_value.value_elements = NULL;
}
if (new_size > single_value.n_elements) {
single_value.value_elements = (TrxTsParsItem_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
for (int elem_count = single_value.n_elements; elem_count < new_size; elem_count++)
single_value.value_elements[elem_count] = new TrxTsParsItem_template(ANY_VALUE);
} else {
for (int elem_count = single_value.n_elements; elem_count < new_size; elem_count++)
single_value.value_elements[elem_count] = new TrxTsParsItem_template;
}
single_value.n_elements = new_size;
} else if (new_size < single_value.n_elements) {
for (int elem_count = new_size; elem_count < single_value.n_elements; elem_count++)
delete single_value.value_elements[elem_count];
single_value.value_elements = (TrxTsParsItem_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size);
single_value.n_elements = new_size;
}
}

int TrxTsPars_template::n_elem() const
{
  switch (template_selection) {
  case SPECIFIC_VALUE:
    return single_value.n_elements;
    break;
  case VALUE_LIST:
    return value_list.n_values;
    break;
  default:
    TTCN_error("Performing n_elem");
  }
}

int TrxTsPars_template::size_of(boolean is_size) const
{
const char* op_name = is_size ? "size" : "length";
int min_size;
boolean has_any_or_none;
if (is_ifpresent) TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.TrxTsPars which has an ifpresent attribute.", op_name);
switch (template_selection)
{
case SPECIFIC_VALUE: {
  min_size = 0;
  has_any_or_none = FALSE;
  int elem_count = single_value.n_elements;
  if (!is_size) { while (elem_count>0 && !single_value.value_elements[elem_count-1]->is_bound()) elem_count--; }
  for (int i=0; i<elem_count; i++) {
    switch (single_value.value_elements[i]->get_selection()) {
    case OMIT_VALUE:
      TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.TrxTsPars containing omit element.", op_name);
    case ANY_OR_OMIT:
      has_any_or_none = TRUE;
      break;
    default:
      min_size++;
      break;
    }
  }
} break;
case OMIT_VALUE:
  TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.TrxTsPars containing omit value.", op_name);
case ANY_VALUE:
case ANY_OR_OMIT:
  min_size = 0;
  has_any_or_none = TRUE;
  break;
case VALUE_LIST:
{
  if (value_list.n_values<1)
    TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.TrxTsPars containing an empty list.", op_name);
  int item_size = value_list.list_value[0].size_of(is_size);
  for (unsigned int i = 1; i < value_list.n_values; i++) {
    if (value_list.list_value[i].size_of(is_size)!=item_size)
      TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.TrxTsPars containing a value list with different sizes.", op_name);
  }
  min_size = item_size;
  has_any_or_none = FALSE;
  break;
}
case COMPLEMENTED_LIST:
  TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.TrxTsPars containing complemented list.", op_name);
default:
  TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @BTS_Tests.TrxTsPars.", op_name);
}
return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @BTS_Tests.TrxTsPars");
}

boolean TrxTsPars_template::match(const TrxTsPars& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
int value_length = other_value.size_of();
if (!match_length(value_length)) return FALSE;
switch (template_selection) {
case SPECIFIC_VALUE:
return match_record_of(&other_value, value_length, this, single_value.n_elements, match_function_specific, legacy);
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching with an uninitialized/unsupported template of type @BTS_Tests.TrxTsPars.");
}
return FALSE;
}

boolean TrxTsPars_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
if (!single_value.value_elements[elem_count]->is_value()) return FALSE;
return TRUE;
}

TrxTsPars TrxTsPars_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of type @BTS_Tests.TrxTsPars.");
TrxTsPars ret_val;
ret_val.set_size(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
if (single_value.value_elements[elem_count]->is_bound()) {
ret_val[elem_count] = single_value.value_elements[elem_count]->valueof();
}
return ret_val;
}

TrxTsPars TrxTsPars_template::substr(int index, int returncount) const
{
if (!is_value()) TTCN_error("The first argument of function substr() is a template with non-specific value.");
return valueof().substr(index, returncount);
}

TrxTsPars TrxTsPars_template::replace(int index, int len, const TrxTsPars_template& repl) const
{
if (!is_value()) TTCN_error("The first argument of function replace() is a template with non-specific value.");
if (!repl.is_value()) TTCN_error("The fourth argument of function replace() is a template with non-specific value.");
return valueof().replace(index, len, repl.valueof());
}

TrxTsPars TrxTsPars_template::replace(int index, int len, const TrxTsPars& repl) const
{
if (!is_value()) TTCN_error("The first argument of function replace() is a template with non-specific value.");
return valueof().replace(index, len, repl);
}

void TrxTsPars_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = list_length;
value_list.list_value = new TrxTsPars_template[list_length];
break;
default:
TTCN_error("Internal error: Setting an invalid type for a template of type @BTS_Tests.TrxTsPars.");
}
set_selection(template_type);
}

TrxTsPars_template& TrxTsPars_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Internal error: Accessing a list element of a non-list template of type @BTS_Tests.TrxTsPars.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @BTS_Tests.TrxTsPars.");
return value_list.list_value[list_index];
}

void TrxTsPars_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.n_elements > 0) {
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
if (permutation_starts_at(elem_count)) TTCN_Logger::log_event_str("permutation(");
single_value.value_elements[elem_count]->log();
if (permutation_ends_at(elem_count)) TTCN_Logger::log_char(')');
}
TTCN_Logger::log_event_str(" }");
} else TTCN_Logger::log_event_str("{ }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_restricted();
log_ifpresent();
}

void TrxTsPars_template::log_match(const TrxTsPars& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
}else{
if (template_selection == SPECIFIC_VALUE && single_value.n_elements > 0 && get_number_of_permutations() == 0 && single_value.n_elements == match_value.size_of()) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if(!single_value.value_elements[elem_count]->match(match_value[elem_count], legacy)){
TTCN_Logger::log_logmatch_info("[%d]", elem_count);
single_value.value_elements[elem_count]->log_match(match_value[elem_count], legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
log_match_length(single_value.n_elements);
} else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE && single_value.n_elements > 0 && get_number_of_permutations() == 0 && single_value.n_elements == match_value.size_of()) {
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
single_value.value_elements[elem_count]->log_match(match_value[elem_count], legacy);
}
TTCN_Logger::log_event_str(" }");
log_match_length(single_value.n_elements);
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void TrxTsPars_template::encode_text(Text_Buf& text_buf) const
{
encode_text_permutation(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
single_value.value_elements[elem_count]->encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BTS_Tests.TrxTsPars.");
}
}

void TrxTsPars_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_permutation(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value.n_elements = text_buf.pull_int().get_val();
if (single_value.n_elements < 0) TTCN_error("Text decoder: Negative size was received for a template of type @BTS_Tests.TrxTsPars.");
single_value.value_elements = (TrxTsParsItem_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
single_value.value_elements[elem_count] = new TrxTsParsItem_template;
single_value.value_elements[elem_count]->decode_text(text_buf);
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new TrxTsPars_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of type @BTS_Tests.TrxTsPars.");
}
}

boolean TrxTsPars_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean TrxTsPars_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void TrxTsPars_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
for (int i = 0; i < single_value.n_elements; i++) {
if (single_value.value_elements[i] != NULL) single_value.value_elements[i]->set_implicit_omit();
}
}

void TrxTsPars_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE|Module_Param::BC_LIST, "record of template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    TrxTsPars_template temp;
    temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = temp;
    break; }
  case Module_Param::MP_Indexed_List:
    if (template_selection!=SPECIFIC_VALUE) set_size(0);
    for (size_t p_i=0; p_i<param.get_size(); ++p_i) {
      (*this)[(int)(param.get_elem(p_i)->get_id()->get_index())].set_param(*param.get_elem(p_i));
    }
    break;
  case Module_Param::MP_Value_List: {
    set_size(param.get_size());
    int curr_idx = 0;
    for (size_t p_i=0; p_i<param.get_size(); ++p_i) {
      switch (param.get_elem(p_i)->get_type()) {
      case Module_Param::MP_NotUsed:
        curr_idx++;
        break;
      case Module_Param::MP_Permutation_Template: {
        int perm_start_idx = curr_idx;
        Module_Param* param_i = param.get_elem(p_i);
        for (size_t perm_i=0; perm_i<param_i->get_size(); perm_i++) {
          (*this)[curr_idx].set_param(*(param_i->get_elem(perm_i)));
          curr_idx++;
        }
        int perm_end_idx = curr_idx - 1;
        add_permutation(perm_start_idx, perm_end_idx);
      } break;
      default:
        (*this)[curr_idx].set_param(*param.get_elem(p_i));
        curr_idx++;
      }
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    TrxTsPars_template* precondition = new TrxTsPars_template;
    precondition->set_param(*param.get_elem(0));
    TrxTsPars_template* implied_template = new TrxTsPars_template;
    implied_template->set_param(*param.get_elem(1));
    *this = TrxTsPars_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record of template", "@BTS_Tests.TrxTsPars");
  }
  is_ifpresent = param.get_ifpresent();
  set_length_range(param);
}

void TrxTsPars_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
for (int i=0; i<single_value.n_elements; i++) single_value.value_elements[i]->check_restriction(t_res, t_name ? t_name : "@BTS_Tests.TrxTsPars");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@BTS_Tests.TrxTsPars");
}

boolean TrxTsPars_template::get_istemplate_kind(const char* type) const {
if (!strcmp(type, "AnyElement")) {
  if (template_selection != SPECIFIC_VALUE) {
    return FALSE;
  }
  for (int i = 0; i < single_value.n_elements; i++) {
    if (single_value.value_elements[i]->get_selection() == ANY_VALUE) {
      return TRUE;
    }
  }
  return FALSE;
} else if (!strcmp(type, "AnyElementsOrNone")) {
  if (template_selection != SPECIFIC_VALUE) {
    return FALSE;
  }
  for (int i = 0; i < single_value.n_elements; i++) {
    if (single_value.value_elements[i]->get_selection() == ANY_OR_OMIT) {
      return TRUE;
    }
  }
  return FALSE;
} else if (!strcmp(type, "permutation")) {
  return number_of_permutations;
} else if (!strcmp(type, "length")) {
  return length_restriction_type != NO_LENGTH_RESTRICTION;
} else {
  return Base_Template::get_istemplate_kind(type);
}
}
TrxTsParsItem::TrxTsParsItem()
{
}

TrxTsParsItem::TrxTsParsItem(const GSM__Types::PchanConfig& par_config)
  :   field_config(par_config)
{
}

TrxTsParsItem::TrxTsParsItem(const TrxTsParsItem& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BTS_Tests.TrxTsParsItem.");
if (other_value.config().is_bound()) field_config = other_value.config();
else field_config.clean_up();
}

void TrxTsParsItem::clean_up()
{
field_config.clean_up();
}

const TTCN_Typedescriptor_t* TrxTsParsItem::get_descriptor() const { return &TrxTsParsItem_descr_; }
TrxTsParsItem& TrxTsParsItem::operator=(const TrxTsParsItem& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BTS_Tests.TrxTsParsItem.");
  if (other_value.config().is_bound()) field_config = other_value.config();
  else field_config.clean_up();
}
return *this;
}

boolean TrxTsParsItem::operator==(const TrxTsParsItem& other_value) const
{
return field_config==other_value.field_config;
}

boolean TrxTsParsItem::is_bound() const
{
return (field_config.is_bound());
}
boolean TrxTsParsItem::is_value() const
{
return field_config.is_value();
}
void TrxTsParsItem::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ config := ");
field_config.log();
TTCN_Logger::log_event_str(" }");
}

void TrxTsParsItem::set_implicit_omit()
{
if (config().is_bound()) config().set_implicit_omit();
}

void TrxTsParsItem::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (1<param.get_size()) {
      param.error("record value of type @BTS_Tests.TrxTsParsItem has 1 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) config().set_param(*param.get_elem(0));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "config")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          config().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BTS_Tests.TrxTsParsItem: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BTS_Tests.TrxTsParsItem");
  }
}

void TrxTsParsItem::encode_text(Text_Buf& text_buf) const
{
field_config.encode_text(text_buf);
}

void TrxTsParsItem::decode_text(Text_Buf& text_buf)
{
field_config.decode_text(text_buf);
}

struct TrxTsParsItem_template::single_value_struct {
GSM__Types::PchanConfig_template field_config;
};

void TrxTsParsItem_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_config = ANY_VALUE;
}
}
}

void TrxTsParsItem_template::copy_value(const TrxTsParsItem& other_value)
{
single_value = new single_value_struct;
if (other_value.config().is_bound()) {
  single_value->field_config = other_value.config();
} else {
  single_value->field_config.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void TrxTsParsItem_template::copy_template(const TrxTsParsItem_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.config().get_selection()) {
single_value->field_config = other_value.config();
} else {
single_value->field_config.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new TrxTsParsItem_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new TrxTsParsItem_template(*other_value.implication_.precondition);
implication_.implied_template = new TrxTsParsItem_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BTS_Tests.TrxTsParsItem.");
break;
}
set_selection(other_value);
}

TrxTsParsItem_template::TrxTsParsItem_template()
{
}

TrxTsParsItem_template::TrxTsParsItem_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

TrxTsParsItem_template::TrxTsParsItem_template(const TrxTsParsItem& other_value)
{
copy_value(other_value);
}

TrxTsParsItem_template::TrxTsParsItem_template(const OPTIONAL<TrxTsParsItem>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const TrxTsParsItem&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BTS_Tests.TrxTsParsItem from an unbound optional field.");
}
}

TrxTsParsItem_template::TrxTsParsItem_template(TrxTsParsItem_template* p_precondition, TrxTsParsItem_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

TrxTsParsItem_template::TrxTsParsItem_template(Dynamic_Match_Interface<TrxTsParsItem>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<TrxTsParsItem>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

TrxTsParsItem_template::TrxTsParsItem_template(const TrxTsParsItem_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

TrxTsParsItem_template::~TrxTsParsItem_template()
{
clean_up();
}

TrxTsParsItem_template& TrxTsParsItem_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

TrxTsParsItem_template& TrxTsParsItem_template::operator=(const TrxTsParsItem& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

TrxTsParsItem_template& TrxTsParsItem_template::operator=(const OPTIONAL<TrxTsParsItem>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const TrxTsParsItem&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @BTS_Tests.TrxTsParsItem.");
}
return *this;
}

TrxTsParsItem_template& TrxTsParsItem_template::operator=(const TrxTsParsItem_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean TrxTsParsItem_template::match(const TrxTsParsItem& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.config().is_bound()) return FALSE;
if(!single_value->field_config.match(other_value.config(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BTS_Tests.TrxTsParsItem.");
}
return FALSE;
}

boolean TrxTsParsItem_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_config.is_bound();
}

boolean TrxTsParsItem_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_config.is_value();
}

void TrxTsParsItem_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

TrxTsParsItem TrxTsParsItem_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BTS_Tests.TrxTsParsItem.");
TrxTsParsItem ret_val;
if (single_value->field_config.is_bound()) {
ret_val.config() = single_value->field_config.valueof();
}
return ret_val;
}

void TrxTsParsItem_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @BTS_Tests.TrxTsParsItem.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new TrxTsParsItem_template[list_length];
}

TrxTsParsItem_template& TrxTsParsItem_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @BTS_Tests.TrxTsParsItem.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BTS_Tests.TrxTsParsItem.");
return value_list.list_value[list_index];
}

GSM__Types::PchanConfig_template& TrxTsParsItem_template::config()
{
set_specific();
return single_value->field_config;
}

const GSM__Types::PchanConfig_template& TrxTsParsItem_template::config() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field config of a non-specific template of type @BTS_Tests.TrxTsParsItem.");
return single_value->field_config;
}

int TrxTsParsItem_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.TrxTsParsItem which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 1;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @BTS_Tests.TrxTsParsItem containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.TrxTsParsItem containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.TrxTsParsItem containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.TrxTsParsItem containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.TrxTsParsItem containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.TrxTsParsItem containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.TrxTsParsItem containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.TrxTsParsItem containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BTS_Tests.TrxTsParsItem.");
  }
  return 0;
}

void TrxTsParsItem_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ config := ");
single_value->field_config.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void TrxTsParsItem_template::log_match(const TrxTsParsItem& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_config.match(match_value.config(), legacy)){
TTCN_Logger::log_logmatch_info(".config");
single_value->field_config.log_match(match_value.config(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ config := ");
single_value->field_config.log_match(match_value.config(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void TrxTsParsItem_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (config().is_bound()) config().set_implicit_omit();
}

void TrxTsParsItem_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_config.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BTS_Tests.TrxTsParsItem.");
}
}

void TrxTsParsItem_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_config.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new TrxTsParsItem_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @BTS_Tests.TrxTsParsItem.");
}
}

void TrxTsParsItem_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    TrxTsParsItem_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (1<param.get_size()) {
      param.error("record template of type @BTS_Tests.TrxTsParsItem has 1 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) config().set_param(*param.get_elem(0));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "config")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          config().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BTS_Tests.TrxTsParsItem: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    TrxTsParsItem_template* precondition = new TrxTsParsItem_template;
    precondition->set_param(*param.get_elem(0));
    TrxTsParsItem_template* implied_template = new TrxTsParsItem_template;
    implied_template->set_param(*param.get_elem(1));
    *this = TrxTsParsItem_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BTS_Tests.TrxTsParsItem");
  }
  is_ifpresent = param.get_ifpresent();
}

void TrxTsParsItem_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_config.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.TrxTsParsItem");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@BTS_Tests.TrxTsParsItem");
}

boolean TrxTsParsItem_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean TrxTsParsItem_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

TrxParsItem::TrxParsItem()
{
}

TrxParsItem::TrxParsItem(const INTEGER& par_arfcn,
    const TrxTsPars& par_ts)
  :   field_arfcn(par_arfcn),
  field_ts(par_ts)
{
}

TrxParsItem::TrxParsItem(const TrxParsItem& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BTS_Tests.TrxParsItem.");
if (other_value.arfcn().is_bound()) field_arfcn = other_value.arfcn();
else field_arfcn.clean_up();
if (other_value.ts().is_bound()) field_ts = other_value.ts();
else field_ts.clean_up();
}

void TrxParsItem::clean_up()
{
field_arfcn.clean_up();
field_ts.clean_up();
}

const TTCN_Typedescriptor_t* TrxParsItem::get_descriptor() const { return &TrxParsItem_descr_; }
TrxParsItem& TrxParsItem::operator=(const TrxParsItem& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BTS_Tests.TrxParsItem.");
  if (other_value.arfcn().is_bound()) field_arfcn = other_value.arfcn();
  else field_arfcn.clean_up();
  if (other_value.ts().is_bound()) field_ts = other_value.ts();
  else field_ts.clean_up();
}
return *this;
}

boolean TrxParsItem::operator==(const TrxParsItem& other_value) const
{
return field_arfcn==other_value.field_arfcn
  && field_ts==other_value.field_ts;
}

boolean TrxParsItem::is_bound() const
{
return (field_arfcn.is_bound())
  || (field_ts.is_bound());
}
boolean TrxParsItem::is_value() const
{
return field_arfcn.is_value()
  && field_ts.is_value();
}
void TrxParsItem::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ arfcn := ");
field_arfcn.log();
TTCN_Logger::log_event_str(", ts := ");
field_ts.log();
TTCN_Logger::log_event_str(" }");
}

void TrxParsItem::set_implicit_omit()
{
if (arfcn().is_bound()) arfcn().set_implicit_omit();
if (ts().is_bound()) ts().set_implicit_omit();
}

void TrxParsItem::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record value of type @BTS_Tests.TrxParsItem has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) arfcn().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ts().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "arfcn")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          arfcn().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ts")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ts().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BTS_Tests.TrxParsItem: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BTS_Tests.TrxParsItem");
  }
}

void TrxParsItem::encode_text(Text_Buf& text_buf) const
{
field_arfcn.encode_text(text_buf);
field_ts.encode_text(text_buf);
}

void TrxParsItem::decode_text(Text_Buf& text_buf)
{
field_arfcn.decode_text(text_buf);
field_ts.decode_text(text_buf);
}

struct TrxParsItem_template::single_value_struct {
INTEGER_template field_arfcn;
TrxTsPars_template field_ts;
};

void TrxParsItem_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_arfcn = ANY_VALUE;
single_value->field_ts = ANY_VALUE;
}
}
}

void TrxParsItem_template::copy_value(const TrxParsItem& other_value)
{
single_value = new single_value_struct;
if (other_value.arfcn().is_bound()) {
  single_value->field_arfcn = other_value.arfcn();
} else {
  single_value->field_arfcn.clean_up();
}
if (other_value.ts().is_bound()) {
  single_value->field_ts = other_value.ts();
} else {
  single_value->field_ts.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void TrxParsItem_template::copy_template(const TrxParsItem_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.arfcn().get_selection()) {
single_value->field_arfcn = other_value.arfcn();
} else {
single_value->field_arfcn.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ts().get_selection()) {
single_value->field_ts = other_value.ts();
} else {
single_value->field_ts.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new TrxParsItem_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new TrxParsItem_template(*other_value.implication_.precondition);
implication_.implied_template = new TrxParsItem_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BTS_Tests.TrxParsItem.");
break;
}
set_selection(other_value);
}

TrxParsItem_template::TrxParsItem_template()
{
}

TrxParsItem_template::TrxParsItem_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

TrxParsItem_template::TrxParsItem_template(const TrxParsItem& other_value)
{
copy_value(other_value);
}

TrxParsItem_template::TrxParsItem_template(const OPTIONAL<TrxParsItem>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const TrxParsItem&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BTS_Tests.TrxParsItem from an unbound optional field.");
}
}

TrxParsItem_template::TrxParsItem_template(TrxParsItem_template* p_precondition, TrxParsItem_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

TrxParsItem_template::TrxParsItem_template(Dynamic_Match_Interface<TrxParsItem>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<TrxParsItem>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

TrxParsItem_template::TrxParsItem_template(const TrxParsItem_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

TrxParsItem_template::~TrxParsItem_template()
{
clean_up();
}

TrxParsItem_template& TrxParsItem_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

TrxParsItem_template& TrxParsItem_template::operator=(const TrxParsItem& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

TrxParsItem_template& TrxParsItem_template::operator=(const OPTIONAL<TrxParsItem>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const TrxParsItem&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @BTS_Tests.TrxParsItem.");
}
return *this;
}

TrxParsItem_template& TrxParsItem_template::operator=(const TrxParsItem_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean TrxParsItem_template::match(const TrxParsItem& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.arfcn().is_bound()) return FALSE;
if(!single_value->field_arfcn.match(other_value.arfcn(), legacy))return FALSE;
if(!other_value.ts().is_bound()) return FALSE;
if(!single_value->field_ts.match(other_value.ts(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BTS_Tests.TrxParsItem.");
}
return FALSE;
}

boolean TrxParsItem_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_arfcn.is_bound()
 || single_value->field_ts.is_bound();
}

boolean TrxParsItem_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_arfcn.is_value()
 && single_value->field_ts.is_value();
}

void TrxParsItem_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

TrxParsItem TrxParsItem_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BTS_Tests.TrxParsItem.");
TrxParsItem ret_val;
if (single_value->field_arfcn.is_bound()) {
ret_val.arfcn() = single_value->field_arfcn.valueof();
}
if (single_value->field_ts.is_bound()) {
ret_val.ts() = single_value->field_ts.valueof();
}
return ret_val;
}

void TrxParsItem_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @BTS_Tests.TrxParsItem.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new TrxParsItem_template[list_length];
}

TrxParsItem_template& TrxParsItem_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @BTS_Tests.TrxParsItem.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BTS_Tests.TrxParsItem.");
return value_list.list_value[list_index];
}

INTEGER_template& TrxParsItem_template::arfcn()
{
set_specific();
return single_value->field_arfcn;
}

const INTEGER_template& TrxParsItem_template::arfcn() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field arfcn of a non-specific template of type @BTS_Tests.TrxParsItem.");
return single_value->field_arfcn;
}

TrxTsPars_template& TrxParsItem_template::ts()
{
set_specific();
return single_value->field_ts;
}

const TrxTsPars_template& TrxParsItem_template::ts() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ts of a non-specific template of type @BTS_Tests.TrxParsItem.");
return single_value->field_ts;
}

int TrxParsItem_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.TrxParsItem which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 2;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @BTS_Tests.TrxParsItem containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.TrxParsItem containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.TrxParsItem containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.TrxParsItem containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.TrxParsItem containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.TrxParsItem containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.TrxParsItem containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.TrxParsItem containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BTS_Tests.TrxParsItem.");
  }
  return 0;
}

void TrxParsItem_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ arfcn := ");
single_value->field_arfcn.log();
TTCN_Logger::log_event_str(", ts := ");
single_value->field_ts.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void TrxParsItem_template::log_match(const TrxParsItem& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_arfcn.match(match_value.arfcn(), legacy)){
TTCN_Logger::log_logmatch_info(".arfcn");
single_value->field_arfcn.log_match(match_value.arfcn(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ts.match(match_value.ts(), legacy)){
TTCN_Logger::log_logmatch_info(".ts");
single_value->field_ts.log_match(match_value.ts(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ arfcn := ");
single_value->field_arfcn.log_match(match_value.arfcn(), legacy);
TTCN_Logger::log_event_str(", ts := ");
single_value->field_ts.log_match(match_value.ts(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void TrxParsItem_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (arfcn().is_bound()) arfcn().set_implicit_omit();
if (ts().is_bound()) ts().set_implicit_omit();
}

void TrxParsItem_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_arfcn.encode_text(text_buf);
single_value->field_ts.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BTS_Tests.TrxParsItem.");
}
}

void TrxParsItem_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_arfcn.decode_text(text_buf);
single_value->field_ts.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new TrxParsItem_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @BTS_Tests.TrxParsItem.");
}
}

void TrxParsItem_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    TrxParsItem_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record template of type @BTS_Tests.TrxParsItem has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) arfcn().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) ts().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "arfcn")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          arfcn().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ts")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ts().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BTS_Tests.TrxParsItem: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    TrxParsItem_template* precondition = new TrxParsItem_template;
    precondition->set_param(*param.get_elem(0));
    TrxParsItem_template* implied_template = new TrxParsItem_template;
    implied_template->set_param(*param.get_elem(1));
    *this = TrxParsItem_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BTS_Tests.TrxParsItem");
  }
  is_ifpresent = param.get_ifpresent();
}

void TrxParsItem_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_arfcn.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.TrxParsItem");
single_value->field_ts.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.TrxParsItem");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@BTS_Tests.TrxParsItem");
}

boolean TrxParsItem_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean TrxParsItem_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}


const GSM__Types::RslChannelNr ChannelNrs::UNBOUND_ELEM;
ChannelNrs::ChannelNrs()
{
val_ptr = NULL;
}

ChannelNrs::ChannelNrs(null_type)
{
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
}

ChannelNrs::ChannelNrs(const ChannelNrs& other_value)
{
if (!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BTS_Tests.ChannelNrs.");
val_ptr = other_value.val_ptr;
val_ptr->ref_count++;
}

ChannelNrs::~ChannelNrs()
{
clean_up();
if (val_ptr != NULL) val_ptr = NULL;
}

void ChannelNrs::clean_up()
{
if (val_ptr != NULL) {
if (val_ptr->ref_count > 1) {
val_ptr->ref_count--;
val_ptr = NULL;
}
else if (val_ptr->ref_count == 1) {
for (int elem_count = 0; elem_count < val_ptr->n_elements;
elem_count++)
if (val_ptr->value_elements[elem_count] != NULL)
delete val_ptr->value_elements[elem_count];
free_pointers((void**)val_ptr->value_elements);
delete val_ptr;
val_ptr = NULL;
}
else
TTCN_error("Internal error: Invalid reference counter in a record of/set of value.");
}
}

ChannelNrs& ChannelNrs::operator=(null_type)
{
clean_up();
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
return *this;
}

ChannelNrs& ChannelNrs::operator=(const ChannelNrs& other_value)
{
if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @BTS_Tests.ChannelNrs.");
if (this != &other_value) {
clean_up();
val_ptr = other_value.val_ptr;
val_ptr->ref_count++;
}
return *this;
}

boolean ChannelNrs::operator==(null_type) const
{
if (val_ptr == NULL)
TTCN_error("The left operand of comparison is an unbound value of type @BTS_Tests.ChannelNrs.");
return val_ptr->n_elements == 0 ;
}

boolean ChannelNrs::operator==(const ChannelNrs& other_value) const
{
if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @BTS_Tests.ChannelNrs.");
if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @BTS_Tests.ChannelNrs.");
if (val_ptr == other_value.val_ptr) return TRUE;
if (val_ptr->n_elements != (other_value.val_ptr)->n_elements)
return FALSE;
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++){
if (val_ptr->value_elements[elem_count] != NULL){
if ((other_value.val_ptr)->value_elements[elem_count] != NULL){
  if (*val_ptr->value_elements[elem_count] != *(other_value.val_ptr)->value_elements[elem_count]) return FALSE;
} else return FALSE;
} else {
if ((other_value.val_ptr)->value_elements[elem_count] != NULL) return FALSE;
}
}
return TRUE;
}

GSM__Types::RslChannelNr& ChannelNrs::operator[](int index_value)
{
if (index_value < 0) TTCN_error("Accessing an element of type @BTS_Tests.ChannelNrs using a negative index: %d.", index_value);
if (val_ptr == NULL) {
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
} else if (val_ptr->ref_count > 1) {
struct recordof_setof_struct *new_val_ptr = new recordof_setof_struct;
new_val_ptr->ref_count = 1;
new_val_ptr->n_elements = (index_value >= val_ptr->n_elements) ? index_value + 1 : val_ptr->n_elements;
new_val_ptr->value_elements = (GSM__Types::RslChannelNr**)allocate_pointers(new_val_ptr->n_elements);
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++){
if (val_ptr->value_elements[elem_count] != NULL){
new_val_ptr->value_elements[elem_count] = new GSM__Types::RslChannelNr(*(val_ptr->value_elements[elem_count]));
}
}
clean_up();
val_ptr = new_val_ptr;
}
if (index_value >= val_ptr->n_elements) set_size(index_value + 1);
if (val_ptr->value_elements[index_value] == NULL) {
val_ptr->value_elements[index_value] = new GSM__Types::RslChannelNr;
}
return *val_ptr->value_elements[index_value];
}

GSM__Types::RslChannelNr& ChannelNrs::operator[](const INTEGER& index_value)
{
index_value.must_bound("Using an unbound integer value for indexing a value of type @BTS_Tests.ChannelNrs.");
return (*this)[(int)index_value];
}

const GSM__Types::RslChannelNr& ChannelNrs::operator[](int index_value) const
{
if (val_ptr == NULL)
TTCN_error("Accessing an element in an unbound value of type @BTS_Tests.ChannelNrs.");
if (index_value < 0) TTCN_error("Accessing an element of type @BTS_Tests.ChannelNrs using a negative index: %d.", index_value);
if (index_value >= val_ptr->n_elements) TTCN_error("Index overflow in a value of type @BTS_Tests.ChannelNrs: The index is %d, but the value has only %d elements.", index_value, val_ptr->n_elements);
return (val_ptr->value_elements[index_value] == NULL) ?
UNBOUND_ELEM : *val_ptr->value_elements[index_value];
}

const GSM__Types::RslChannelNr& ChannelNrs::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a value of type @BTS_Tests.ChannelNrs.");
return (*this)[(int)index_value];
}

ChannelNrs ChannelNrs::operator<<=(int rotate_count) const
{
return *this >>= (-rotate_count);
}

ChannelNrs ChannelNrs::operator<<=(const INTEGER& rotate_count) const
{
rotate_count.must_bound("Unbound integer operand of rotate left operator.");
return *this >>= (int)(-rotate_count);
}

ChannelNrs ChannelNrs::operator>>=(const INTEGER& rotate_count) const
{
rotate_count.must_bound("Unbound integer operand of rotate right operator.");
return *this >>= (int)rotate_count;
}

ChannelNrs ChannelNrs::operator>>=(int rotate_count) const
{
if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @BTS_Tests.ChannelNrs.");
if (val_ptr->n_elements == 0) return *this;
int rc;
if (rotate_count>=0) rc = rotate_count % val_ptr->n_elements;
else rc = val_ptr->n_elements - ((-rotate_count) % val_ptr->n_elements);
if (rc == 0) return *this;
ChannelNrs ret_val;
ret_val.set_size(val_ptr->n_elements);
for (int i=0; i<val_ptr->n_elements; i++) {
if (val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[(i+rc)%val_ptr->n_elements] =new GSM__Types::RslChannelNr(*val_ptr->value_elements[i]);
}
}
return ret_val;
}

ChannelNrs ChannelNrs::operator+(const ChannelNrs& other_value) const
{
if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @BTS_Tests.ChannelNrs concatenation.");
if (val_ptr->n_elements == 0) return other_value;
if (other_value.val_ptr->n_elements == 0) return *this;
ChannelNrs ret_val;
ret_val.set_size(val_ptr->n_elements+other_value.val_ptr->n_elements);
for (int i=0; i<val_ptr->n_elements; i++) {
if (val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i] = new GSM__Types::RslChannelNr(*val_ptr->value_elements[i]);
}
}
for (int i=0; i<other_value.val_ptr->n_elements; i++) {
if (other_value.val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i+val_ptr->n_elements] = new GSM__Types::RslChannelNr(*other_value.val_ptr->value_elements[i]);
}
}
return ret_val;
}

ChannelNrs ChannelNrs::substr(int index, int returncount) const
{
if (val_ptr == NULL) TTCN_error("The first argument of substr() is an unbound value of type @BTS_Tests.ChannelNrs.");
check_substr_arguments(val_ptr->n_elements, index, returncount, "@BTS_Tests.ChannelNrs","element");
ChannelNrs ret_val;
ret_val.set_size(returncount);
for (int i=0; i<returncount; i++) {
if (val_ptr->value_elements[i+index] != NULL) {
ret_val.val_ptr->value_elements[i] = new GSM__Types::RslChannelNr(*val_ptr->value_elements[i+index]);
}
}
return ret_val;
}

ChannelNrs ChannelNrs::replace(int index, int len, const ChannelNrs& repl) const
{
if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @BTS_Tests.ChannelNrs.");
if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @BTS_Tests.ChannelNrs.");
check_replace_arguments(val_ptr->n_elements, index, len, "@BTS_Tests.ChannelNrs","element");
ChannelNrs ret_val;
ret_val.set_size(val_ptr->n_elements + repl.val_ptr->n_elements - len);
for (int i = 0; i < index; i++) {
if (val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i] = new GSM__Types::RslChannelNr(*val_ptr->value_elements[i]);
}
}
for (int i = 0; i < repl.val_ptr->n_elements; i++) {
if (repl.val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i+index] = new GSM__Types::RslChannelNr(*repl.val_ptr->value_elements[i]);
}
}
for (int i = 0; i < val_ptr->n_elements - index - len; i++) {
if (val_ptr->value_elements[index+i+len] != NULL) {
ret_val.val_ptr->value_elements[index+i+repl.val_ptr->n_elements] = new GSM__Types::RslChannelNr(*val_ptr->value_elements[index+i+len]);
}
}
return ret_val;
}

ChannelNrs ChannelNrs::replace(int index, int len, const ChannelNrs_template& repl) const
{
if (!repl.is_value()) TTCN_error("The fourth argument of function replace() is a template with non-specific value.");
return replace(index, len, repl.valueof());
}

void ChannelNrs::set_size(int new_size)
{
if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @BTS_Tests.ChannelNrs.");
if (val_ptr == NULL) {
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
} else if (val_ptr->ref_count > 1) {
struct recordof_setof_struct *new_val_ptr = new recordof_setof_struct;
new_val_ptr->ref_count = 1;
new_val_ptr->n_elements = (new_size < val_ptr->n_elements) ? new_size : val_ptr->n_elements;
new_val_ptr->value_elements = (GSM__Types::RslChannelNr**)allocate_pointers(new_val_ptr->n_elements);
for (int elem_count = 0; elem_count < new_val_ptr->n_elements; elem_count++) {
if (val_ptr->value_elements[elem_count] != NULL){
new_val_ptr->value_elements[elem_count] = new GSM__Types::RslChannelNr(*(val_ptr->value_elements[elem_count]));
}
}
clean_up();
val_ptr = new_val_ptr;
}
if (new_size > val_ptr->n_elements) {
val_ptr->value_elements = (GSM__Types::RslChannelNr**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size);
#ifdef TITAN_MEMORY_DEBUG_SET_RECORD_OF
if((val_ptr->n_elements/1000)!=(new_size/1000)) TTCN_warning("New size of type @BTS_Tests.ChannelNrs: %d",new_size);
#endif
val_ptr->n_elements = new_size;
} else if (new_size < val_ptr->n_elements) {
for (int elem_count = new_size; elem_count < val_ptr->n_elements; elem_count++)
if (val_ptr->value_elements[elem_count] != NULL)delete val_ptr->value_elements[elem_count];
val_ptr->value_elements = (GSM__Types::RslChannelNr**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size);
val_ptr->n_elements = new_size;
}
}

boolean ChannelNrs::is_value() const
{
if (val_ptr == NULL) return FALSE;
for(int i = 0; i < val_ptr->n_elements; ++i) {
if (val_ptr->value_elements[i] == NULL || !val_ptr->value_elements[i]->is_value()) return FALSE;
}
return TRUE;
}

int ChannelNrs::size_of() const
{
if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @BTS_Tests.ChannelNrs.");
return val_ptr->n_elements;
}

int ChannelNrs::lengthof() const
{
if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @BTS_Tests.ChannelNrs.");
for (int my_length=val_ptr->n_elements; my_length>0; my_length--) if (val_ptr->value_elements[my_length-1] != NULL) return my_length;
return 0;
}

void ChannelNrs::log() const
{
if (val_ptr == NULL) {;
TTCN_Logger::log_event_unbound();
return;
}
switch (val_ptr->n_elements) {
case 0:
TTCN_Logger::log_event_str("{ }");
break;
default:
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
(*this)[elem_count].log();
}
TTCN_Logger::log_event_str(" }");
}
}

void ChannelNrs::set_implicit_omit()
{
if (val_ptr == NULL) return;
for (int i = 0; i < val_ptr->n_elements; i++) {
if (val_ptr->value_elements[i] != NULL) val_ptr->value_elements[i]->set_implicit_omit();
}
}

void ChannelNrs::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE|Module_Param::BC_LIST, "record of value");
  switch (param.get_operation_type()) {
  case Module_Param::OT_ASSIGN:
    if (param.get_type()==Module_Param::MP_Value_List && param.get_size()==0) {
      *this = NULL_VALUE;
      return;
    }
    switch (param.get_type()) {
    case Module_Param::MP_Value_List:
      set_size(param.get_size());
      for (size_t i=0; i<param.get_size(); ++i) {
        Module_Param* const curr = param.get_elem(i);
        if (curr->get_type()!=Module_Param::MP_NotUsed) {
          (*this)[i].set_param(*curr);
          if (!(*this)[i].is_bound()) {
            delete val_ptr->value_elements[i];
            val_ptr->value_elements[i] = NULL;
          }
        }
      }
      break;
    case Module_Param::MP_Indexed_List:
      for (size_t i=0; i<param.get_size(); ++i) {
        Module_Param* const curr = param.get_elem(i);
        (*this)[curr->get_id()->get_index()].set_param(*curr);
        if (!(*this)[curr->get_id()->get_index()].is_bound()) {
          delete val_ptr->value_elements[curr->get_id()->get_index()];
          val_ptr->value_elements[curr->get_id()->get_index()] = NULL;
        }
      }
      break;
    default:
      param.type_error("record of value", "@BTS_Tests.ChannelNrs");
    }
    break;
  case Module_Param::OT_CONCAT:
    switch (param.get_type()) {
    case Module_Param::MP_Value_List: {
      if (!is_bound()) *this = NULL_VALUE;
      int start_idx = lengthof();
      for (size_t i=0; i<param.get_size(); ++i) {
        Module_Param* const curr = param.get_elem(i);
        if ((curr->get_type()!=Module_Param::MP_NotUsed)) {
          (*this)[start_idx+(int)i].set_param(*curr);
        }
      }
    } break;
    case Module_Param::MP_Indexed_List:
      param.error("Cannot concatenate an indexed value list");
      break;
    default:
      param.type_error("record of value", "@BTS_Tests.ChannelNrs");
    }
    break;
  default:
    TTCN_error("Internal error: Unknown operation type.");
  }
}

void ChannelNrs::encode_text(Text_Buf& text_buf) const
{
if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @BTS_Tests.ChannelNrs.");
text_buf.push_int(val_ptr->n_elements);
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++)
(*this)[elem_count].encode_text(text_buf);
}

void ChannelNrs::decode_text(Text_Buf& text_buf)
{
clean_up();
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = text_buf.pull_int().get_val();
if (val_ptr->n_elements < 0) TTCN_error("Text decoder: Negative size was received for a value of type @BTS_Tests.ChannelNrs.");
val_ptr->value_elements = (GSM__Types::RslChannelNr**)allocate_pointers(val_ptr->n_elements);
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) {
val_ptr->value_elements[elem_count] = new GSM__Types::RslChannelNr;
val_ptr->value_elements[elem_count]->decode_text(text_buf);
}
}

void ChannelNrs_template::copy_value(const ChannelNrs& other_value)
{
if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @BTS_Tests.ChannelNrs with an unbound value.");
single_value.n_elements = other_value.size_of();
single_value.value_elements = (GSM__Types::RslChannelNr_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (other_value[elem_count].is_bound()) {
single_value.value_elements[elem_count] = new GSM__Types::RslChannelNr_template(other_value[elem_count]);
} else {
single_value.value_elements[elem_count] = new GSM__Types::RslChannelNr_template;
}
}
set_selection(SPECIFIC_VALUE);
}

void ChannelNrs_template::copy_template(const ChannelNrs_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value.n_elements = other_value.single_value.n_elements;
single_value.value_elements = (GSM__Types::RslChannelNr_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (UNINITIALIZED_TEMPLATE != other_value.single_value.value_elements[elem_count]->get_selection()) {
single_value.value_elements[elem_count] = new GSM__Types::RslChannelNr_template(*other_value.single_value.value_elements[elem_count]);
} else {
single_value.value_elements[elem_count] = new GSM__Types::RslChannelNr_template;
}
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new ChannelNrs_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new ChannelNrs_template(*other_value.implication_.precondition);
implication_.implied_template = new ChannelNrs_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BTS_Tests.ChannelNrs.");
break;
}
set_selection(other_value);
}

boolean ChannelNrs_template::match_function_specific(const Base_Type *value_ptr, int value_index, const Restricted_Length_Template *template_ptr, int template_index, boolean legacy)
{
if (value_index >= 0) return ((const ChannelNrs_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const ChannelNrs*)value_ptr)[value_index], legacy);
else return ((const ChannelNrs_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit();
}

ChannelNrs_template::ChannelNrs_template()
{
}

ChannelNrs_template::ChannelNrs_template(template_sel other_value)
 : Base_Record_Of_Template(other_value)
{
check_single_selection(other_value);
}

ChannelNrs_template::ChannelNrs_template(null_type)
 : Base_Record_Of_Template(SPECIFIC_VALUE)
{
single_value.n_elements = 0;
single_value.value_elements = NULL;
}

ChannelNrs_template::ChannelNrs_template(const ChannelNrs& other_value)
{
copy_value(other_value);
}

ChannelNrs_template::ChannelNrs_template(const OPTIONAL<ChannelNrs>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const ChannelNrs&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BTS_Tests.ChannelNrs from an unbound optional field.");
}
}

ChannelNrs_template::ChannelNrs_template(ChannelNrs_template* p_precondition, ChannelNrs_template* p_implied_template)
 : Base_Record_Of_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

ChannelNrs_template::ChannelNrs_template(Dynamic_Match_Interface<ChannelNrs>* p_dyn_match)
 : Base_Record_Of_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<ChannelNrs>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

ChannelNrs_template::ChannelNrs_template(const ChannelNrs_template& other_value)
 : Base_Record_Of_Template()
{
copy_template(other_value);
}

ChannelNrs_template::~ChannelNrs_template()
{
clean_up();
}

void ChannelNrs_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
delete single_value.value_elements[elem_count];
free_pointers((void**)single_value.value_elements);
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

ChannelNrs_template& ChannelNrs_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

ChannelNrs_template& ChannelNrs_template::operator=(null_type)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value.n_elements = 0;
single_value.value_elements = NULL;
return *this;
}

ChannelNrs_template& ChannelNrs_template::operator=(const ChannelNrs& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

ChannelNrs_template& ChannelNrs_template::operator=(const OPTIONAL<ChannelNrs>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const ChannelNrs&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @BTS_Tests.ChannelNrs.");
}
return *this;
}

ChannelNrs_template& ChannelNrs_template::operator=(const ChannelNrs_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

GSM__Types::RslChannelNr_template& ChannelNrs_template::operator[](int index_value)
{
if (index_value < 0) TTCN_error("Accessing an element of a template for type @BTS_Tests.ChannelNrs using a negative index: %d.", index_value);
switch (template_selection)
{
  case SPECIFIC_VALUE:
    if(index_value < single_value.n_elements) break;
    // no break
  case OMIT_VALUE:
  case ANY_VALUE:
  case ANY_OR_OMIT:
  case UNINITIALIZED_TEMPLATE:
    set_size(index_value + 1);
    break;
  default:
    TTCN_error("Accessing an element of a non-specific template for type @BTS_Tests.ChannelNrs.");
    break;
}
return *single_value.value_elements[index_value];
}

GSM__Types::RslChannelNr_template& ChannelNrs_template::operator[](const INTEGER& index_value)
{
index_value.must_bound("Using an unbound integer value for indexing a template of type @BTS_Tests.ChannelNrs.");
return (*this)[(int)index_value];
}

const GSM__Types::RslChannelNr_template& ChannelNrs_template::operator[](int index_value) const
{
if (index_value < 0) TTCN_error("Accessing an element of a template for type @BTS_Tests.ChannelNrs using a negative index: %d.", index_value);
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing an element of a non-specific template for type @BTS_Tests.ChannelNrs.");
if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @BTS_Tests.ChannelNrs: The index is %d, but the template has only %d elements.", index_value, single_value.n_elements);
return *single_value.value_elements[index_value];
}

const GSM__Types::RslChannelNr_template& ChannelNrs_template::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a template of type @BTS_Tests.ChannelNrs.");
return (*this)[(int)index_value];
}

void ChannelNrs_template::set_size(int new_size)
{
if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a template of type @BTS_Tests.ChannelNrs.");
template_sel old_selection = template_selection;
if (old_selection != SPECIFIC_VALUE) {
clean_up();
set_selection(SPECIFIC_VALUE);
single_value.n_elements = 0;
single_value.value_elements = NULL;
}
if (new_size > single_value.n_elements) {
single_value.value_elements = (GSM__Types::RslChannelNr_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
for (int elem_count = single_value.n_elements; elem_count < new_size; elem_count++)
single_value.value_elements[elem_count] = new GSM__Types::RslChannelNr_template(ANY_VALUE);
} else {
for (int elem_count = single_value.n_elements; elem_count < new_size; elem_count++)
single_value.value_elements[elem_count] = new GSM__Types::RslChannelNr_template;
}
single_value.n_elements = new_size;
} else if (new_size < single_value.n_elements) {
for (int elem_count = new_size; elem_count < single_value.n_elements; elem_count++)
delete single_value.value_elements[elem_count];
single_value.value_elements = (GSM__Types::RslChannelNr_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size);
single_value.n_elements = new_size;
}
}

int ChannelNrs_template::n_elem() const
{
  switch (template_selection) {
  case SPECIFIC_VALUE:
    return single_value.n_elements;
    break;
  case VALUE_LIST:
    return value_list.n_values;
    break;
  default:
    TTCN_error("Performing n_elem");
  }
}

int ChannelNrs_template::size_of(boolean is_size) const
{
const char* op_name = is_size ? "size" : "length";
int min_size;
boolean has_any_or_none;
if (is_ifpresent) TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.ChannelNrs which has an ifpresent attribute.", op_name);
switch (template_selection)
{
case SPECIFIC_VALUE: {
  min_size = 0;
  has_any_or_none = FALSE;
  int elem_count = single_value.n_elements;
  if (!is_size) { while (elem_count>0 && !single_value.value_elements[elem_count-1]->is_bound()) elem_count--; }
  for (int i=0; i<elem_count; i++) {
    switch (single_value.value_elements[i]->get_selection()) {
    case OMIT_VALUE:
      TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.ChannelNrs containing omit element.", op_name);
    case ANY_OR_OMIT:
      has_any_or_none = TRUE;
      break;
    default:
      min_size++;
      break;
    }
  }
} break;
case OMIT_VALUE:
  TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.ChannelNrs containing omit value.", op_name);
case ANY_VALUE:
case ANY_OR_OMIT:
  min_size = 0;
  has_any_or_none = TRUE;
  break;
case VALUE_LIST:
{
  if (value_list.n_values<1)
    TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.ChannelNrs containing an empty list.", op_name);
  int item_size = value_list.list_value[0].size_of(is_size);
  for (unsigned int i = 1; i < value_list.n_values; i++) {
    if (value_list.list_value[i].size_of(is_size)!=item_size)
      TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.ChannelNrs containing a value list with different sizes.", op_name);
  }
  min_size = item_size;
  has_any_or_none = FALSE;
  break;
}
case COMPLEMENTED_LIST:
  TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.ChannelNrs containing complemented list.", op_name);
default:
  TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @BTS_Tests.ChannelNrs.", op_name);
}
return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @BTS_Tests.ChannelNrs");
}

boolean ChannelNrs_template::match(const ChannelNrs& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
int value_length = other_value.size_of();
if (!match_length(value_length)) return FALSE;
switch (template_selection) {
case SPECIFIC_VALUE:
return match_record_of(&other_value, value_length, this, single_value.n_elements, match_function_specific, legacy);
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching with an uninitialized/unsupported template of type @BTS_Tests.ChannelNrs.");
}
return FALSE;
}

boolean ChannelNrs_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
if (!single_value.value_elements[elem_count]->is_value()) return FALSE;
return TRUE;
}

ChannelNrs ChannelNrs_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of type @BTS_Tests.ChannelNrs.");
ChannelNrs ret_val;
ret_val.set_size(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
if (single_value.value_elements[elem_count]->is_bound()) {
ret_val[elem_count] = single_value.value_elements[elem_count]->valueof();
}
return ret_val;
}

ChannelNrs ChannelNrs_template::substr(int index, int returncount) const
{
if (!is_value()) TTCN_error("The first argument of function substr() is a template with non-specific value.");
return valueof().substr(index, returncount);
}

ChannelNrs ChannelNrs_template::replace(int index, int len, const ChannelNrs_template& repl) const
{
if (!is_value()) TTCN_error("The first argument of function replace() is a template with non-specific value.");
if (!repl.is_value()) TTCN_error("The fourth argument of function replace() is a template with non-specific value.");
return valueof().replace(index, len, repl.valueof());
}

ChannelNrs ChannelNrs_template::replace(int index, int len, const ChannelNrs& repl) const
{
if (!is_value()) TTCN_error("The first argument of function replace() is a template with non-specific value.");
return valueof().replace(index, len, repl);
}

void ChannelNrs_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = list_length;
value_list.list_value = new ChannelNrs_template[list_length];
break;
default:
TTCN_error("Internal error: Setting an invalid type for a template of type @BTS_Tests.ChannelNrs.");
}
set_selection(template_type);
}

ChannelNrs_template& ChannelNrs_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Internal error: Accessing a list element of a non-list template of type @BTS_Tests.ChannelNrs.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @BTS_Tests.ChannelNrs.");
return value_list.list_value[list_index];
}

void ChannelNrs_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.n_elements > 0) {
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
if (permutation_starts_at(elem_count)) TTCN_Logger::log_event_str("permutation(");
single_value.value_elements[elem_count]->log();
if (permutation_ends_at(elem_count)) TTCN_Logger::log_char(')');
}
TTCN_Logger::log_event_str(" }");
} else TTCN_Logger::log_event_str("{ }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_restricted();
log_ifpresent();
}

void ChannelNrs_template::log_match(const ChannelNrs& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
}else{
if (template_selection == SPECIFIC_VALUE && single_value.n_elements > 0 && get_number_of_permutations() == 0 && single_value.n_elements == match_value.size_of()) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if(!single_value.value_elements[elem_count]->match(match_value[elem_count], legacy)){
TTCN_Logger::log_logmatch_info("[%d]", elem_count);
single_value.value_elements[elem_count]->log_match(match_value[elem_count], legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
log_match_length(single_value.n_elements);
} else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE && single_value.n_elements > 0 && get_number_of_permutations() == 0 && single_value.n_elements == match_value.size_of()) {
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
single_value.value_elements[elem_count]->log_match(match_value[elem_count], legacy);
}
TTCN_Logger::log_event_str(" }");
log_match_length(single_value.n_elements);
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void ChannelNrs_template::encode_text(Text_Buf& text_buf) const
{
encode_text_permutation(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
single_value.value_elements[elem_count]->encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BTS_Tests.ChannelNrs.");
}
}

void ChannelNrs_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_permutation(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value.n_elements = text_buf.pull_int().get_val();
if (single_value.n_elements < 0) TTCN_error("Text decoder: Negative size was received for a template of type @BTS_Tests.ChannelNrs.");
single_value.value_elements = (GSM__Types::RslChannelNr_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
single_value.value_elements[elem_count] = new GSM__Types::RslChannelNr_template;
single_value.value_elements[elem_count]->decode_text(text_buf);
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new ChannelNrs_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of type @BTS_Tests.ChannelNrs.");
}
}

boolean ChannelNrs_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean ChannelNrs_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void ChannelNrs_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
for (int i = 0; i < single_value.n_elements; i++) {
if (single_value.value_elements[i] != NULL) single_value.value_elements[i]->set_implicit_omit();
}
}

void ChannelNrs_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE|Module_Param::BC_LIST, "record of template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    ChannelNrs_template temp;
    temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = temp;
    break; }
  case Module_Param::MP_Indexed_List:
    if (template_selection!=SPECIFIC_VALUE) set_size(0);
    for (size_t p_i=0; p_i<param.get_size(); ++p_i) {
      (*this)[(int)(param.get_elem(p_i)->get_id()->get_index())].set_param(*param.get_elem(p_i));
    }
    break;
  case Module_Param::MP_Value_List: {
    set_size(param.get_size());
    int curr_idx = 0;
    for (size_t p_i=0; p_i<param.get_size(); ++p_i) {
      switch (param.get_elem(p_i)->get_type()) {
      case Module_Param::MP_NotUsed:
        curr_idx++;
        break;
      case Module_Param::MP_Permutation_Template: {
        int perm_start_idx = curr_idx;
        Module_Param* param_i = param.get_elem(p_i);
        for (size_t perm_i=0; perm_i<param_i->get_size(); perm_i++) {
          (*this)[curr_idx].set_param(*(param_i->get_elem(perm_i)));
          curr_idx++;
        }
        int perm_end_idx = curr_idx - 1;
        add_permutation(perm_start_idx, perm_end_idx);
      } break;
      default:
        (*this)[curr_idx].set_param(*param.get_elem(p_i));
        curr_idx++;
      }
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    ChannelNrs_template* precondition = new ChannelNrs_template;
    precondition->set_param(*param.get_elem(0));
    ChannelNrs_template* implied_template = new ChannelNrs_template;
    implied_template->set_param(*param.get_elem(1));
    *this = ChannelNrs_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record of template", "@BTS_Tests.ChannelNrs");
  }
  is_ifpresent = param.get_ifpresent();
  set_length_range(param);
}

void ChannelNrs_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
for (int i=0; i<single_value.n_elements; i++) single_value.value_elements[i]->check_restriction(t_res, t_name ? t_name : "@BTS_Tests.ChannelNrs");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@BTS_Tests.ChannelNrs");
}

boolean ChannelNrs_template::get_istemplate_kind(const char* type) const {
if (!strcmp(type, "AnyElement")) {
  if (template_selection != SPECIFIC_VALUE) {
    return FALSE;
  }
  for (int i = 0; i < single_value.n_elements; i++) {
    if (single_value.value_elements[i]->get_selection() == ANY_VALUE) {
      return TRUE;
    }
  }
  return FALSE;
} else if (!strcmp(type, "AnyElementsOrNone")) {
  if (template_selection != SPECIFIC_VALUE) {
    return FALSE;
  }
  for (int i = 0; i < single_value.n_elements; i++) {
    if (single_value.value_elements[i]->get_selection() == ANY_OR_OMIT) {
      return TRUE;
    }
  }
  return FALSE;
} else if (!strcmp(type, "permutation")) {
  return number_of_permutations;
} else if (!strcmp(type, "length")) {
  return length_restriction_type != NO_LENGTH_RESTRICTION;
} else {
  return Base_Template::get_istemplate_kind(type);
}
}
SystemInformationConfig::SystemInformationConfig()
{
}

SystemInformationConfig::SystemInformationConfig(const BOOLEAN& par_bcch__extended,
    const BOOLEAN& par_si1__present,
    const BOOLEAN& par_si2bis__present,
    const BOOLEAN& par_si2ter__present,
    const BOOLEAN& par_si2quater__present,
    const BOOLEAN& par_si7__present,
    const BOOLEAN& par_si8__present,
    const BOOLEAN& par_si9__present,
    const BOOLEAN& par_si13__present,
    const BOOLEAN& par_si13alt__present,
    const BOOLEAN& par_si15__present,
    const BOOLEAN& par_si16__present,
    const BOOLEAN& par_si17__present,
    const BOOLEAN& par_si2n__present,
    const BOOLEAN& par_si21__present,
    const BOOLEAN& par_si22__present)
  :   field_bcch__extended(par_bcch__extended),
  field_si1__present(par_si1__present),
  field_si2bis__present(par_si2bis__present),
  field_si2ter__present(par_si2ter__present),
  field_si2quater__present(par_si2quater__present),
  field_si7__present(par_si7__present),
  field_si8__present(par_si8__present),
  field_si9__present(par_si9__present),
  field_si13__present(par_si13__present),
  field_si13alt__present(par_si13alt__present),
  field_si15__present(par_si15__present),
  field_si16__present(par_si16__present),
  field_si17__present(par_si17__present),
  field_si2n__present(par_si2n__present),
  field_si21__present(par_si21__present),
  field_si22__present(par_si22__present)
{
}

SystemInformationConfig::SystemInformationConfig(const SystemInformationConfig& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BTS_Tests.SystemInformationConfig.");
if (other_value.bcch__extended().is_bound()) field_bcch__extended = other_value.bcch__extended();
else field_bcch__extended.clean_up();
if (other_value.si1__present().is_bound()) field_si1__present = other_value.si1__present();
else field_si1__present.clean_up();
if (other_value.si2bis__present().is_bound()) field_si2bis__present = other_value.si2bis__present();
else field_si2bis__present.clean_up();
if (other_value.si2ter__present().is_bound()) field_si2ter__present = other_value.si2ter__present();
else field_si2ter__present.clean_up();
if (other_value.si2quater__present().is_bound()) field_si2quater__present = other_value.si2quater__present();
else field_si2quater__present.clean_up();
if (other_value.si7__present().is_bound()) field_si7__present = other_value.si7__present();
else field_si7__present.clean_up();
if (other_value.si8__present().is_bound()) field_si8__present = other_value.si8__present();
else field_si8__present.clean_up();
if (other_value.si9__present().is_bound()) field_si9__present = other_value.si9__present();
else field_si9__present.clean_up();
if (other_value.si13__present().is_bound()) field_si13__present = other_value.si13__present();
else field_si13__present.clean_up();
if (other_value.si13alt__present().is_bound()) field_si13alt__present = other_value.si13alt__present();
else field_si13alt__present.clean_up();
if (other_value.si15__present().is_bound()) field_si15__present = other_value.si15__present();
else field_si15__present.clean_up();
if (other_value.si16__present().is_bound()) field_si16__present = other_value.si16__present();
else field_si16__present.clean_up();
if (other_value.si17__present().is_bound()) field_si17__present = other_value.si17__present();
else field_si17__present.clean_up();
if (other_value.si2n__present().is_bound()) field_si2n__present = other_value.si2n__present();
else field_si2n__present.clean_up();
if (other_value.si21__present().is_bound()) field_si21__present = other_value.si21__present();
else field_si21__present.clean_up();
if (other_value.si22__present().is_bound()) field_si22__present = other_value.si22__present();
else field_si22__present.clean_up();
}

void SystemInformationConfig::clean_up()
{
field_bcch__extended.clean_up();
field_si1__present.clean_up();
field_si2bis__present.clean_up();
field_si2ter__present.clean_up();
field_si2quater__present.clean_up();
field_si7__present.clean_up();
field_si8__present.clean_up();
field_si9__present.clean_up();
field_si13__present.clean_up();
field_si13alt__present.clean_up();
field_si15__present.clean_up();
field_si16__present.clean_up();
field_si17__present.clean_up();
field_si2n__present.clean_up();
field_si21__present.clean_up();
field_si22__present.clean_up();
}

const TTCN_Typedescriptor_t* SystemInformationConfig::get_descriptor() const { return &SystemInformationConfig_descr_; }
SystemInformationConfig& SystemInformationConfig::operator=(const SystemInformationConfig& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BTS_Tests.SystemInformationConfig.");
  if (other_value.bcch__extended().is_bound()) field_bcch__extended = other_value.bcch__extended();
  else field_bcch__extended.clean_up();
  if (other_value.si1__present().is_bound()) field_si1__present = other_value.si1__present();
  else field_si1__present.clean_up();
  if (other_value.si2bis__present().is_bound()) field_si2bis__present = other_value.si2bis__present();
  else field_si2bis__present.clean_up();
  if (other_value.si2ter__present().is_bound()) field_si2ter__present = other_value.si2ter__present();
  else field_si2ter__present.clean_up();
  if (other_value.si2quater__present().is_bound()) field_si2quater__present = other_value.si2quater__present();
  else field_si2quater__present.clean_up();
  if (other_value.si7__present().is_bound()) field_si7__present = other_value.si7__present();
  else field_si7__present.clean_up();
  if (other_value.si8__present().is_bound()) field_si8__present = other_value.si8__present();
  else field_si8__present.clean_up();
  if (other_value.si9__present().is_bound()) field_si9__present = other_value.si9__present();
  else field_si9__present.clean_up();
  if (other_value.si13__present().is_bound()) field_si13__present = other_value.si13__present();
  else field_si13__present.clean_up();
  if (other_value.si13alt__present().is_bound()) field_si13alt__present = other_value.si13alt__present();
  else field_si13alt__present.clean_up();
  if (other_value.si15__present().is_bound()) field_si15__present = other_value.si15__present();
  else field_si15__present.clean_up();
  if (other_value.si16__present().is_bound()) field_si16__present = other_value.si16__present();
  else field_si16__present.clean_up();
  if (other_value.si17__present().is_bound()) field_si17__present = other_value.si17__present();
  else field_si17__present.clean_up();
  if (other_value.si2n__present().is_bound()) field_si2n__present = other_value.si2n__present();
  else field_si2n__present.clean_up();
  if (other_value.si21__present().is_bound()) field_si21__present = other_value.si21__present();
  else field_si21__present.clean_up();
  if (other_value.si22__present().is_bound()) field_si22__present = other_value.si22__present();
  else field_si22__present.clean_up();
}
return *this;
}

boolean SystemInformationConfig::operator==(const SystemInformationConfig& other_value) const
{
return field_bcch__extended==other_value.field_bcch__extended
  && field_si1__present==other_value.field_si1__present
  && field_si2bis__present==other_value.field_si2bis__present
  && field_si2ter__present==other_value.field_si2ter__present
  && field_si2quater__present==other_value.field_si2quater__present
  && field_si7__present==other_value.field_si7__present
  && field_si8__present==other_value.field_si8__present
  && field_si9__present==other_value.field_si9__present
  && field_si13__present==other_value.field_si13__present
  && field_si13alt__present==other_value.field_si13alt__present
  && field_si15__present==other_value.field_si15__present
  && field_si16__present==other_value.field_si16__present
  && field_si17__present==other_value.field_si17__present
  && field_si2n__present==other_value.field_si2n__present
  && field_si21__present==other_value.field_si21__present
  && field_si22__present==other_value.field_si22__present;
}

boolean SystemInformationConfig::is_bound() const
{
return (field_bcch__extended.is_bound())
  || (field_si1__present.is_bound())
  || (field_si2bis__present.is_bound())
  || (field_si2ter__present.is_bound())
  || (field_si2quater__present.is_bound())
  || (field_si7__present.is_bound())
  || (field_si8__present.is_bound())
  || (field_si9__present.is_bound())
  || (field_si13__present.is_bound())
  || (field_si13alt__present.is_bound())
  || (field_si15__present.is_bound())
  || (field_si16__present.is_bound())
  || (field_si17__present.is_bound())
  || (field_si2n__present.is_bound())
  || (field_si21__present.is_bound())
  || (field_si22__present.is_bound());
}
boolean SystemInformationConfig::is_value() const
{
return field_bcch__extended.is_value()
  && field_si1__present.is_value()
  && field_si2bis__present.is_value()
  && field_si2ter__present.is_value()
  && field_si2quater__present.is_value()
  && field_si7__present.is_value()
  && field_si8__present.is_value()
  && field_si9__present.is_value()
  && field_si13__present.is_value()
  && field_si13alt__present.is_value()
  && field_si15__present.is_value()
  && field_si16__present.is_value()
  && field_si17__present.is_value()
  && field_si2n__present.is_value()
  && field_si21__present.is_value()
  && field_si22__present.is_value();
}
void SystemInformationConfig::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bcch_extended := ");
field_bcch__extended.log();
TTCN_Logger::log_event_str(", si1_present := ");
field_si1__present.log();
TTCN_Logger::log_event_str(", si2bis_present := ");
field_si2bis__present.log();
TTCN_Logger::log_event_str(", si2ter_present := ");
field_si2ter__present.log();
TTCN_Logger::log_event_str(", si2quater_present := ");
field_si2quater__present.log();
TTCN_Logger::log_event_str(", si7_present := ");
field_si7__present.log();
TTCN_Logger::log_event_str(", si8_present := ");
field_si8__present.log();
TTCN_Logger::log_event_str(", si9_present := ");
field_si9__present.log();
TTCN_Logger::log_event_str(", si13_present := ");
field_si13__present.log();
TTCN_Logger::log_event_str(", si13alt_present := ");
field_si13alt__present.log();
TTCN_Logger::log_event_str(", si15_present := ");
field_si15__present.log();
TTCN_Logger::log_event_str(", si16_present := ");
field_si16__present.log();
TTCN_Logger::log_event_str(", si17_present := ");
field_si17__present.log();
TTCN_Logger::log_event_str(", si2n_present := ");
field_si2n__present.log();
TTCN_Logger::log_event_str(", si21_present := ");
field_si21__present.log();
TTCN_Logger::log_event_str(", si22_present := ");
field_si22__present.log();
TTCN_Logger::log_event_str(" }");
}

void SystemInformationConfig::set_implicit_omit()
{
if (bcch__extended().is_bound()) bcch__extended().set_implicit_omit();
if (si1__present().is_bound()) si1__present().set_implicit_omit();
if (si2bis__present().is_bound()) si2bis__present().set_implicit_omit();
if (si2ter__present().is_bound()) si2ter__present().set_implicit_omit();
if (si2quater__present().is_bound()) si2quater__present().set_implicit_omit();
if (si7__present().is_bound()) si7__present().set_implicit_omit();
if (si8__present().is_bound()) si8__present().set_implicit_omit();
if (si9__present().is_bound()) si9__present().set_implicit_omit();
if (si13__present().is_bound()) si13__present().set_implicit_omit();
if (si13alt__present().is_bound()) si13alt__present().set_implicit_omit();
if (si15__present().is_bound()) si15__present().set_implicit_omit();
if (si16__present().is_bound()) si16__present().set_implicit_omit();
if (si17__present().is_bound()) si17__present().set_implicit_omit();
if (si2n__present().is_bound()) si2n__present().set_implicit_omit();
if (si21__present().is_bound()) si21__present().set_implicit_omit();
if (si22__present().is_bound()) si22__present().set_implicit_omit();
}

void SystemInformationConfig::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "set value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (16<param.get_size()) {
      param.error("set value of type @BTS_Tests.SystemInformationConfig has 16 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bcch__extended().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) si1__present().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) si2bis__present().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) si2ter__present().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) si2quater__present().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) si7__present().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) si8__present().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) si9__present().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) si13__present().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) si13alt__present().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) si15__present().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) si16__present().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) si17__present().set_param(*param.get_elem(12));
    if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) si2n__present().set_param(*param.get_elem(13));
    if (param.get_size()>14 && param.get_elem(14)->get_type()!=Module_Param::MP_NotUsed) si21__present().set_param(*param.get_elem(14));
    if (param.get_size()>15 && param.get_elem(15)->get_type()!=Module_Param::MP_NotUsed) si22__present().set_param(*param.get_elem(15));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bcch_extended")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bcch__extended().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "si1_present")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          si1__present().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "si2bis_present")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          si2bis__present().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "si2ter_present")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          si2ter__present().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "si2quater_present")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          si2quater__present().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "si7_present")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          si7__present().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "si8_present")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          si8__present().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "si9_present")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          si9__present().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "si13_present")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          si13__present().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "si13alt_present")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          si13alt__present().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "si15_present")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          si15__present().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "si16_present")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          si16__present().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "si17_present")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          si17__present().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "si2n_present")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          si2n__present().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "si21_present")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          si21__present().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "si22_present")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          si22__present().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BTS_Tests.SystemInformationConfig: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("set value", "@BTS_Tests.SystemInformationConfig");
  }
}

void SystemInformationConfig::encode_text(Text_Buf& text_buf) const
{
field_bcch__extended.encode_text(text_buf);
field_si1__present.encode_text(text_buf);
field_si2bis__present.encode_text(text_buf);
field_si2ter__present.encode_text(text_buf);
field_si2quater__present.encode_text(text_buf);
field_si7__present.encode_text(text_buf);
field_si8__present.encode_text(text_buf);
field_si9__present.encode_text(text_buf);
field_si13__present.encode_text(text_buf);
field_si13alt__present.encode_text(text_buf);
field_si15__present.encode_text(text_buf);
field_si16__present.encode_text(text_buf);
field_si17__present.encode_text(text_buf);
field_si2n__present.encode_text(text_buf);
field_si21__present.encode_text(text_buf);
field_si22__present.encode_text(text_buf);
}

void SystemInformationConfig::decode_text(Text_Buf& text_buf)
{
field_bcch__extended.decode_text(text_buf);
field_si1__present.decode_text(text_buf);
field_si2bis__present.decode_text(text_buf);
field_si2ter__present.decode_text(text_buf);
field_si2quater__present.decode_text(text_buf);
field_si7__present.decode_text(text_buf);
field_si8__present.decode_text(text_buf);
field_si9__present.decode_text(text_buf);
field_si13__present.decode_text(text_buf);
field_si13alt__present.decode_text(text_buf);
field_si15__present.decode_text(text_buf);
field_si16__present.decode_text(text_buf);
field_si17__present.decode_text(text_buf);
field_si2n__present.decode_text(text_buf);
field_si21__present.decode_text(text_buf);
field_si22__present.decode_text(text_buf);
}

struct SystemInformationConfig_template::single_value_struct {
BOOLEAN_template field_bcch__extended;
BOOLEAN_template field_si1__present;
BOOLEAN_template field_si2bis__present;
BOOLEAN_template field_si2ter__present;
BOOLEAN_template field_si2quater__present;
BOOLEAN_template field_si7__present;
BOOLEAN_template field_si8__present;
BOOLEAN_template field_si9__present;
BOOLEAN_template field_si13__present;
BOOLEAN_template field_si13alt__present;
BOOLEAN_template field_si15__present;
BOOLEAN_template field_si16__present;
BOOLEAN_template field_si17__present;
BOOLEAN_template field_si2n__present;
BOOLEAN_template field_si21__present;
BOOLEAN_template field_si22__present;
};

void SystemInformationConfig_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_bcch__extended = ANY_VALUE;
single_value->field_si1__present = ANY_VALUE;
single_value->field_si2bis__present = ANY_VALUE;
single_value->field_si2ter__present = ANY_VALUE;
single_value->field_si2quater__present = ANY_VALUE;
single_value->field_si7__present = ANY_VALUE;
single_value->field_si8__present = ANY_VALUE;
single_value->field_si9__present = ANY_VALUE;
single_value->field_si13__present = ANY_VALUE;
single_value->field_si13alt__present = ANY_VALUE;
single_value->field_si15__present = ANY_VALUE;
single_value->field_si16__present = ANY_VALUE;
single_value->field_si17__present = ANY_VALUE;
single_value->field_si2n__present = ANY_VALUE;
single_value->field_si21__present = ANY_VALUE;
single_value->field_si22__present = ANY_VALUE;
}
}
}

void SystemInformationConfig_template::copy_value(const SystemInformationConfig& other_value)
{
single_value = new single_value_struct;
if (other_value.bcch__extended().is_bound()) {
  single_value->field_bcch__extended = other_value.bcch__extended();
} else {
  single_value->field_bcch__extended.clean_up();
}
if (other_value.si1__present().is_bound()) {
  single_value->field_si1__present = other_value.si1__present();
} else {
  single_value->field_si1__present.clean_up();
}
if (other_value.si2bis__present().is_bound()) {
  single_value->field_si2bis__present = other_value.si2bis__present();
} else {
  single_value->field_si2bis__present.clean_up();
}
if (other_value.si2ter__present().is_bound()) {
  single_value->field_si2ter__present = other_value.si2ter__present();
} else {
  single_value->field_si2ter__present.clean_up();
}
if (other_value.si2quater__present().is_bound()) {
  single_value->field_si2quater__present = other_value.si2quater__present();
} else {
  single_value->field_si2quater__present.clean_up();
}
if (other_value.si7__present().is_bound()) {
  single_value->field_si7__present = other_value.si7__present();
} else {
  single_value->field_si7__present.clean_up();
}
if (other_value.si8__present().is_bound()) {
  single_value->field_si8__present = other_value.si8__present();
} else {
  single_value->field_si8__present.clean_up();
}
if (other_value.si9__present().is_bound()) {
  single_value->field_si9__present = other_value.si9__present();
} else {
  single_value->field_si9__present.clean_up();
}
if (other_value.si13__present().is_bound()) {
  single_value->field_si13__present = other_value.si13__present();
} else {
  single_value->field_si13__present.clean_up();
}
if (other_value.si13alt__present().is_bound()) {
  single_value->field_si13alt__present = other_value.si13alt__present();
} else {
  single_value->field_si13alt__present.clean_up();
}
if (other_value.si15__present().is_bound()) {
  single_value->field_si15__present = other_value.si15__present();
} else {
  single_value->field_si15__present.clean_up();
}
if (other_value.si16__present().is_bound()) {
  single_value->field_si16__present = other_value.si16__present();
} else {
  single_value->field_si16__present.clean_up();
}
if (other_value.si17__present().is_bound()) {
  single_value->field_si17__present = other_value.si17__present();
} else {
  single_value->field_si17__present.clean_up();
}
if (other_value.si2n__present().is_bound()) {
  single_value->field_si2n__present = other_value.si2n__present();
} else {
  single_value->field_si2n__present.clean_up();
}
if (other_value.si21__present().is_bound()) {
  single_value->field_si21__present = other_value.si21__present();
} else {
  single_value->field_si21__present.clean_up();
}
if (other_value.si22__present().is_bound()) {
  single_value->field_si22__present = other_value.si22__present();
} else {
  single_value->field_si22__present.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SystemInformationConfig_template::copy_template(const SystemInformationConfig_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bcch__extended().get_selection()) {
single_value->field_bcch__extended = other_value.bcch__extended();
} else {
single_value->field_bcch__extended.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.si1__present().get_selection()) {
single_value->field_si1__present = other_value.si1__present();
} else {
single_value->field_si1__present.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.si2bis__present().get_selection()) {
single_value->field_si2bis__present = other_value.si2bis__present();
} else {
single_value->field_si2bis__present.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.si2ter__present().get_selection()) {
single_value->field_si2ter__present = other_value.si2ter__present();
} else {
single_value->field_si2ter__present.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.si2quater__present().get_selection()) {
single_value->field_si2quater__present = other_value.si2quater__present();
} else {
single_value->field_si2quater__present.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.si7__present().get_selection()) {
single_value->field_si7__present = other_value.si7__present();
} else {
single_value->field_si7__present.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.si8__present().get_selection()) {
single_value->field_si8__present = other_value.si8__present();
} else {
single_value->field_si8__present.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.si9__present().get_selection()) {
single_value->field_si9__present = other_value.si9__present();
} else {
single_value->field_si9__present.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.si13__present().get_selection()) {
single_value->field_si13__present = other_value.si13__present();
} else {
single_value->field_si13__present.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.si13alt__present().get_selection()) {
single_value->field_si13alt__present = other_value.si13alt__present();
} else {
single_value->field_si13alt__present.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.si15__present().get_selection()) {
single_value->field_si15__present = other_value.si15__present();
} else {
single_value->field_si15__present.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.si16__present().get_selection()) {
single_value->field_si16__present = other_value.si16__present();
} else {
single_value->field_si16__present.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.si17__present().get_selection()) {
single_value->field_si17__present = other_value.si17__present();
} else {
single_value->field_si17__present.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.si2n__present().get_selection()) {
single_value->field_si2n__present = other_value.si2n__present();
} else {
single_value->field_si2n__present.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.si21__present().get_selection()) {
single_value->field_si21__present = other_value.si21__present();
} else {
single_value->field_si21__present.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.si22__present().get_selection()) {
single_value->field_si22__present = other_value.si22__present();
} else {
single_value->field_si22__present.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new SystemInformationConfig_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new SystemInformationConfig_template(*other_value.implication_.precondition);
implication_.implied_template = new SystemInformationConfig_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BTS_Tests.SystemInformationConfig.");
break;
}
set_selection(other_value);
}

SystemInformationConfig_template::SystemInformationConfig_template()
{
}

SystemInformationConfig_template::SystemInformationConfig_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

SystemInformationConfig_template::SystemInformationConfig_template(const SystemInformationConfig& other_value)
{
copy_value(other_value);
}

SystemInformationConfig_template::SystemInformationConfig_template(const OPTIONAL<SystemInformationConfig>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const SystemInformationConfig&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BTS_Tests.SystemInformationConfig from an unbound optional field.");
}
}

SystemInformationConfig_template::SystemInformationConfig_template(SystemInformationConfig_template* p_precondition, SystemInformationConfig_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

SystemInformationConfig_template::SystemInformationConfig_template(Dynamic_Match_Interface<SystemInformationConfig>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<SystemInformationConfig>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

SystemInformationConfig_template::SystemInformationConfig_template(const SystemInformationConfig_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

SystemInformationConfig_template::~SystemInformationConfig_template()
{
clean_up();
}

SystemInformationConfig_template& SystemInformationConfig_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

SystemInformationConfig_template& SystemInformationConfig_template::operator=(const SystemInformationConfig& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

SystemInformationConfig_template& SystemInformationConfig_template::operator=(const OPTIONAL<SystemInformationConfig>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const SystemInformationConfig&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @BTS_Tests.SystemInformationConfig.");
}
return *this;
}

SystemInformationConfig_template& SystemInformationConfig_template::operator=(const SystemInformationConfig_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean SystemInformationConfig_template::match(const SystemInformationConfig& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.bcch__extended().is_bound()) return FALSE;
if(!single_value->field_bcch__extended.match(other_value.bcch__extended(), legacy))return FALSE;
if(!other_value.si1__present().is_bound()) return FALSE;
if(!single_value->field_si1__present.match(other_value.si1__present(), legacy))return FALSE;
if(!other_value.si2bis__present().is_bound()) return FALSE;
if(!single_value->field_si2bis__present.match(other_value.si2bis__present(), legacy))return FALSE;
if(!other_value.si2ter__present().is_bound()) return FALSE;
if(!single_value->field_si2ter__present.match(other_value.si2ter__present(), legacy))return FALSE;
if(!other_value.si2quater__present().is_bound()) return FALSE;
if(!single_value->field_si2quater__present.match(other_value.si2quater__present(), legacy))return FALSE;
if(!other_value.si7__present().is_bound()) return FALSE;
if(!single_value->field_si7__present.match(other_value.si7__present(), legacy))return FALSE;
if(!other_value.si8__present().is_bound()) return FALSE;
if(!single_value->field_si8__present.match(other_value.si8__present(), legacy))return FALSE;
if(!other_value.si9__present().is_bound()) return FALSE;
if(!single_value->field_si9__present.match(other_value.si9__present(), legacy))return FALSE;
if(!other_value.si13__present().is_bound()) return FALSE;
if(!single_value->field_si13__present.match(other_value.si13__present(), legacy))return FALSE;
if(!other_value.si13alt__present().is_bound()) return FALSE;
if(!single_value->field_si13alt__present.match(other_value.si13alt__present(), legacy))return FALSE;
if(!other_value.si15__present().is_bound()) return FALSE;
if(!single_value->field_si15__present.match(other_value.si15__present(), legacy))return FALSE;
if(!other_value.si16__present().is_bound()) return FALSE;
if(!single_value->field_si16__present.match(other_value.si16__present(), legacy))return FALSE;
if(!other_value.si17__present().is_bound()) return FALSE;
if(!single_value->field_si17__present.match(other_value.si17__present(), legacy))return FALSE;
if(!other_value.si2n__present().is_bound()) return FALSE;
if(!single_value->field_si2n__present.match(other_value.si2n__present(), legacy))return FALSE;
if(!other_value.si21__present().is_bound()) return FALSE;
if(!single_value->field_si21__present.match(other_value.si21__present(), legacy))return FALSE;
if(!other_value.si22__present().is_bound()) return FALSE;
if(!single_value->field_si22__present.match(other_value.si22__present(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BTS_Tests.SystemInformationConfig.");
}
return FALSE;
}

boolean SystemInformationConfig_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bcch__extended.is_bound()
 || single_value->field_si1__present.is_bound()
 || single_value->field_si2bis__present.is_bound()
 || single_value->field_si2ter__present.is_bound()
 || single_value->field_si2quater__present.is_bound()
 || single_value->field_si7__present.is_bound()
 || single_value->field_si8__present.is_bound()
 || single_value->field_si9__present.is_bound()
 || single_value->field_si13__present.is_bound()
 || single_value->field_si13alt__present.is_bound()
 || single_value->field_si15__present.is_bound()
 || single_value->field_si16__present.is_bound()
 || single_value->field_si17__present.is_bound()
 || single_value->field_si2n__present.is_bound()
 || single_value->field_si21__present.is_bound()
 || single_value->field_si22__present.is_bound();
}

boolean SystemInformationConfig_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bcch__extended.is_value()
 && single_value->field_si1__present.is_value()
 && single_value->field_si2bis__present.is_value()
 && single_value->field_si2ter__present.is_value()
 && single_value->field_si2quater__present.is_value()
 && single_value->field_si7__present.is_value()
 && single_value->field_si8__present.is_value()
 && single_value->field_si9__present.is_value()
 && single_value->field_si13__present.is_value()
 && single_value->field_si13alt__present.is_value()
 && single_value->field_si15__present.is_value()
 && single_value->field_si16__present.is_value()
 && single_value->field_si17__present.is_value()
 && single_value->field_si2n__present.is_value()
 && single_value->field_si21__present.is_value()
 && single_value->field_si22__present.is_value();
}

void SystemInformationConfig_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

SystemInformationConfig SystemInformationConfig_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BTS_Tests.SystemInformationConfig.");
SystemInformationConfig ret_val;
if (single_value->field_bcch__extended.is_bound()) {
ret_val.bcch__extended() = single_value->field_bcch__extended.valueof();
}
if (single_value->field_si1__present.is_bound()) {
ret_val.si1__present() = single_value->field_si1__present.valueof();
}
if (single_value->field_si2bis__present.is_bound()) {
ret_val.si2bis__present() = single_value->field_si2bis__present.valueof();
}
if (single_value->field_si2ter__present.is_bound()) {
ret_val.si2ter__present() = single_value->field_si2ter__present.valueof();
}
if (single_value->field_si2quater__present.is_bound()) {
ret_val.si2quater__present() = single_value->field_si2quater__present.valueof();
}
if (single_value->field_si7__present.is_bound()) {
ret_val.si7__present() = single_value->field_si7__present.valueof();
}
if (single_value->field_si8__present.is_bound()) {
ret_val.si8__present() = single_value->field_si8__present.valueof();
}
if (single_value->field_si9__present.is_bound()) {
ret_val.si9__present() = single_value->field_si9__present.valueof();
}
if (single_value->field_si13__present.is_bound()) {
ret_val.si13__present() = single_value->field_si13__present.valueof();
}
if (single_value->field_si13alt__present.is_bound()) {
ret_val.si13alt__present() = single_value->field_si13alt__present.valueof();
}
if (single_value->field_si15__present.is_bound()) {
ret_val.si15__present() = single_value->field_si15__present.valueof();
}
if (single_value->field_si16__present.is_bound()) {
ret_val.si16__present() = single_value->field_si16__present.valueof();
}
if (single_value->field_si17__present.is_bound()) {
ret_val.si17__present() = single_value->field_si17__present.valueof();
}
if (single_value->field_si2n__present.is_bound()) {
ret_val.si2n__present() = single_value->field_si2n__present.valueof();
}
if (single_value->field_si21__present.is_bound()) {
ret_val.si21__present() = single_value->field_si21__present.valueof();
}
if (single_value->field_si22__present.is_bound()) {
ret_val.si22__present() = single_value->field_si22__present.valueof();
}
return ret_val;
}

void SystemInformationConfig_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @BTS_Tests.SystemInformationConfig.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SystemInformationConfig_template[list_length];
}

SystemInformationConfig_template& SystemInformationConfig_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @BTS_Tests.SystemInformationConfig.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BTS_Tests.SystemInformationConfig.");
return value_list.list_value[list_index];
}

BOOLEAN_template& SystemInformationConfig_template::bcch__extended()
{
set_specific();
return single_value->field_bcch__extended;
}

const BOOLEAN_template& SystemInformationConfig_template::bcch__extended() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bcch_extended of a non-specific template of type @BTS_Tests.SystemInformationConfig.");
return single_value->field_bcch__extended;
}

BOOLEAN_template& SystemInformationConfig_template::si1__present()
{
set_specific();
return single_value->field_si1__present;
}

const BOOLEAN_template& SystemInformationConfig_template::si1__present() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field si1_present of a non-specific template of type @BTS_Tests.SystemInformationConfig.");
return single_value->field_si1__present;
}

BOOLEAN_template& SystemInformationConfig_template::si2bis__present()
{
set_specific();
return single_value->field_si2bis__present;
}

const BOOLEAN_template& SystemInformationConfig_template::si2bis__present() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field si2bis_present of a non-specific template of type @BTS_Tests.SystemInformationConfig.");
return single_value->field_si2bis__present;
}

BOOLEAN_template& SystemInformationConfig_template::si2ter__present()
{
set_specific();
return single_value->field_si2ter__present;
}

const BOOLEAN_template& SystemInformationConfig_template::si2ter__present() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field si2ter_present of a non-specific template of type @BTS_Tests.SystemInformationConfig.");
return single_value->field_si2ter__present;
}

BOOLEAN_template& SystemInformationConfig_template::si2quater__present()
{
set_specific();
return single_value->field_si2quater__present;
}

const BOOLEAN_template& SystemInformationConfig_template::si2quater__present() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field si2quater_present of a non-specific template of type @BTS_Tests.SystemInformationConfig.");
return single_value->field_si2quater__present;
}

BOOLEAN_template& SystemInformationConfig_template::si7__present()
{
set_specific();
return single_value->field_si7__present;
}

const BOOLEAN_template& SystemInformationConfig_template::si7__present() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field si7_present of a non-specific template of type @BTS_Tests.SystemInformationConfig.");
return single_value->field_si7__present;
}

BOOLEAN_template& SystemInformationConfig_template::si8__present()
{
set_specific();
return single_value->field_si8__present;
}

const BOOLEAN_template& SystemInformationConfig_template::si8__present() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field si8_present of a non-specific template of type @BTS_Tests.SystemInformationConfig.");
return single_value->field_si8__present;
}

BOOLEAN_template& SystemInformationConfig_template::si9__present()
{
set_specific();
return single_value->field_si9__present;
}

const BOOLEAN_template& SystemInformationConfig_template::si9__present() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field si9_present of a non-specific template of type @BTS_Tests.SystemInformationConfig.");
return single_value->field_si9__present;
}

BOOLEAN_template& SystemInformationConfig_template::si13__present()
{
set_specific();
return single_value->field_si13__present;
}

const BOOLEAN_template& SystemInformationConfig_template::si13__present() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field si13_present of a non-specific template of type @BTS_Tests.SystemInformationConfig.");
return single_value->field_si13__present;
}

BOOLEAN_template& SystemInformationConfig_template::si13alt__present()
{
set_specific();
return single_value->field_si13alt__present;
}

const BOOLEAN_template& SystemInformationConfig_template::si13alt__present() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field si13alt_present of a non-specific template of type @BTS_Tests.SystemInformationConfig.");
return single_value->field_si13alt__present;
}

BOOLEAN_template& SystemInformationConfig_template::si15__present()
{
set_specific();
return single_value->field_si15__present;
}

const BOOLEAN_template& SystemInformationConfig_template::si15__present() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field si15_present of a non-specific template of type @BTS_Tests.SystemInformationConfig.");
return single_value->field_si15__present;
}

BOOLEAN_template& SystemInformationConfig_template::si16__present()
{
set_specific();
return single_value->field_si16__present;
}

const BOOLEAN_template& SystemInformationConfig_template::si16__present() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field si16_present of a non-specific template of type @BTS_Tests.SystemInformationConfig.");
return single_value->field_si16__present;
}

BOOLEAN_template& SystemInformationConfig_template::si17__present()
{
set_specific();
return single_value->field_si17__present;
}

const BOOLEAN_template& SystemInformationConfig_template::si17__present() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field si17_present of a non-specific template of type @BTS_Tests.SystemInformationConfig.");
return single_value->field_si17__present;
}

BOOLEAN_template& SystemInformationConfig_template::si2n__present()
{
set_specific();
return single_value->field_si2n__present;
}

const BOOLEAN_template& SystemInformationConfig_template::si2n__present() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field si2n_present of a non-specific template of type @BTS_Tests.SystemInformationConfig.");
return single_value->field_si2n__present;
}

BOOLEAN_template& SystemInformationConfig_template::si21__present()
{
set_specific();
return single_value->field_si21__present;
}

const BOOLEAN_template& SystemInformationConfig_template::si21__present() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field si21_present of a non-specific template of type @BTS_Tests.SystemInformationConfig.");
return single_value->field_si21__present;
}

BOOLEAN_template& SystemInformationConfig_template::si22__present()
{
set_specific();
return single_value->field_si22__present;
}

const BOOLEAN_template& SystemInformationConfig_template::si22__present() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field si22_present of a non-specific template of type @BTS_Tests.SystemInformationConfig.");
return single_value->field_si22__present;
}

int SystemInformationConfig_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.SystemInformationConfig which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 16;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @BTS_Tests.SystemInformationConfig containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.SystemInformationConfig containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.SystemInformationConfig containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.SystemInformationConfig containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.SystemInformationConfig containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.SystemInformationConfig containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.SystemInformationConfig containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.SystemInformationConfig containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BTS_Tests.SystemInformationConfig.");
  }
  return 0;
}

void SystemInformationConfig_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bcch_extended := ");
single_value->field_bcch__extended.log();
TTCN_Logger::log_event_str(", si1_present := ");
single_value->field_si1__present.log();
TTCN_Logger::log_event_str(", si2bis_present := ");
single_value->field_si2bis__present.log();
TTCN_Logger::log_event_str(", si2ter_present := ");
single_value->field_si2ter__present.log();
TTCN_Logger::log_event_str(", si2quater_present := ");
single_value->field_si2quater__present.log();
TTCN_Logger::log_event_str(", si7_present := ");
single_value->field_si7__present.log();
TTCN_Logger::log_event_str(", si8_present := ");
single_value->field_si8__present.log();
TTCN_Logger::log_event_str(", si9_present := ");
single_value->field_si9__present.log();
TTCN_Logger::log_event_str(", si13_present := ");
single_value->field_si13__present.log();
TTCN_Logger::log_event_str(", si13alt_present := ");
single_value->field_si13alt__present.log();
TTCN_Logger::log_event_str(", si15_present := ");
single_value->field_si15__present.log();
TTCN_Logger::log_event_str(", si16_present := ");
single_value->field_si16__present.log();
TTCN_Logger::log_event_str(", si17_present := ");
single_value->field_si17__present.log();
TTCN_Logger::log_event_str(", si2n_present := ");
single_value->field_si2n__present.log();
TTCN_Logger::log_event_str(", si21_present := ");
single_value->field_si21__present.log();
TTCN_Logger::log_event_str(", si22_present := ");
single_value->field_si22__present.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void SystemInformationConfig_template::log_match(const SystemInformationConfig& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_bcch__extended.match(match_value.bcch__extended(), legacy)){
TTCN_Logger::log_logmatch_info(".bcch_extended");
single_value->field_bcch__extended.log_match(match_value.bcch__extended(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_si1__present.match(match_value.si1__present(), legacy)){
TTCN_Logger::log_logmatch_info(".si1_present");
single_value->field_si1__present.log_match(match_value.si1__present(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_si2bis__present.match(match_value.si2bis__present(), legacy)){
TTCN_Logger::log_logmatch_info(".si2bis_present");
single_value->field_si2bis__present.log_match(match_value.si2bis__present(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_si2ter__present.match(match_value.si2ter__present(), legacy)){
TTCN_Logger::log_logmatch_info(".si2ter_present");
single_value->field_si2ter__present.log_match(match_value.si2ter__present(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_si2quater__present.match(match_value.si2quater__present(), legacy)){
TTCN_Logger::log_logmatch_info(".si2quater_present");
single_value->field_si2quater__present.log_match(match_value.si2quater__present(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_si7__present.match(match_value.si7__present(), legacy)){
TTCN_Logger::log_logmatch_info(".si7_present");
single_value->field_si7__present.log_match(match_value.si7__present(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_si8__present.match(match_value.si8__present(), legacy)){
TTCN_Logger::log_logmatch_info(".si8_present");
single_value->field_si8__present.log_match(match_value.si8__present(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_si9__present.match(match_value.si9__present(), legacy)){
TTCN_Logger::log_logmatch_info(".si9_present");
single_value->field_si9__present.log_match(match_value.si9__present(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_si13__present.match(match_value.si13__present(), legacy)){
TTCN_Logger::log_logmatch_info(".si13_present");
single_value->field_si13__present.log_match(match_value.si13__present(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_si13alt__present.match(match_value.si13alt__present(), legacy)){
TTCN_Logger::log_logmatch_info(".si13alt_present");
single_value->field_si13alt__present.log_match(match_value.si13alt__present(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_si15__present.match(match_value.si15__present(), legacy)){
TTCN_Logger::log_logmatch_info(".si15_present");
single_value->field_si15__present.log_match(match_value.si15__present(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_si16__present.match(match_value.si16__present(), legacy)){
TTCN_Logger::log_logmatch_info(".si16_present");
single_value->field_si16__present.log_match(match_value.si16__present(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_si17__present.match(match_value.si17__present(), legacy)){
TTCN_Logger::log_logmatch_info(".si17_present");
single_value->field_si17__present.log_match(match_value.si17__present(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_si2n__present.match(match_value.si2n__present(), legacy)){
TTCN_Logger::log_logmatch_info(".si2n_present");
single_value->field_si2n__present.log_match(match_value.si2n__present(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_si21__present.match(match_value.si21__present(), legacy)){
TTCN_Logger::log_logmatch_info(".si21_present");
single_value->field_si21__present.log_match(match_value.si21__present(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_si22__present.match(match_value.si22__present(), legacy)){
TTCN_Logger::log_logmatch_info(".si22_present");
single_value->field_si22__present.log_match(match_value.si22__present(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ bcch_extended := ");
single_value->field_bcch__extended.log_match(match_value.bcch__extended(), legacy);
TTCN_Logger::log_event_str(", si1_present := ");
single_value->field_si1__present.log_match(match_value.si1__present(), legacy);
TTCN_Logger::log_event_str(", si2bis_present := ");
single_value->field_si2bis__present.log_match(match_value.si2bis__present(), legacy);
TTCN_Logger::log_event_str(", si2ter_present := ");
single_value->field_si2ter__present.log_match(match_value.si2ter__present(), legacy);
TTCN_Logger::log_event_str(", si2quater_present := ");
single_value->field_si2quater__present.log_match(match_value.si2quater__present(), legacy);
TTCN_Logger::log_event_str(", si7_present := ");
single_value->field_si7__present.log_match(match_value.si7__present(), legacy);
TTCN_Logger::log_event_str(", si8_present := ");
single_value->field_si8__present.log_match(match_value.si8__present(), legacy);
TTCN_Logger::log_event_str(", si9_present := ");
single_value->field_si9__present.log_match(match_value.si9__present(), legacy);
TTCN_Logger::log_event_str(", si13_present := ");
single_value->field_si13__present.log_match(match_value.si13__present(), legacy);
TTCN_Logger::log_event_str(", si13alt_present := ");
single_value->field_si13alt__present.log_match(match_value.si13alt__present(), legacy);
TTCN_Logger::log_event_str(", si15_present := ");
single_value->field_si15__present.log_match(match_value.si15__present(), legacy);
TTCN_Logger::log_event_str(", si16_present := ");
single_value->field_si16__present.log_match(match_value.si16__present(), legacy);
TTCN_Logger::log_event_str(", si17_present := ");
single_value->field_si17__present.log_match(match_value.si17__present(), legacy);
TTCN_Logger::log_event_str(", si2n_present := ");
single_value->field_si2n__present.log_match(match_value.si2n__present(), legacy);
TTCN_Logger::log_event_str(", si21_present := ");
single_value->field_si21__present.log_match(match_value.si21__present(), legacy);
TTCN_Logger::log_event_str(", si22_present := ");
single_value->field_si22__present.log_match(match_value.si22__present(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void SystemInformationConfig_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (bcch__extended().is_bound()) bcch__extended().set_implicit_omit();
if (si1__present().is_bound()) si1__present().set_implicit_omit();
if (si2bis__present().is_bound()) si2bis__present().set_implicit_omit();
if (si2ter__present().is_bound()) si2ter__present().set_implicit_omit();
if (si2quater__present().is_bound()) si2quater__present().set_implicit_omit();
if (si7__present().is_bound()) si7__present().set_implicit_omit();
if (si8__present().is_bound()) si8__present().set_implicit_omit();
if (si9__present().is_bound()) si9__present().set_implicit_omit();
if (si13__present().is_bound()) si13__present().set_implicit_omit();
if (si13alt__present().is_bound()) si13alt__present().set_implicit_omit();
if (si15__present().is_bound()) si15__present().set_implicit_omit();
if (si16__present().is_bound()) si16__present().set_implicit_omit();
if (si17__present().is_bound()) si17__present().set_implicit_omit();
if (si2n__present().is_bound()) si2n__present().set_implicit_omit();
if (si21__present().is_bound()) si21__present().set_implicit_omit();
if (si22__present().is_bound()) si22__present().set_implicit_omit();
}

void SystemInformationConfig_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_bcch__extended.encode_text(text_buf);
single_value->field_si1__present.encode_text(text_buf);
single_value->field_si2bis__present.encode_text(text_buf);
single_value->field_si2ter__present.encode_text(text_buf);
single_value->field_si2quater__present.encode_text(text_buf);
single_value->field_si7__present.encode_text(text_buf);
single_value->field_si8__present.encode_text(text_buf);
single_value->field_si9__present.encode_text(text_buf);
single_value->field_si13__present.encode_text(text_buf);
single_value->field_si13alt__present.encode_text(text_buf);
single_value->field_si15__present.encode_text(text_buf);
single_value->field_si16__present.encode_text(text_buf);
single_value->field_si17__present.encode_text(text_buf);
single_value->field_si2n__present.encode_text(text_buf);
single_value->field_si21__present.encode_text(text_buf);
single_value->field_si22__present.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BTS_Tests.SystemInformationConfig.");
}
}

void SystemInformationConfig_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_bcch__extended.decode_text(text_buf);
single_value->field_si1__present.decode_text(text_buf);
single_value->field_si2bis__present.decode_text(text_buf);
single_value->field_si2ter__present.decode_text(text_buf);
single_value->field_si2quater__present.decode_text(text_buf);
single_value->field_si7__present.decode_text(text_buf);
single_value->field_si8__present.decode_text(text_buf);
single_value->field_si9__present.decode_text(text_buf);
single_value->field_si13__present.decode_text(text_buf);
single_value->field_si13alt__present.decode_text(text_buf);
single_value->field_si15__present.decode_text(text_buf);
single_value->field_si16__present.decode_text(text_buf);
single_value->field_si17__present.decode_text(text_buf);
single_value->field_si2n__present.decode_text(text_buf);
single_value->field_si21__present.decode_text(text_buf);
single_value->field_si22__present.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new SystemInformationConfig_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @BTS_Tests.SystemInformationConfig.");
}
}

void SystemInformationConfig_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "set template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    SystemInformationConfig_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (16<param.get_size()) {
      param.error("set template of type @BTS_Tests.SystemInformationConfig has 16 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bcch__extended().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) si1__present().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) si2bis__present().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) si2ter__present().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) si2quater__present().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) si7__present().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) si8__present().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) si9__present().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) si13__present().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) si13alt__present().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) si15__present().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) si16__present().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) si17__present().set_param(*param.get_elem(12));
    if (param.get_size()>13 && param.get_elem(13)->get_type()!=Module_Param::MP_NotUsed) si2n__present().set_param(*param.get_elem(13));
    if (param.get_size()>14 && param.get_elem(14)->get_type()!=Module_Param::MP_NotUsed) si21__present().set_param(*param.get_elem(14));
    if (param.get_size()>15 && param.get_elem(15)->get_type()!=Module_Param::MP_NotUsed) si22__present().set_param(*param.get_elem(15));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bcch_extended")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bcch__extended().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "si1_present")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          si1__present().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "si2bis_present")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          si2bis__present().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "si2ter_present")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          si2ter__present().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "si2quater_present")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          si2quater__present().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "si7_present")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          si7__present().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "si8_present")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          si8__present().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "si9_present")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          si9__present().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "si13_present")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          si13__present().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "si13alt_present")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          si13alt__present().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "si15_present")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          si15__present().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "si16_present")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          si16__present().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "si17_present")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          si17__present().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "si2n_present")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          si2n__present().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "si21_present")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          si21__present().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "si22_present")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          si22__present().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BTS_Tests.SystemInformationConfig: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    SystemInformationConfig_template* precondition = new SystemInformationConfig_template;
    precondition->set_param(*param.get_elem(0));
    SystemInformationConfig_template* implied_template = new SystemInformationConfig_template;
    implied_template->set_param(*param.get_elem(1));
    *this = SystemInformationConfig_template(precondition, implied_template);
  } break;
  default:
    param.type_error("set template", "@BTS_Tests.SystemInformationConfig");
  }
  is_ifpresent = param.get_ifpresent();
}

void SystemInformationConfig_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_bcch__extended.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.SystemInformationConfig");
single_value->field_si1__present.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.SystemInformationConfig");
single_value->field_si2bis__present.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.SystemInformationConfig");
single_value->field_si2ter__present.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.SystemInformationConfig");
single_value->field_si2quater__present.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.SystemInformationConfig");
single_value->field_si7__present.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.SystemInformationConfig");
single_value->field_si8__present.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.SystemInformationConfig");
single_value->field_si9__present.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.SystemInformationConfig");
single_value->field_si13__present.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.SystemInformationConfig");
single_value->field_si13alt__present.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.SystemInformationConfig");
single_value->field_si15__present.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.SystemInformationConfig");
single_value->field_si16__present.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.SystemInformationConfig");
single_value->field_si17__present.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.SystemInformationConfig");
single_value->field_si2n__present.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.SystemInformationConfig");
single_value->field_si21__present.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.SystemInformationConfig");
single_value->field_si22__present.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.SystemInformationConfig");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@BTS_Tests.SystemInformationConfig");
}

boolean SystemInformationConfig_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean SystemInformationConfig_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

MeasElem::MeasElem()
{
}

MeasElem::MeasElem(const INTEGER& par_rxlev,
    const INTEGER& par_rxqual)
  :   field_rxlev(par_rxlev),
  field_rxqual(par_rxqual)
{
}

MeasElem::MeasElem(const MeasElem& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BTS_Tests.MeasElem.");
if (other_value.rxlev().is_bound()) field_rxlev = other_value.rxlev();
else field_rxlev.clean_up();
if (other_value.rxqual().is_bound()) field_rxqual = other_value.rxqual();
else field_rxqual.clean_up();
}

void MeasElem::clean_up()
{
field_rxlev.clean_up();
field_rxqual.clean_up();
}

const TTCN_Typedescriptor_t* MeasElem::get_descriptor() const { return &MeasElem_descr_; }
MeasElem& MeasElem::operator=(const MeasElem& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BTS_Tests.MeasElem.");
  if (other_value.rxlev().is_bound()) field_rxlev = other_value.rxlev();
  else field_rxlev.clean_up();
  if (other_value.rxqual().is_bound()) field_rxqual = other_value.rxqual();
  else field_rxqual.clean_up();
}
return *this;
}

boolean MeasElem::operator==(const MeasElem& other_value) const
{
return field_rxlev==other_value.field_rxlev
  && field_rxqual==other_value.field_rxqual;
}

boolean MeasElem::is_bound() const
{
return (field_rxlev.is_bound())
  || (field_rxqual.is_bound());
}
boolean MeasElem::is_value() const
{
return field_rxlev.is_value()
  && field_rxqual.is_value();
}
void MeasElem::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ rxlev := ");
field_rxlev.log();
TTCN_Logger::log_event_str(", rxqual := ");
field_rxqual.log();
TTCN_Logger::log_event_str(" }");
}

void MeasElem::set_implicit_omit()
{
if (rxlev().is_bound()) rxlev().set_implicit_omit();
if (rxqual().is_bound()) rxqual().set_implicit_omit();
}

void MeasElem::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record value of type @BTS_Tests.MeasElem has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) rxlev().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) rxqual().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rxlev")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rxlev().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rxqual")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rxqual().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BTS_Tests.MeasElem: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BTS_Tests.MeasElem");
  }
}

void MeasElem::encode_text(Text_Buf& text_buf) const
{
field_rxlev.encode_text(text_buf);
field_rxqual.encode_text(text_buf);
}

void MeasElem::decode_text(Text_Buf& text_buf)
{
field_rxlev.decode_text(text_buf);
field_rxqual.decode_text(text_buf);
}

struct MeasElem_template::single_value_struct {
INTEGER_template field_rxlev;
INTEGER_template field_rxqual;
};

void MeasElem_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_rxlev = ANY_VALUE;
single_value->field_rxqual = ANY_VALUE;
}
}
}

void MeasElem_template::copy_value(const MeasElem& other_value)
{
single_value = new single_value_struct;
if (other_value.rxlev().is_bound()) {
  single_value->field_rxlev = other_value.rxlev();
} else {
  single_value->field_rxlev.clean_up();
}
if (other_value.rxqual().is_bound()) {
  single_value->field_rxqual = other_value.rxqual();
} else {
  single_value->field_rxqual.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void MeasElem_template::copy_template(const MeasElem_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.rxlev().get_selection()) {
single_value->field_rxlev = other_value.rxlev();
} else {
single_value->field_rxlev.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rxqual().get_selection()) {
single_value->field_rxqual = other_value.rxqual();
} else {
single_value->field_rxqual.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new MeasElem_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new MeasElem_template(*other_value.implication_.precondition);
implication_.implied_template = new MeasElem_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BTS_Tests.MeasElem.");
break;
}
set_selection(other_value);
}

MeasElem_template::MeasElem_template()
{
}

MeasElem_template::MeasElem_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

MeasElem_template::MeasElem_template(const MeasElem& other_value)
{
copy_value(other_value);
}

MeasElem_template::MeasElem_template(const OPTIONAL<MeasElem>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const MeasElem&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BTS_Tests.MeasElem from an unbound optional field.");
}
}

MeasElem_template::MeasElem_template(MeasElem_template* p_precondition, MeasElem_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

MeasElem_template::MeasElem_template(Dynamic_Match_Interface<MeasElem>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<MeasElem>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

MeasElem_template::MeasElem_template(const MeasElem_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

MeasElem_template::~MeasElem_template()
{
clean_up();
}

MeasElem_template& MeasElem_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

MeasElem_template& MeasElem_template::operator=(const MeasElem& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

MeasElem_template& MeasElem_template::operator=(const OPTIONAL<MeasElem>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const MeasElem&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @BTS_Tests.MeasElem.");
}
return *this;
}

MeasElem_template& MeasElem_template::operator=(const MeasElem_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean MeasElem_template::match(const MeasElem& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.rxlev().is_bound()) return FALSE;
if(!single_value->field_rxlev.match(other_value.rxlev(), legacy))return FALSE;
if(!other_value.rxqual().is_bound()) return FALSE;
if(!single_value->field_rxqual.match(other_value.rxqual(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BTS_Tests.MeasElem.");
}
return FALSE;
}

boolean MeasElem_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_rxlev.is_bound()
 || single_value->field_rxqual.is_bound();
}

boolean MeasElem_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_rxlev.is_value()
 && single_value->field_rxqual.is_value();
}

void MeasElem_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

MeasElem MeasElem_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BTS_Tests.MeasElem.");
MeasElem ret_val;
if (single_value->field_rxlev.is_bound()) {
ret_val.rxlev() = single_value->field_rxlev.valueof();
}
if (single_value->field_rxqual.is_bound()) {
ret_val.rxqual() = single_value->field_rxqual.valueof();
}
return ret_val;
}

void MeasElem_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @BTS_Tests.MeasElem.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new MeasElem_template[list_length];
}

MeasElem_template& MeasElem_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @BTS_Tests.MeasElem.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BTS_Tests.MeasElem.");
return value_list.list_value[list_index];
}

INTEGER_template& MeasElem_template::rxlev()
{
set_specific();
return single_value->field_rxlev;
}

const INTEGER_template& MeasElem_template::rxlev() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rxlev of a non-specific template of type @BTS_Tests.MeasElem.");
return single_value->field_rxlev;
}

INTEGER_template& MeasElem_template::rxqual()
{
set_specific();
return single_value->field_rxqual;
}

const INTEGER_template& MeasElem_template::rxqual() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rxqual of a non-specific template of type @BTS_Tests.MeasElem.");
return single_value->field_rxqual;
}

int MeasElem_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.MeasElem which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 2;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @BTS_Tests.MeasElem containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.MeasElem containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.MeasElem containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.MeasElem containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.MeasElem containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.MeasElem containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.MeasElem containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.MeasElem containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BTS_Tests.MeasElem.");
  }
  return 0;
}

void MeasElem_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ rxlev := ");
single_value->field_rxlev.log();
TTCN_Logger::log_event_str(", rxqual := ");
single_value->field_rxqual.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void MeasElem_template::log_match(const MeasElem& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_rxlev.match(match_value.rxlev(), legacy)){
TTCN_Logger::log_logmatch_info(".rxlev");
single_value->field_rxlev.log_match(match_value.rxlev(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_rxqual.match(match_value.rxqual(), legacy)){
TTCN_Logger::log_logmatch_info(".rxqual");
single_value->field_rxqual.log_match(match_value.rxqual(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ rxlev := ");
single_value->field_rxlev.log_match(match_value.rxlev(), legacy);
TTCN_Logger::log_event_str(", rxqual := ");
single_value->field_rxqual.log_match(match_value.rxqual(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void MeasElem_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (rxlev().is_bound()) rxlev().set_implicit_omit();
if (rxqual().is_bound()) rxqual().set_implicit_omit();
}

void MeasElem_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_rxlev.encode_text(text_buf);
single_value->field_rxqual.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BTS_Tests.MeasElem.");
}
}

void MeasElem_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_rxlev.decode_text(text_buf);
single_value->field_rxqual.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new MeasElem_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @BTS_Tests.MeasElem.");
}
}

void MeasElem_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    MeasElem_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record template of type @BTS_Tests.MeasElem has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) rxlev().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) rxqual().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rxlev")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rxlev().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rxqual")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rxqual().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BTS_Tests.MeasElem: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    MeasElem_template* precondition = new MeasElem_template;
    precondition->set_param(*param.get_elem(0));
    MeasElem_template* implied_template = new MeasElem_template;
    implied_template->set_param(*param.get_elem(1));
    *this = MeasElem_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BTS_Tests.MeasElem");
  }
  is_ifpresent = param.get_ifpresent();
}

void MeasElem_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_rxlev.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.MeasElem");
single_value->field_rxqual.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.MeasElem");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@BTS_Tests.MeasElem");
}

boolean MeasElem_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean MeasElem_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

MeasElemFS::MeasElemFS()
{
}

MeasElemFS::MeasElemFS(const MeasElem& par_full,
    const MeasElem& par_sub)
  :   field_full(par_full),
  field_sub(par_sub)
{
}

MeasElemFS::MeasElemFS(const MeasElemFS& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BTS_Tests.MeasElemFS.");
if (other_value.full().is_bound()) field_full = other_value.full();
else field_full.clean_up();
if (other_value.sub().is_bound()) field_sub = other_value.sub();
else field_sub.clean_up();
}

void MeasElemFS::clean_up()
{
field_full.clean_up();
field_sub.clean_up();
}

const TTCN_Typedescriptor_t* MeasElemFS::get_descriptor() const { return &MeasElemFS_descr_; }
MeasElemFS& MeasElemFS::operator=(const MeasElemFS& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BTS_Tests.MeasElemFS.");
  if (other_value.full().is_bound()) field_full = other_value.full();
  else field_full.clean_up();
  if (other_value.sub().is_bound()) field_sub = other_value.sub();
  else field_sub.clean_up();
}
return *this;
}

boolean MeasElemFS::operator==(const MeasElemFS& other_value) const
{
return field_full==other_value.field_full
  && field_sub==other_value.field_sub;
}

boolean MeasElemFS::is_bound() const
{
return (field_full.is_bound())
  || (field_sub.is_bound());
}
boolean MeasElemFS::is_value() const
{
return field_full.is_value()
  && field_sub.is_value();
}
void MeasElemFS::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ full := ");
field_full.log();
TTCN_Logger::log_event_str(", sub := ");
field_sub.log();
TTCN_Logger::log_event_str(" }");
}

void MeasElemFS::set_implicit_omit()
{
if (full().is_bound()) full().set_implicit_omit();
if (sub().is_bound()) sub().set_implicit_omit();
}

void MeasElemFS::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record value of type @BTS_Tests.MeasElemFS has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) full().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) sub().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "full")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          full().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sub")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sub().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BTS_Tests.MeasElemFS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BTS_Tests.MeasElemFS");
  }
}

void MeasElemFS::encode_text(Text_Buf& text_buf) const
{
field_full.encode_text(text_buf);
field_sub.encode_text(text_buf);
}

void MeasElemFS::decode_text(Text_Buf& text_buf)
{
field_full.decode_text(text_buf);
field_sub.decode_text(text_buf);
}

struct MeasElemFS_template::single_value_struct {
MeasElem_template field_full;
MeasElem_template field_sub;
};

void MeasElemFS_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_full = ANY_VALUE;
single_value->field_sub = ANY_VALUE;
}
}
}

void MeasElemFS_template::copy_value(const MeasElemFS& other_value)
{
single_value = new single_value_struct;
if (other_value.full().is_bound()) {
  single_value->field_full = other_value.full();
} else {
  single_value->field_full.clean_up();
}
if (other_value.sub().is_bound()) {
  single_value->field_sub = other_value.sub();
} else {
  single_value->field_sub.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void MeasElemFS_template::copy_template(const MeasElemFS_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.full().get_selection()) {
single_value->field_full = other_value.full();
} else {
single_value->field_full.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.sub().get_selection()) {
single_value->field_sub = other_value.sub();
} else {
single_value->field_sub.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new MeasElemFS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new MeasElemFS_template(*other_value.implication_.precondition);
implication_.implied_template = new MeasElemFS_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BTS_Tests.MeasElemFS.");
break;
}
set_selection(other_value);
}

MeasElemFS_template::MeasElemFS_template()
{
}

MeasElemFS_template::MeasElemFS_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

MeasElemFS_template::MeasElemFS_template(const MeasElemFS& other_value)
{
copy_value(other_value);
}

MeasElemFS_template::MeasElemFS_template(const OPTIONAL<MeasElemFS>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const MeasElemFS&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BTS_Tests.MeasElemFS from an unbound optional field.");
}
}

MeasElemFS_template::MeasElemFS_template(MeasElemFS_template* p_precondition, MeasElemFS_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

MeasElemFS_template::MeasElemFS_template(Dynamic_Match_Interface<MeasElemFS>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<MeasElemFS>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

MeasElemFS_template::MeasElemFS_template(const MeasElemFS_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

MeasElemFS_template::~MeasElemFS_template()
{
clean_up();
}

MeasElemFS_template& MeasElemFS_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

MeasElemFS_template& MeasElemFS_template::operator=(const MeasElemFS& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

MeasElemFS_template& MeasElemFS_template::operator=(const OPTIONAL<MeasElemFS>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const MeasElemFS&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @BTS_Tests.MeasElemFS.");
}
return *this;
}

MeasElemFS_template& MeasElemFS_template::operator=(const MeasElemFS_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean MeasElemFS_template::match(const MeasElemFS& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.full().is_bound()) return FALSE;
if(!single_value->field_full.match(other_value.full(), legacy))return FALSE;
if(!other_value.sub().is_bound()) return FALSE;
if(!single_value->field_sub.match(other_value.sub(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BTS_Tests.MeasElemFS.");
}
return FALSE;
}

boolean MeasElemFS_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_full.is_bound()
 || single_value->field_sub.is_bound();
}

boolean MeasElemFS_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_full.is_value()
 && single_value->field_sub.is_value();
}

void MeasElemFS_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

MeasElemFS MeasElemFS_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BTS_Tests.MeasElemFS.");
MeasElemFS ret_val;
if (single_value->field_full.is_bound()) {
ret_val.full() = single_value->field_full.valueof();
}
if (single_value->field_sub.is_bound()) {
ret_val.sub() = single_value->field_sub.valueof();
}
return ret_val;
}

void MeasElemFS_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @BTS_Tests.MeasElemFS.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new MeasElemFS_template[list_length];
}

MeasElemFS_template& MeasElemFS_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @BTS_Tests.MeasElemFS.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BTS_Tests.MeasElemFS.");
return value_list.list_value[list_index];
}

MeasElem_template& MeasElemFS_template::full()
{
set_specific();
return single_value->field_full;
}

const MeasElem_template& MeasElemFS_template::full() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field full of a non-specific template of type @BTS_Tests.MeasElemFS.");
return single_value->field_full;
}

MeasElem_template& MeasElemFS_template::sub()
{
set_specific();
return single_value->field_sub;
}

const MeasElem_template& MeasElemFS_template::sub() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sub of a non-specific template of type @BTS_Tests.MeasElemFS.");
return single_value->field_sub;
}

int MeasElemFS_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.MeasElemFS which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 2;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @BTS_Tests.MeasElemFS containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.MeasElemFS containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.MeasElemFS containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.MeasElemFS containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.MeasElemFS containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.MeasElemFS containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.MeasElemFS containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.MeasElemFS containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BTS_Tests.MeasElemFS.");
  }
  return 0;
}

void MeasElemFS_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ full := ");
single_value->field_full.log();
TTCN_Logger::log_event_str(", sub := ");
single_value->field_sub.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void MeasElemFS_template::log_match(const MeasElemFS& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_full.match(match_value.full(), legacy)){
TTCN_Logger::log_logmatch_info(".full");
single_value->field_full.log_match(match_value.full(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_sub.match(match_value.sub(), legacy)){
TTCN_Logger::log_logmatch_info(".sub");
single_value->field_sub.log_match(match_value.sub(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ full := ");
single_value->field_full.log_match(match_value.full(), legacy);
TTCN_Logger::log_event_str(", sub := ");
single_value->field_sub.log_match(match_value.sub(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void MeasElemFS_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (full().is_bound()) full().set_implicit_omit();
if (sub().is_bound()) sub().set_implicit_omit();
}

void MeasElemFS_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_full.encode_text(text_buf);
single_value->field_sub.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BTS_Tests.MeasElemFS.");
}
}

void MeasElemFS_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_full.decode_text(text_buf);
single_value->field_sub.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new MeasElemFS_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @BTS_Tests.MeasElemFS.");
}
}

void MeasElemFS_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    MeasElemFS_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record template of type @BTS_Tests.MeasElemFS has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) full().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) sub().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "full")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          full().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sub")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sub().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BTS_Tests.MeasElemFS: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    MeasElemFS_template* precondition = new MeasElemFS_template;
    precondition->set_param(*param.get_elem(0));
    MeasElemFS_template* implied_template = new MeasElemFS_template;
    implied_template->set_param(*param.get_elem(1));
    *this = MeasElemFS_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BTS_Tests.MeasElemFS");
  }
  is_ifpresent = param.get_ifpresent();
}

void MeasElemFS_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_full.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.MeasElemFS");
single_value->field_sub.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.MeasElemFS");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@BTS_Tests.MeasElemFS");
}

boolean MeasElemFS_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean MeasElemFS_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

ConnL1Pars::ConnL1Pars()
{
}

ConnL1Pars::ConnL1Pars(const BOOLEAN& par_dtx__enabled,
    const BOOLEAN& par_toa256__enabled,
    const BOOLEAN& par_meas__valid,
    const MeasElemFS& par_meas__ul,
    const INTEGER& par_timing__offset__256syms,
    const INTEGER& par_bs__power__level,
    const INTEGER& par_ms__power__level,
    const INTEGER& par_ms__actual__ta,
    const BOOLEAN& par_facch__enabled)
  :   field_dtx__enabled(par_dtx__enabled),
  field_toa256__enabled(par_toa256__enabled),
  field_meas__valid(par_meas__valid),
  field_meas__ul(par_meas__ul),
  field_timing__offset__256syms(par_timing__offset__256syms),
  field_bs__power__level(par_bs__power__level),
  field_ms__power__level(par_ms__power__level),
  field_ms__actual__ta(par_ms__actual__ta),
  field_facch__enabled(par_facch__enabled)
{
}

ConnL1Pars::ConnL1Pars(const ConnL1Pars& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BTS_Tests.ConnL1Pars.");
if (other_value.dtx__enabled().is_bound()) field_dtx__enabled = other_value.dtx__enabled();
else field_dtx__enabled.clean_up();
if (other_value.toa256__enabled().is_bound()) field_toa256__enabled = other_value.toa256__enabled();
else field_toa256__enabled.clean_up();
if (other_value.meas__valid().is_bound()) field_meas__valid = other_value.meas__valid();
else field_meas__valid.clean_up();
if (other_value.meas__ul().is_bound()) field_meas__ul = other_value.meas__ul();
else field_meas__ul.clean_up();
if (other_value.timing__offset__256syms().is_bound()) field_timing__offset__256syms = other_value.timing__offset__256syms();
else field_timing__offset__256syms.clean_up();
if (other_value.bs__power__level().is_bound()) field_bs__power__level = other_value.bs__power__level();
else field_bs__power__level.clean_up();
if (other_value.ms__power__level().is_bound()) field_ms__power__level = other_value.ms__power__level();
else field_ms__power__level.clean_up();
if (other_value.ms__actual__ta().is_bound()) field_ms__actual__ta = other_value.ms__actual__ta();
else field_ms__actual__ta.clean_up();
if (other_value.facch__enabled().is_bound()) field_facch__enabled = other_value.facch__enabled();
else field_facch__enabled.clean_up();
}

void ConnL1Pars::clean_up()
{
field_dtx__enabled.clean_up();
field_toa256__enabled.clean_up();
field_meas__valid.clean_up();
field_meas__ul.clean_up();
field_timing__offset__256syms.clean_up();
field_bs__power__level.clean_up();
field_ms__power__level.clean_up();
field_ms__actual__ta.clean_up();
field_facch__enabled.clean_up();
}

const TTCN_Typedescriptor_t* ConnL1Pars::get_descriptor() const { return &ConnL1Pars_descr_; }
ConnL1Pars& ConnL1Pars::operator=(const ConnL1Pars& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BTS_Tests.ConnL1Pars.");
  if (other_value.dtx__enabled().is_bound()) field_dtx__enabled = other_value.dtx__enabled();
  else field_dtx__enabled.clean_up();
  if (other_value.toa256__enabled().is_bound()) field_toa256__enabled = other_value.toa256__enabled();
  else field_toa256__enabled.clean_up();
  if (other_value.meas__valid().is_bound()) field_meas__valid = other_value.meas__valid();
  else field_meas__valid.clean_up();
  if (other_value.meas__ul().is_bound()) field_meas__ul = other_value.meas__ul();
  else field_meas__ul.clean_up();
  if (other_value.timing__offset__256syms().is_bound()) field_timing__offset__256syms = other_value.timing__offset__256syms();
  else field_timing__offset__256syms.clean_up();
  if (other_value.bs__power__level().is_bound()) field_bs__power__level = other_value.bs__power__level();
  else field_bs__power__level.clean_up();
  if (other_value.ms__power__level().is_bound()) field_ms__power__level = other_value.ms__power__level();
  else field_ms__power__level.clean_up();
  if (other_value.ms__actual__ta().is_bound()) field_ms__actual__ta = other_value.ms__actual__ta();
  else field_ms__actual__ta.clean_up();
  if (other_value.facch__enabled().is_bound()) field_facch__enabled = other_value.facch__enabled();
  else field_facch__enabled.clean_up();
}
return *this;
}

boolean ConnL1Pars::operator==(const ConnL1Pars& other_value) const
{
return field_dtx__enabled==other_value.field_dtx__enabled
  && field_toa256__enabled==other_value.field_toa256__enabled
  && field_meas__valid==other_value.field_meas__valid
  && field_meas__ul==other_value.field_meas__ul
  && field_timing__offset__256syms==other_value.field_timing__offset__256syms
  && field_bs__power__level==other_value.field_bs__power__level
  && field_ms__power__level==other_value.field_ms__power__level
  && field_ms__actual__ta==other_value.field_ms__actual__ta
  && field_facch__enabled==other_value.field_facch__enabled;
}

boolean ConnL1Pars::is_bound() const
{
return (field_dtx__enabled.is_bound())
  || (field_toa256__enabled.is_bound())
  || (field_meas__valid.is_bound())
  || (field_meas__ul.is_bound())
  || (field_timing__offset__256syms.is_bound())
  || (field_bs__power__level.is_bound())
  || (field_ms__power__level.is_bound())
  || (field_ms__actual__ta.is_bound())
  || (field_facch__enabled.is_bound());
}
boolean ConnL1Pars::is_value() const
{
return field_dtx__enabled.is_value()
  && field_toa256__enabled.is_value()
  && field_meas__valid.is_value()
  && field_meas__ul.is_value()
  && field_timing__offset__256syms.is_value()
  && field_bs__power__level.is_value()
  && field_ms__power__level.is_value()
  && field_ms__actual__ta.is_value()
  && field_facch__enabled.is_value();
}
void ConnL1Pars::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ dtx_enabled := ");
field_dtx__enabled.log();
TTCN_Logger::log_event_str(", toa256_enabled := ");
field_toa256__enabled.log();
TTCN_Logger::log_event_str(", meas_valid := ");
field_meas__valid.log();
TTCN_Logger::log_event_str(", meas_ul := ");
field_meas__ul.log();
TTCN_Logger::log_event_str(", timing_offset_256syms := ");
field_timing__offset__256syms.log();
TTCN_Logger::log_event_str(", bs_power_level := ");
field_bs__power__level.log();
TTCN_Logger::log_event_str(", ms_power_level := ");
field_ms__power__level.log();
TTCN_Logger::log_event_str(", ms_actual_ta := ");
field_ms__actual__ta.log();
TTCN_Logger::log_event_str(", facch_enabled := ");
field_facch__enabled.log();
TTCN_Logger::log_event_str(" }");
}

void ConnL1Pars::set_implicit_omit()
{
if (dtx__enabled().is_bound()) dtx__enabled().set_implicit_omit();
if (toa256__enabled().is_bound()) toa256__enabled().set_implicit_omit();
if (meas__valid().is_bound()) meas__valid().set_implicit_omit();
if (meas__ul().is_bound()) meas__ul().set_implicit_omit();
if (timing__offset__256syms().is_bound()) timing__offset__256syms().set_implicit_omit();
if (bs__power__level().is_bound()) bs__power__level().set_implicit_omit();
if (ms__power__level().is_bound()) ms__power__level().set_implicit_omit();
if (ms__actual__ta().is_bound()) ms__actual__ta().set_implicit_omit();
if (facch__enabled().is_bound()) facch__enabled().set_implicit_omit();
}

void ConnL1Pars::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (9<param.get_size()) {
      param.error("record value of type @BTS_Tests.ConnL1Pars has 9 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) dtx__enabled().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) toa256__enabled().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) meas__valid().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) meas__ul().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) timing__offset__256syms().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) bs__power__level().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) ms__power__level().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) ms__actual__ta().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) facch__enabled().set_param(*param.get_elem(8));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "dtx_enabled")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dtx__enabled().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "toa256_enabled")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          toa256__enabled().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "meas_valid")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          meas__valid().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "meas_ul")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          meas__ul().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "timing_offset_256syms")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          timing__offset__256syms().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bs_power_level")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bs__power__level().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ms_power_level")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ms__power__level().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ms_actual_ta")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ms__actual__ta().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "facch_enabled")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          facch__enabled().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BTS_Tests.ConnL1Pars: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BTS_Tests.ConnL1Pars");
  }
}

void ConnL1Pars::encode_text(Text_Buf& text_buf) const
{
field_dtx__enabled.encode_text(text_buf);
field_toa256__enabled.encode_text(text_buf);
field_meas__valid.encode_text(text_buf);
field_meas__ul.encode_text(text_buf);
field_timing__offset__256syms.encode_text(text_buf);
field_bs__power__level.encode_text(text_buf);
field_ms__power__level.encode_text(text_buf);
field_ms__actual__ta.encode_text(text_buf);
field_facch__enabled.encode_text(text_buf);
}

void ConnL1Pars::decode_text(Text_Buf& text_buf)
{
field_dtx__enabled.decode_text(text_buf);
field_toa256__enabled.decode_text(text_buf);
field_meas__valid.decode_text(text_buf);
field_meas__ul.decode_text(text_buf);
field_timing__offset__256syms.decode_text(text_buf);
field_bs__power__level.decode_text(text_buf);
field_ms__power__level.decode_text(text_buf);
field_ms__actual__ta.decode_text(text_buf);
field_facch__enabled.decode_text(text_buf);
}

struct ConnL1Pars_template::single_value_struct {
BOOLEAN_template field_dtx__enabled;
BOOLEAN_template field_toa256__enabled;
BOOLEAN_template field_meas__valid;
MeasElemFS_template field_meas__ul;
INTEGER_template field_timing__offset__256syms;
INTEGER_template field_bs__power__level;
INTEGER_template field_ms__power__level;
INTEGER_template field_ms__actual__ta;
BOOLEAN_template field_facch__enabled;
};

void ConnL1Pars_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_dtx__enabled = ANY_VALUE;
single_value->field_toa256__enabled = ANY_VALUE;
single_value->field_meas__valid = ANY_VALUE;
single_value->field_meas__ul = ANY_VALUE;
single_value->field_timing__offset__256syms = ANY_VALUE;
single_value->field_bs__power__level = ANY_VALUE;
single_value->field_ms__power__level = ANY_VALUE;
single_value->field_ms__actual__ta = ANY_VALUE;
single_value->field_facch__enabled = ANY_VALUE;
}
}
}

void ConnL1Pars_template::copy_value(const ConnL1Pars& other_value)
{
single_value = new single_value_struct;
if (other_value.dtx__enabled().is_bound()) {
  single_value->field_dtx__enabled = other_value.dtx__enabled();
} else {
  single_value->field_dtx__enabled.clean_up();
}
if (other_value.toa256__enabled().is_bound()) {
  single_value->field_toa256__enabled = other_value.toa256__enabled();
} else {
  single_value->field_toa256__enabled.clean_up();
}
if (other_value.meas__valid().is_bound()) {
  single_value->field_meas__valid = other_value.meas__valid();
} else {
  single_value->field_meas__valid.clean_up();
}
if (other_value.meas__ul().is_bound()) {
  single_value->field_meas__ul = other_value.meas__ul();
} else {
  single_value->field_meas__ul.clean_up();
}
if (other_value.timing__offset__256syms().is_bound()) {
  single_value->field_timing__offset__256syms = other_value.timing__offset__256syms();
} else {
  single_value->field_timing__offset__256syms.clean_up();
}
if (other_value.bs__power__level().is_bound()) {
  single_value->field_bs__power__level = other_value.bs__power__level();
} else {
  single_value->field_bs__power__level.clean_up();
}
if (other_value.ms__power__level().is_bound()) {
  single_value->field_ms__power__level = other_value.ms__power__level();
} else {
  single_value->field_ms__power__level.clean_up();
}
if (other_value.ms__actual__ta().is_bound()) {
  single_value->field_ms__actual__ta = other_value.ms__actual__ta();
} else {
  single_value->field_ms__actual__ta.clean_up();
}
if (other_value.facch__enabled().is_bound()) {
  single_value->field_facch__enabled = other_value.facch__enabled();
} else {
  single_value->field_facch__enabled.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void ConnL1Pars_template::copy_template(const ConnL1Pars_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.dtx__enabled().get_selection()) {
single_value->field_dtx__enabled = other_value.dtx__enabled();
} else {
single_value->field_dtx__enabled.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.toa256__enabled().get_selection()) {
single_value->field_toa256__enabled = other_value.toa256__enabled();
} else {
single_value->field_toa256__enabled.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.meas__valid().get_selection()) {
single_value->field_meas__valid = other_value.meas__valid();
} else {
single_value->field_meas__valid.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.meas__ul().get_selection()) {
single_value->field_meas__ul = other_value.meas__ul();
} else {
single_value->field_meas__ul.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.timing__offset__256syms().get_selection()) {
single_value->field_timing__offset__256syms = other_value.timing__offset__256syms();
} else {
single_value->field_timing__offset__256syms.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.bs__power__level().get_selection()) {
single_value->field_bs__power__level = other_value.bs__power__level();
} else {
single_value->field_bs__power__level.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ms__power__level().get_selection()) {
single_value->field_ms__power__level = other_value.ms__power__level();
} else {
single_value->field_ms__power__level.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ms__actual__ta().get_selection()) {
single_value->field_ms__actual__ta = other_value.ms__actual__ta();
} else {
single_value->field_ms__actual__ta.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.facch__enabled().get_selection()) {
single_value->field_facch__enabled = other_value.facch__enabled();
} else {
single_value->field_facch__enabled.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new ConnL1Pars_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new ConnL1Pars_template(*other_value.implication_.precondition);
implication_.implied_template = new ConnL1Pars_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BTS_Tests.ConnL1Pars.");
break;
}
set_selection(other_value);
}

ConnL1Pars_template::ConnL1Pars_template()
{
}

ConnL1Pars_template::ConnL1Pars_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

ConnL1Pars_template::ConnL1Pars_template(const ConnL1Pars& other_value)
{
copy_value(other_value);
}

ConnL1Pars_template::ConnL1Pars_template(const OPTIONAL<ConnL1Pars>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const ConnL1Pars&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BTS_Tests.ConnL1Pars from an unbound optional field.");
}
}

ConnL1Pars_template::ConnL1Pars_template(ConnL1Pars_template* p_precondition, ConnL1Pars_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

ConnL1Pars_template::ConnL1Pars_template(Dynamic_Match_Interface<ConnL1Pars>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<ConnL1Pars>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

ConnL1Pars_template::ConnL1Pars_template(const ConnL1Pars_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

ConnL1Pars_template::~ConnL1Pars_template()
{
clean_up();
}

ConnL1Pars_template& ConnL1Pars_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

ConnL1Pars_template& ConnL1Pars_template::operator=(const ConnL1Pars& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

ConnL1Pars_template& ConnL1Pars_template::operator=(const OPTIONAL<ConnL1Pars>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const ConnL1Pars&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @BTS_Tests.ConnL1Pars.");
}
return *this;
}

ConnL1Pars_template& ConnL1Pars_template::operator=(const ConnL1Pars_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean ConnL1Pars_template::match(const ConnL1Pars& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.dtx__enabled().is_bound()) return FALSE;
if(!single_value->field_dtx__enabled.match(other_value.dtx__enabled(), legacy))return FALSE;
if(!other_value.toa256__enabled().is_bound()) return FALSE;
if(!single_value->field_toa256__enabled.match(other_value.toa256__enabled(), legacy))return FALSE;
if(!other_value.meas__valid().is_bound()) return FALSE;
if(!single_value->field_meas__valid.match(other_value.meas__valid(), legacy))return FALSE;
if(!other_value.meas__ul().is_bound()) return FALSE;
if(!single_value->field_meas__ul.match(other_value.meas__ul(), legacy))return FALSE;
if(!other_value.timing__offset__256syms().is_bound()) return FALSE;
if(!single_value->field_timing__offset__256syms.match(other_value.timing__offset__256syms(), legacy))return FALSE;
if(!other_value.bs__power__level().is_bound()) return FALSE;
if(!single_value->field_bs__power__level.match(other_value.bs__power__level(), legacy))return FALSE;
if(!other_value.ms__power__level().is_bound()) return FALSE;
if(!single_value->field_ms__power__level.match(other_value.ms__power__level(), legacy))return FALSE;
if(!other_value.ms__actual__ta().is_bound()) return FALSE;
if(!single_value->field_ms__actual__ta.match(other_value.ms__actual__ta(), legacy))return FALSE;
if(!other_value.facch__enabled().is_bound()) return FALSE;
if(!single_value->field_facch__enabled.match(other_value.facch__enabled(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BTS_Tests.ConnL1Pars.");
}
return FALSE;
}

boolean ConnL1Pars_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_dtx__enabled.is_bound()
 || single_value->field_toa256__enabled.is_bound()
 || single_value->field_meas__valid.is_bound()
 || single_value->field_meas__ul.is_bound()
 || single_value->field_timing__offset__256syms.is_bound()
 || single_value->field_bs__power__level.is_bound()
 || single_value->field_ms__power__level.is_bound()
 || single_value->field_ms__actual__ta.is_bound()
 || single_value->field_facch__enabled.is_bound();
}

boolean ConnL1Pars_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_dtx__enabled.is_value()
 && single_value->field_toa256__enabled.is_value()
 && single_value->field_meas__valid.is_value()
 && single_value->field_meas__ul.is_value()
 && single_value->field_timing__offset__256syms.is_value()
 && single_value->field_bs__power__level.is_value()
 && single_value->field_ms__power__level.is_value()
 && single_value->field_ms__actual__ta.is_value()
 && single_value->field_facch__enabled.is_value();
}

void ConnL1Pars_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

ConnL1Pars ConnL1Pars_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BTS_Tests.ConnL1Pars.");
ConnL1Pars ret_val;
if (single_value->field_dtx__enabled.is_bound()) {
ret_val.dtx__enabled() = single_value->field_dtx__enabled.valueof();
}
if (single_value->field_toa256__enabled.is_bound()) {
ret_val.toa256__enabled() = single_value->field_toa256__enabled.valueof();
}
if (single_value->field_meas__valid.is_bound()) {
ret_val.meas__valid() = single_value->field_meas__valid.valueof();
}
if (single_value->field_meas__ul.is_bound()) {
ret_val.meas__ul() = single_value->field_meas__ul.valueof();
}
if (single_value->field_timing__offset__256syms.is_bound()) {
ret_val.timing__offset__256syms() = single_value->field_timing__offset__256syms.valueof();
}
if (single_value->field_bs__power__level.is_bound()) {
ret_val.bs__power__level() = single_value->field_bs__power__level.valueof();
}
if (single_value->field_ms__power__level.is_bound()) {
ret_val.ms__power__level() = single_value->field_ms__power__level.valueof();
}
if (single_value->field_ms__actual__ta.is_bound()) {
ret_val.ms__actual__ta() = single_value->field_ms__actual__ta.valueof();
}
if (single_value->field_facch__enabled.is_bound()) {
ret_val.facch__enabled() = single_value->field_facch__enabled.valueof();
}
return ret_val;
}

void ConnL1Pars_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @BTS_Tests.ConnL1Pars.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new ConnL1Pars_template[list_length];
}

ConnL1Pars_template& ConnL1Pars_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @BTS_Tests.ConnL1Pars.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BTS_Tests.ConnL1Pars.");
return value_list.list_value[list_index];
}

BOOLEAN_template& ConnL1Pars_template::dtx__enabled()
{
set_specific();
return single_value->field_dtx__enabled;
}

const BOOLEAN_template& ConnL1Pars_template::dtx__enabled() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field dtx_enabled of a non-specific template of type @BTS_Tests.ConnL1Pars.");
return single_value->field_dtx__enabled;
}

BOOLEAN_template& ConnL1Pars_template::toa256__enabled()
{
set_specific();
return single_value->field_toa256__enabled;
}

const BOOLEAN_template& ConnL1Pars_template::toa256__enabled() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field toa256_enabled of a non-specific template of type @BTS_Tests.ConnL1Pars.");
return single_value->field_toa256__enabled;
}

BOOLEAN_template& ConnL1Pars_template::meas__valid()
{
set_specific();
return single_value->field_meas__valid;
}

const BOOLEAN_template& ConnL1Pars_template::meas__valid() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field meas_valid of a non-specific template of type @BTS_Tests.ConnL1Pars.");
return single_value->field_meas__valid;
}

MeasElemFS_template& ConnL1Pars_template::meas__ul()
{
set_specific();
return single_value->field_meas__ul;
}

const MeasElemFS_template& ConnL1Pars_template::meas__ul() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field meas_ul of a non-specific template of type @BTS_Tests.ConnL1Pars.");
return single_value->field_meas__ul;
}

INTEGER_template& ConnL1Pars_template::timing__offset__256syms()
{
set_specific();
return single_value->field_timing__offset__256syms;
}

const INTEGER_template& ConnL1Pars_template::timing__offset__256syms() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field timing_offset_256syms of a non-specific template of type @BTS_Tests.ConnL1Pars.");
return single_value->field_timing__offset__256syms;
}

INTEGER_template& ConnL1Pars_template::bs__power__level()
{
set_specific();
return single_value->field_bs__power__level;
}

const INTEGER_template& ConnL1Pars_template::bs__power__level() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bs_power_level of a non-specific template of type @BTS_Tests.ConnL1Pars.");
return single_value->field_bs__power__level;
}

INTEGER_template& ConnL1Pars_template::ms__power__level()
{
set_specific();
return single_value->field_ms__power__level;
}

const INTEGER_template& ConnL1Pars_template::ms__power__level() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ms_power_level of a non-specific template of type @BTS_Tests.ConnL1Pars.");
return single_value->field_ms__power__level;
}

INTEGER_template& ConnL1Pars_template::ms__actual__ta()
{
set_specific();
return single_value->field_ms__actual__ta;
}

const INTEGER_template& ConnL1Pars_template::ms__actual__ta() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ms_actual_ta of a non-specific template of type @BTS_Tests.ConnL1Pars.");
return single_value->field_ms__actual__ta;
}

BOOLEAN_template& ConnL1Pars_template::facch__enabled()
{
set_specific();
return single_value->field_facch__enabled;
}

const BOOLEAN_template& ConnL1Pars_template::facch__enabled() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field facch_enabled of a non-specific template of type @BTS_Tests.ConnL1Pars.");
return single_value->field_facch__enabled;
}

int ConnL1Pars_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.ConnL1Pars which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 9;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @BTS_Tests.ConnL1Pars containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.ConnL1Pars containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.ConnL1Pars containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.ConnL1Pars containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.ConnL1Pars containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.ConnL1Pars containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.ConnL1Pars containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.ConnL1Pars containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BTS_Tests.ConnL1Pars.");
  }
  return 0;
}

void ConnL1Pars_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ dtx_enabled := ");
single_value->field_dtx__enabled.log();
TTCN_Logger::log_event_str(", toa256_enabled := ");
single_value->field_toa256__enabled.log();
TTCN_Logger::log_event_str(", meas_valid := ");
single_value->field_meas__valid.log();
TTCN_Logger::log_event_str(", meas_ul := ");
single_value->field_meas__ul.log();
TTCN_Logger::log_event_str(", timing_offset_256syms := ");
single_value->field_timing__offset__256syms.log();
TTCN_Logger::log_event_str(", bs_power_level := ");
single_value->field_bs__power__level.log();
TTCN_Logger::log_event_str(", ms_power_level := ");
single_value->field_ms__power__level.log();
TTCN_Logger::log_event_str(", ms_actual_ta := ");
single_value->field_ms__actual__ta.log();
TTCN_Logger::log_event_str(", facch_enabled := ");
single_value->field_facch__enabled.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void ConnL1Pars_template::log_match(const ConnL1Pars& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_dtx__enabled.match(match_value.dtx__enabled(), legacy)){
TTCN_Logger::log_logmatch_info(".dtx_enabled");
single_value->field_dtx__enabled.log_match(match_value.dtx__enabled(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_toa256__enabled.match(match_value.toa256__enabled(), legacy)){
TTCN_Logger::log_logmatch_info(".toa256_enabled");
single_value->field_toa256__enabled.log_match(match_value.toa256__enabled(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_meas__valid.match(match_value.meas__valid(), legacy)){
TTCN_Logger::log_logmatch_info(".meas_valid");
single_value->field_meas__valid.log_match(match_value.meas__valid(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_meas__ul.match(match_value.meas__ul(), legacy)){
TTCN_Logger::log_logmatch_info(".meas_ul");
single_value->field_meas__ul.log_match(match_value.meas__ul(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_timing__offset__256syms.match(match_value.timing__offset__256syms(), legacy)){
TTCN_Logger::log_logmatch_info(".timing_offset_256syms");
single_value->field_timing__offset__256syms.log_match(match_value.timing__offset__256syms(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_bs__power__level.match(match_value.bs__power__level(), legacy)){
TTCN_Logger::log_logmatch_info(".bs_power_level");
single_value->field_bs__power__level.log_match(match_value.bs__power__level(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ms__power__level.match(match_value.ms__power__level(), legacy)){
TTCN_Logger::log_logmatch_info(".ms_power_level");
single_value->field_ms__power__level.log_match(match_value.ms__power__level(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ms__actual__ta.match(match_value.ms__actual__ta(), legacy)){
TTCN_Logger::log_logmatch_info(".ms_actual_ta");
single_value->field_ms__actual__ta.log_match(match_value.ms__actual__ta(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_facch__enabled.match(match_value.facch__enabled(), legacy)){
TTCN_Logger::log_logmatch_info(".facch_enabled");
single_value->field_facch__enabled.log_match(match_value.facch__enabled(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ dtx_enabled := ");
single_value->field_dtx__enabled.log_match(match_value.dtx__enabled(), legacy);
TTCN_Logger::log_event_str(", toa256_enabled := ");
single_value->field_toa256__enabled.log_match(match_value.toa256__enabled(), legacy);
TTCN_Logger::log_event_str(", meas_valid := ");
single_value->field_meas__valid.log_match(match_value.meas__valid(), legacy);
TTCN_Logger::log_event_str(", meas_ul := ");
single_value->field_meas__ul.log_match(match_value.meas__ul(), legacy);
TTCN_Logger::log_event_str(", timing_offset_256syms := ");
single_value->field_timing__offset__256syms.log_match(match_value.timing__offset__256syms(), legacy);
TTCN_Logger::log_event_str(", bs_power_level := ");
single_value->field_bs__power__level.log_match(match_value.bs__power__level(), legacy);
TTCN_Logger::log_event_str(", ms_power_level := ");
single_value->field_ms__power__level.log_match(match_value.ms__power__level(), legacy);
TTCN_Logger::log_event_str(", ms_actual_ta := ");
single_value->field_ms__actual__ta.log_match(match_value.ms__actual__ta(), legacy);
TTCN_Logger::log_event_str(", facch_enabled := ");
single_value->field_facch__enabled.log_match(match_value.facch__enabled(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void ConnL1Pars_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (dtx__enabled().is_bound()) dtx__enabled().set_implicit_omit();
if (toa256__enabled().is_bound()) toa256__enabled().set_implicit_omit();
if (meas__valid().is_bound()) meas__valid().set_implicit_omit();
if (meas__ul().is_bound()) meas__ul().set_implicit_omit();
if (timing__offset__256syms().is_bound()) timing__offset__256syms().set_implicit_omit();
if (bs__power__level().is_bound()) bs__power__level().set_implicit_omit();
if (ms__power__level().is_bound()) ms__power__level().set_implicit_omit();
if (ms__actual__ta().is_bound()) ms__actual__ta().set_implicit_omit();
if (facch__enabled().is_bound()) facch__enabled().set_implicit_omit();
}

void ConnL1Pars_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_dtx__enabled.encode_text(text_buf);
single_value->field_toa256__enabled.encode_text(text_buf);
single_value->field_meas__valid.encode_text(text_buf);
single_value->field_meas__ul.encode_text(text_buf);
single_value->field_timing__offset__256syms.encode_text(text_buf);
single_value->field_bs__power__level.encode_text(text_buf);
single_value->field_ms__power__level.encode_text(text_buf);
single_value->field_ms__actual__ta.encode_text(text_buf);
single_value->field_facch__enabled.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BTS_Tests.ConnL1Pars.");
}
}

void ConnL1Pars_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_dtx__enabled.decode_text(text_buf);
single_value->field_toa256__enabled.decode_text(text_buf);
single_value->field_meas__valid.decode_text(text_buf);
single_value->field_meas__ul.decode_text(text_buf);
single_value->field_timing__offset__256syms.decode_text(text_buf);
single_value->field_bs__power__level.decode_text(text_buf);
single_value->field_ms__power__level.decode_text(text_buf);
single_value->field_ms__actual__ta.decode_text(text_buf);
single_value->field_facch__enabled.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new ConnL1Pars_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @BTS_Tests.ConnL1Pars.");
}
}

void ConnL1Pars_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    ConnL1Pars_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (9<param.get_size()) {
      param.error("record template of type @BTS_Tests.ConnL1Pars has 9 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) dtx__enabled().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) toa256__enabled().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) meas__valid().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) meas__ul().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) timing__offset__256syms().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) bs__power__level().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) ms__power__level().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) ms__actual__ta().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) facch__enabled().set_param(*param.get_elem(8));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "dtx_enabled")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          dtx__enabled().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "toa256_enabled")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          toa256__enabled().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "meas_valid")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          meas__valid().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "meas_ul")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          meas__ul().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "timing_offset_256syms")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          timing__offset__256syms().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bs_power_level")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bs__power__level().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ms_power_level")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ms__power__level().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ms_actual_ta")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ms__actual__ta().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "facch_enabled")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          facch__enabled().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BTS_Tests.ConnL1Pars: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    ConnL1Pars_template* precondition = new ConnL1Pars_template;
    precondition->set_param(*param.get_elem(0));
    ConnL1Pars_template* implied_template = new ConnL1Pars_template;
    implied_template->set_param(*param.get_elem(1));
    *this = ConnL1Pars_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BTS_Tests.ConnL1Pars");
  }
  is_ifpresent = param.get_ifpresent();
}

void ConnL1Pars_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_dtx__enabled.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.ConnL1Pars");
single_value->field_toa256__enabled.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.ConnL1Pars");
single_value->field_meas__valid.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.ConnL1Pars");
single_value->field_meas__ul.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.ConnL1Pars");
single_value->field_timing__offset__256syms.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.ConnL1Pars");
single_value->field_bs__power__level.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.ConnL1Pars");
single_value->field_ms__power__level.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.ConnL1Pars");
single_value->field_ms__actual__ta.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.ConnL1Pars");
single_value->field_facch__enabled.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.ConnL1Pars");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@BTS_Tests.ConnL1Pars");
}

boolean ConnL1Pars_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean ConnL1Pars_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

FreqHopPars::FreqHopPars()
{
}

FreqHopPars::FreqHopPars(const BOOLEAN& par_enabled,
    const GSM__RR__Types::MaioHsn& par_maio__hsn,
    const GSM__RR__Types::MobileAllocationLV& par_ma__map,
    const L1CTL__Types::L1ctlMA& par_ma)
  :   field_enabled(par_enabled),
  field_maio__hsn(par_maio__hsn),
  field_ma__map(par_ma__map),
  field_ma(par_ma)
{
}

FreqHopPars::FreqHopPars(const FreqHopPars& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BTS_Tests.FreqHopPars.");
if (other_value.enabled().is_bound()) field_enabled = other_value.enabled();
else field_enabled.clean_up();
if (other_value.maio__hsn().is_bound()) field_maio__hsn = other_value.maio__hsn();
else field_maio__hsn.clean_up();
if (other_value.ma__map().is_bound()) field_ma__map = other_value.ma__map();
else field_ma__map.clean_up();
if (other_value.ma().is_bound()) field_ma = other_value.ma();
else field_ma.clean_up();
}

void FreqHopPars::clean_up()
{
field_enabled.clean_up();
field_maio__hsn.clean_up();
field_ma__map.clean_up();
field_ma.clean_up();
}

const TTCN_Typedescriptor_t* FreqHopPars::get_descriptor() const { return &FreqHopPars_descr_; }
FreqHopPars& FreqHopPars::operator=(const FreqHopPars& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BTS_Tests.FreqHopPars.");
  if (other_value.enabled().is_bound()) field_enabled = other_value.enabled();
  else field_enabled.clean_up();
  if (other_value.maio__hsn().is_bound()) field_maio__hsn = other_value.maio__hsn();
  else field_maio__hsn.clean_up();
  if (other_value.ma__map().is_bound()) field_ma__map = other_value.ma__map();
  else field_ma__map.clean_up();
  if (other_value.ma().is_bound()) field_ma = other_value.ma();
  else field_ma.clean_up();
}
return *this;
}

boolean FreqHopPars::operator==(const FreqHopPars& other_value) const
{
return field_enabled==other_value.field_enabled
  && field_maio__hsn==other_value.field_maio__hsn
  && field_ma__map==other_value.field_ma__map
  && field_ma==other_value.field_ma;
}

boolean FreqHopPars::is_bound() const
{
return (field_enabled.is_bound())
  || (field_maio__hsn.is_bound())
  || (field_ma__map.is_bound())
  || (field_ma.is_bound());
}
boolean FreqHopPars::is_value() const
{
return field_enabled.is_value()
  && field_maio__hsn.is_value()
  && field_ma__map.is_value()
  && field_ma.is_value();
}
void FreqHopPars::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ enabled := ");
field_enabled.log();
TTCN_Logger::log_event_str(", maio_hsn := ");
field_maio__hsn.log();
TTCN_Logger::log_event_str(", ma_map := ");
field_ma__map.log();
TTCN_Logger::log_event_str(", ma := ");
field_ma.log();
TTCN_Logger::log_event_str(" }");
}

void FreqHopPars::set_implicit_omit()
{
if (enabled().is_bound()) enabled().set_implicit_omit();
if (maio__hsn().is_bound()) maio__hsn().set_implicit_omit();
if (ma__map().is_bound()) ma__map().set_implicit_omit();
if (ma().is_bound()) ma().set_implicit_omit();
}

void FreqHopPars::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("record value of type @BTS_Tests.FreqHopPars has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) enabled().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) maio__hsn().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) ma__map().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) ma().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "enabled")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          enabled().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "maio_hsn")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          maio__hsn().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ma_map")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ma__map().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ma")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ma().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BTS_Tests.FreqHopPars: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BTS_Tests.FreqHopPars");
  }
}

void FreqHopPars::encode_text(Text_Buf& text_buf) const
{
field_enabled.encode_text(text_buf);
field_maio__hsn.encode_text(text_buf);
field_ma__map.encode_text(text_buf);
field_ma.encode_text(text_buf);
}

void FreqHopPars::decode_text(Text_Buf& text_buf)
{
field_enabled.decode_text(text_buf);
field_maio__hsn.decode_text(text_buf);
field_ma__map.decode_text(text_buf);
field_ma.decode_text(text_buf);
}

struct FreqHopPars_template::single_value_struct {
BOOLEAN_template field_enabled;
GSM__RR__Types::MaioHsn_template field_maio__hsn;
GSM__RR__Types::MobileAllocationLV_template field_ma__map;
L1CTL__Types::L1ctlMA_template field_ma;
};

void FreqHopPars_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_enabled = ANY_VALUE;
single_value->field_maio__hsn = ANY_VALUE;
single_value->field_ma__map = ANY_VALUE;
single_value->field_ma = ANY_VALUE;
}
}
}

void FreqHopPars_template::copy_value(const FreqHopPars& other_value)
{
single_value = new single_value_struct;
if (other_value.enabled().is_bound()) {
  single_value->field_enabled = other_value.enabled();
} else {
  single_value->field_enabled.clean_up();
}
if (other_value.maio__hsn().is_bound()) {
  single_value->field_maio__hsn = other_value.maio__hsn();
} else {
  single_value->field_maio__hsn.clean_up();
}
if (other_value.ma__map().is_bound()) {
  single_value->field_ma__map = other_value.ma__map();
} else {
  single_value->field_ma__map.clean_up();
}
if (other_value.ma().is_bound()) {
  single_value->field_ma = other_value.ma();
} else {
  single_value->field_ma.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void FreqHopPars_template::copy_template(const FreqHopPars_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.enabled().get_selection()) {
single_value->field_enabled = other_value.enabled();
} else {
single_value->field_enabled.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.maio__hsn().get_selection()) {
single_value->field_maio__hsn = other_value.maio__hsn();
} else {
single_value->field_maio__hsn.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ma__map().get_selection()) {
single_value->field_ma__map = other_value.ma__map();
} else {
single_value->field_ma__map.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ma().get_selection()) {
single_value->field_ma = other_value.ma();
} else {
single_value->field_ma.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new FreqHopPars_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new FreqHopPars_template(*other_value.implication_.precondition);
implication_.implied_template = new FreqHopPars_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BTS_Tests.FreqHopPars.");
break;
}
set_selection(other_value);
}

FreqHopPars_template::FreqHopPars_template()
{
}

FreqHopPars_template::FreqHopPars_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

FreqHopPars_template::FreqHopPars_template(const FreqHopPars& other_value)
{
copy_value(other_value);
}

FreqHopPars_template::FreqHopPars_template(const OPTIONAL<FreqHopPars>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const FreqHopPars&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BTS_Tests.FreqHopPars from an unbound optional field.");
}
}

FreqHopPars_template::FreqHopPars_template(FreqHopPars_template* p_precondition, FreqHopPars_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

FreqHopPars_template::FreqHopPars_template(Dynamic_Match_Interface<FreqHopPars>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<FreqHopPars>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

FreqHopPars_template::FreqHopPars_template(const FreqHopPars_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

FreqHopPars_template::~FreqHopPars_template()
{
clean_up();
}

FreqHopPars_template& FreqHopPars_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

FreqHopPars_template& FreqHopPars_template::operator=(const FreqHopPars& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

FreqHopPars_template& FreqHopPars_template::operator=(const OPTIONAL<FreqHopPars>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const FreqHopPars&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @BTS_Tests.FreqHopPars.");
}
return *this;
}

FreqHopPars_template& FreqHopPars_template::operator=(const FreqHopPars_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean FreqHopPars_template::match(const FreqHopPars& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.enabled().is_bound()) return FALSE;
if(!single_value->field_enabled.match(other_value.enabled(), legacy))return FALSE;
if(!other_value.maio__hsn().is_bound()) return FALSE;
if(!single_value->field_maio__hsn.match(other_value.maio__hsn(), legacy))return FALSE;
if(!other_value.ma__map().is_bound()) return FALSE;
if(!single_value->field_ma__map.match(other_value.ma__map(), legacy))return FALSE;
if(!other_value.ma().is_bound()) return FALSE;
if(!single_value->field_ma.match(other_value.ma(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BTS_Tests.FreqHopPars.");
}
return FALSE;
}

boolean FreqHopPars_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_enabled.is_bound()
 || single_value->field_maio__hsn.is_bound()
 || single_value->field_ma__map.is_bound()
 || single_value->field_ma.is_bound();
}

boolean FreqHopPars_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_enabled.is_value()
 && single_value->field_maio__hsn.is_value()
 && single_value->field_ma__map.is_value()
 && single_value->field_ma.is_value();
}

void FreqHopPars_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

FreqHopPars FreqHopPars_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BTS_Tests.FreqHopPars.");
FreqHopPars ret_val;
if (single_value->field_enabled.is_bound()) {
ret_val.enabled() = single_value->field_enabled.valueof();
}
if (single_value->field_maio__hsn.is_bound()) {
ret_val.maio__hsn() = single_value->field_maio__hsn.valueof();
}
if (single_value->field_ma__map.is_bound()) {
ret_val.ma__map() = single_value->field_ma__map.valueof();
}
if (single_value->field_ma.is_bound()) {
ret_val.ma() = single_value->field_ma.valueof();
}
return ret_val;
}

void FreqHopPars_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @BTS_Tests.FreqHopPars.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new FreqHopPars_template[list_length];
}

FreqHopPars_template& FreqHopPars_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @BTS_Tests.FreqHopPars.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BTS_Tests.FreqHopPars.");
return value_list.list_value[list_index];
}

BOOLEAN_template& FreqHopPars_template::enabled()
{
set_specific();
return single_value->field_enabled;
}

const BOOLEAN_template& FreqHopPars_template::enabled() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field enabled of a non-specific template of type @BTS_Tests.FreqHopPars.");
return single_value->field_enabled;
}

GSM__RR__Types::MaioHsn_template& FreqHopPars_template::maio__hsn()
{
set_specific();
return single_value->field_maio__hsn;
}

const GSM__RR__Types::MaioHsn_template& FreqHopPars_template::maio__hsn() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field maio_hsn of a non-specific template of type @BTS_Tests.FreqHopPars.");
return single_value->field_maio__hsn;
}

GSM__RR__Types::MobileAllocationLV_template& FreqHopPars_template::ma__map()
{
set_specific();
return single_value->field_ma__map;
}

const GSM__RR__Types::MobileAllocationLV_template& FreqHopPars_template::ma__map() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ma_map of a non-specific template of type @BTS_Tests.FreqHopPars.");
return single_value->field_ma__map;
}

L1CTL__Types::L1ctlMA_template& FreqHopPars_template::ma()
{
set_specific();
return single_value->field_ma;
}

const L1CTL__Types::L1ctlMA_template& FreqHopPars_template::ma() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ma of a non-specific template of type @BTS_Tests.FreqHopPars.");
return single_value->field_ma;
}

int FreqHopPars_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.FreqHopPars which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 4;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @BTS_Tests.FreqHopPars containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.FreqHopPars containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.FreqHopPars containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.FreqHopPars containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.FreqHopPars containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.FreqHopPars containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.FreqHopPars containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.FreqHopPars containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BTS_Tests.FreqHopPars.");
  }
  return 0;
}

void FreqHopPars_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ enabled := ");
single_value->field_enabled.log();
TTCN_Logger::log_event_str(", maio_hsn := ");
single_value->field_maio__hsn.log();
TTCN_Logger::log_event_str(", ma_map := ");
single_value->field_ma__map.log();
TTCN_Logger::log_event_str(", ma := ");
single_value->field_ma.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void FreqHopPars_template::log_match(const FreqHopPars& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_enabled.match(match_value.enabled(), legacy)){
TTCN_Logger::log_logmatch_info(".enabled");
single_value->field_enabled.log_match(match_value.enabled(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_maio__hsn.match(match_value.maio__hsn(), legacy)){
TTCN_Logger::log_logmatch_info(".maio_hsn");
single_value->field_maio__hsn.log_match(match_value.maio__hsn(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ma__map.match(match_value.ma__map(), legacy)){
TTCN_Logger::log_logmatch_info(".ma_map");
single_value->field_ma__map.log_match(match_value.ma__map(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ma.match(match_value.ma(), legacy)){
TTCN_Logger::log_logmatch_info(".ma");
single_value->field_ma.log_match(match_value.ma(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ enabled := ");
single_value->field_enabled.log_match(match_value.enabled(), legacy);
TTCN_Logger::log_event_str(", maio_hsn := ");
single_value->field_maio__hsn.log_match(match_value.maio__hsn(), legacy);
TTCN_Logger::log_event_str(", ma_map := ");
single_value->field_ma__map.log_match(match_value.ma__map(), legacy);
TTCN_Logger::log_event_str(", ma := ");
single_value->field_ma.log_match(match_value.ma(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void FreqHopPars_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (enabled().is_bound()) enabled().set_implicit_omit();
if (maio__hsn().is_bound()) maio__hsn().set_implicit_omit();
if (ma__map().is_bound()) ma__map().set_implicit_omit();
if (ma().is_bound()) ma().set_implicit_omit();
}

void FreqHopPars_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_enabled.encode_text(text_buf);
single_value->field_maio__hsn.encode_text(text_buf);
single_value->field_ma__map.encode_text(text_buf);
single_value->field_ma.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BTS_Tests.FreqHopPars.");
}
}

void FreqHopPars_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_enabled.decode_text(text_buf);
single_value->field_maio__hsn.decode_text(text_buf);
single_value->field_ma__map.decode_text(text_buf);
single_value->field_ma.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new FreqHopPars_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @BTS_Tests.FreqHopPars.");
}
}

void FreqHopPars_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    FreqHopPars_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (4<param.get_size()) {
      param.error("record template of type @BTS_Tests.FreqHopPars has 4 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) enabled().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) maio__hsn().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) ma__map().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) ma().set_param(*param.get_elem(3));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "enabled")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          enabled().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "maio_hsn")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          maio__hsn().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ma_map")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ma__map().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ma")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ma().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BTS_Tests.FreqHopPars: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    FreqHopPars_template* precondition = new FreqHopPars_template;
    precondition->set_param(*param.get_elem(0));
    FreqHopPars_template* implied_template = new FreqHopPars_template;
    implied_template->set_param(*param.get_elem(1));
    *this = FreqHopPars_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BTS_Tests.FreqHopPars");
  }
  is_ifpresent = param.get_ifpresent();
}

void FreqHopPars_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_enabled.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.FreqHopPars");
single_value->field_maio__hsn.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.FreqHopPars");
single_value->field_ma__map.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.FreqHopPars");
single_value->field_ma.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.FreqHopPars");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@BTS_Tests.FreqHopPars");
}

boolean FreqHopPars_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean FreqHopPars_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

ConnHdlrPars::ConnHdlrPars()
{
}

ConnHdlrPars::ConnHdlrPars(const INTEGER& par_trx__nr,
    const GSM__Types::RslChannelNr& par_chan__nr,
    const RSL__Types::RSL__IE__ChannelMode& par_chan__mode,
    const OPTIONAL< RSL__Types::RSL__IE__MultirateCfg >& par_mr__conf,
    const FLOAT& par_t__guard,
    const ConnL1Pars& par_l1__pars,
    const OPTIONAL< TestSpecUnion >& par_spec,
    const OPTIONAL< RSL__Types::RSL__IE__EncryptionInfo >& par_encr,
    const OPTIONAL< CHARSTRING >& par_bts0__band,
    const INTEGER& par_tsc,
    const FreqHopPars& par_fhp,
    const INTEGER& par_loc__osmux__cid,
    const OPTIONAL< INTEGER >& par_rem__osmux__cid)
  :   field_trx__nr(par_trx__nr),
  field_chan__nr(par_chan__nr),
  field_chan__mode(par_chan__mode),
  field_mr__conf(par_mr__conf),
  field_t__guard(par_t__guard),
  field_l1__pars(par_l1__pars),
  field_spec(par_spec),
  field_encr(par_encr),
  field_bts0__band(par_bts0__band),
  field_tsc(par_tsc),
  field_fhp(par_fhp),
  field_loc__osmux__cid(par_loc__osmux__cid),
  field_rem__osmux__cid(par_rem__osmux__cid)
{
}

ConnHdlrPars::ConnHdlrPars(const ConnHdlrPars& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BTS_Tests.ConnHdlrPars.");
if (other_value.trx__nr().is_bound()) field_trx__nr = other_value.trx__nr();
else field_trx__nr.clean_up();
if (other_value.chan__nr().is_bound()) field_chan__nr = other_value.chan__nr();
else field_chan__nr.clean_up();
if (other_value.chan__mode().is_bound()) field_chan__mode = other_value.chan__mode();
else field_chan__mode.clean_up();
if (other_value.mr__conf().is_bound()) field_mr__conf = other_value.mr__conf();
else field_mr__conf.clean_up();
if (other_value.t__guard().is_bound()) field_t__guard = other_value.t__guard();
else field_t__guard.clean_up();
if (other_value.l1__pars().is_bound()) field_l1__pars = other_value.l1__pars();
else field_l1__pars.clean_up();
if (other_value.spec().is_bound()) field_spec = other_value.spec();
else field_spec.clean_up();
if (other_value.encr().is_bound()) field_encr = other_value.encr();
else field_encr.clean_up();
if (other_value.bts0__band().is_bound()) field_bts0__band = other_value.bts0__band();
else field_bts0__band.clean_up();
if (other_value.tsc().is_bound()) field_tsc = other_value.tsc();
else field_tsc.clean_up();
if (other_value.fhp().is_bound()) field_fhp = other_value.fhp();
else field_fhp.clean_up();
if (other_value.loc__osmux__cid().is_bound()) field_loc__osmux__cid = other_value.loc__osmux__cid();
else field_loc__osmux__cid.clean_up();
if (other_value.rem__osmux__cid().is_bound()) field_rem__osmux__cid = other_value.rem__osmux__cid();
else field_rem__osmux__cid.clean_up();
}

void ConnHdlrPars::clean_up()
{
field_trx__nr.clean_up();
field_chan__nr.clean_up();
field_chan__mode.clean_up();
field_mr__conf.clean_up();
field_t__guard.clean_up();
field_l1__pars.clean_up();
field_spec.clean_up();
field_encr.clean_up();
field_bts0__band.clean_up();
field_tsc.clean_up();
field_fhp.clean_up();
field_loc__osmux__cid.clean_up();
field_rem__osmux__cid.clean_up();
}

const TTCN_Typedescriptor_t* ConnHdlrPars::get_descriptor() const { return &ConnHdlrPars_descr_; }
ConnHdlrPars& ConnHdlrPars::operator=(const ConnHdlrPars& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BTS_Tests.ConnHdlrPars.");
  if (other_value.trx__nr().is_bound()) field_trx__nr = other_value.trx__nr();
  else field_trx__nr.clean_up();
  if (other_value.chan__nr().is_bound()) field_chan__nr = other_value.chan__nr();
  else field_chan__nr.clean_up();
  if (other_value.chan__mode().is_bound()) field_chan__mode = other_value.chan__mode();
  else field_chan__mode.clean_up();
  if (other_value.mr__conf().is_bound()) field_mr__conf = other_value.mr__conf();
  else field_mr__conf.clean_up();
  if (other_value.t__guard().is_bound()) field_t__guard = other_value.t__guard();
  else field_t__guard.clean_up();
  if (other_value.l1__pars().is_bound()) field_l1__pars = other_value.l1__pars();
  else field_l1__pars.clean_up();
  if (other_value.spec().is_bound()) field_spec = other_value.spec();
  else field_spec.clean_up();
  if (other_value.encr().is_bound()) field_encr = other_value.encr();
  else field_encr.clean_up();
  if (other_value.bts0__band().is_bound()) field_bts0__band = other_value.bts0__band();
  else field_bts0__band.clean_up();
  if (other_value.tsc().is_bound()) field_tsc = other_value.tsc();
  else field_tsc.clean_up();
  if (other_value.fhp().is_bound()) field_fhp = other_value.fhp();
  else field_fhp.clean_up();
  if (other_value.loc__osmux__cid().is_bound()) field_loc__osmux__cid = other_value.loc__osmux__cid();
  else field_loc__osmux__cid.clean_up();
  if (other_value.rem__osmux__cid().is_bound()) field_rem__osmux__cid = other_value.rem__osmux__cid();
  else field_rem__osmux__cid.clean_up();
}
return *this;
}

boolean ConnHdlrPars::operator==(const ConnHdlrPars& other_value) const
{
return field_trx__nr==other_value.field_trx__nr
  && field_chan__nr==other_value.field_chan__nr
  && field_chan__mode==other_value.field_chan__mode
  && field_mr__conf==other_value.field_mr__conf
  && field_t__guard==other_value.field_t__guard
  && field_l1__pars==other_value.field_l1__pars
  && field_spec==other_value.field_spec
  && field_encr==other_value.field_encr
  && field_bts0__band==other_value.field_bts0__band
  && field_tsc==other_value.field_tsc
  && field_fhp==other_value.field_fhp
  && field_loc__osmux__cid==other_value.field_loc__osmux__cid
  && field_rem__osmux__cid==other_value.field_rem__osmux__cid;
}

boolean ConnHdlrPars::is_bound() const
{
return (field_trx__nr.is_bound())
  || (field_chan__nr.is_bound())
  || (field_chan__mode.is_bound())
  || (OPTIONAL_OMIT == field_mr__conf.get_selection() || field_mr__conf.is_bound())
  || (field_t__guard.is_bound())
  || (field_l1__pars.is_bound())
  || (OPTIONAL_OMIT == field_spec.get_selection() || field_spec.is_bound())
  || (OPTIONAL_OMIT == field_encr.get_selection() || field_encr.is_bound())
  || (OPTIONAL_OMIT == field_bts0__band.get_selection() || field_bts0__band.is_bound())
  || (field_tsc.is_bound())
  || (field_fhp.is_bound())
  || (field_loc__osmux__cid.is_bound())
  || (OPTIONAL_OMIT == field_rem__osmux__cid.get_selection() || field_rem__osmux__cid.is_bound());
}
boolean ConnHdlrPars::is_value() const
{
return field_trx__nr.is_value()
  && field_chan__nr.is_value()
  && field_chan__mode.is_value()
  && (OPTIONAL_OMIT == field_mr__conf.get_selection() || field_mr__conf.is_value())
  && field_t__guard.is_value()
  && field_l1__pars.is_value()
  && (OPTIONAL_OMIT == field_spec.get_selection() || field_spec.is_value())
  && (OPTIONAL_OMIT == field_encr.get_selection() || field_encr.is_value())
  && (OPTIONAL_OMIT == field_bts0__band.get_selection() || field_bts0__band.is_value())
  && field_tsc.is_value()
  && field_fhp.is_value()
  && field_loc__osmux__cid.is_value()
  && (OPTIONAL_OMIT == field_rem__osmux__cid.get_selection() || field_rem__osmux__cid.is_value());
}
int ConnHdlrPars::size_of() const
{
  int ret_val = 8;
  if (field_mr__conf.ispresent()) ret_val++;
  if (field_spec.ispresent()) ret_val++;
  if (field_encr.ispresent()) ret_val++;
  if (field_bts0__band.ispresent()) ret_val++;
  if (field_rem__osmux__cid.ispresent()) ret_val++;
  return ret_val;
}

void ConnHdlrPars::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ trx_nr := ");
field_trx__nr.log();
TTCN_Logger::log_event_str(", chan_nr := ");
field_chan__nr.log();
TTCN_Logger::log_event_str(", chan_mode := ");
field_chan__mode.log();
TTCN_Logger::log_event_str(", mr_conf := ");
field_mr__conf.log();
TTCN_Logger::log_event_str(", t_guard := ");
field_t__guard.log();
TTCN_Logger::log_event_str(", l1_pars := ");
field_l1__pars.log();
TTCN_Logger::log_event_str(", spec := ");
field_spec.log();
TTCN_Logger::log_event_str(", encr := ");
field_encr.log();
TTCN_Logger::log_event_str(", bts0_band := ");
field_bts0__band.log();
TTCN_Logger::log_event_str(", tsc := ");
field_tsc.log();
TTCN_Logger::log_event_str(", fhp := ");
field_fhp.log();
TTCN_Logger::log_event_str(", loc_osmux_cid := ");
field_loc__osmux__cid.log();
TTCN_Logger::log_event_str(", rem_osmux_cid := ");
field_rem__osmux__cid.log();
TTCN_Logger::log_event_str(" }");
}

void ConnHdlrPars::set_implicit_omit()
{
if (trx__nr().is_bound()) trx__nr().set_implicit_omit();
if (chan__nr().is_bound()) chan__nr().set_implicit_omit();
if (chan__mode().is_bound()) chan__mode().set_implicit_omit();
if (!mr__conf().is_bound()) mr__conf() = OMIT_VALUE;
else mr__conf().set_implicit_omit();
if (t__guard().is_bound()) t__guard().set_implicit_omit();
if (l1__pars().is_bound()) l1__pars().set_implicit_omit();
if (!spec().is_bound()) spec() = OMIT_VALUE;
else spec().set_implicit_omit();
if (!encr().is_bound()) encr() = OMIT_VALUE;
else encr().set_implicit_omit();
if (!bts0__band().is_bound()) bts0__band() = OMIT_VALUE;
else bts0__band().set_implicit_omit();
if (tsc().is_bound()) tsc().set_implicit_omit();
if (fhp().is_bound()) fhp().set_implicit_omit();
if (loc__osmux__cid().is_bound()) loc__osmux__cid().set_implicit_omit();
if (!rem__osmux__cid().is_bound()) rem__osmux__cid() = OMIT_VALUE;
else rem__osmux__cid().set_implicit_omit();
}

void ConnHdlrPars::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (13<param.get_size()) {
      param.error("record value of type @BTS_Tests.ConnHdlrPars has 13 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) trx__nr().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) chan__nr().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) chan__mode().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mr__conf().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) t__guard().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) l1__pars().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) spec().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) encr().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) bts0__band().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) tsc().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) fhp().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) loc__osmux__cid().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) rem__osmux__cid().set_param(*param.get_elem(12));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "trx_nr")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          trx__nr().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "chan_nr")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          chan__nr().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "chan_mode")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          chan__mode().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mr_conf")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mr__conf().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t_guard")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t__guard().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "l1_pars")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          l1__pars().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spec")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spec().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "encr")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          encr().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bts0_band")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bts0__band().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tsc")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tsc().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "fhp")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          fhp().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "loc_osmux_cid")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          loc__osmux__cid().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rem_osmux_cid")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rem__osmux__cid().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BTS_Tests.ConnHdlrPars: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BTS_Tests.ConnHdlrPars");
  }
}

void ConnHdlrPars::encode_text(Text_Buf& text_buf) const
{
field_trx__nr.encode_text(text_buf);
field_chan__nr.encode_text(text_buf);
field_chan__mode.encode_text(text_buf);
field_mr__conf.encode_text(text_buf);
field_t__guard.encode_text(text_buf);
field_l1__pars.encode_text(text_buf);
field_spec.encode_text(text_buf);
field_encr.encode_text(text_buf);
field_bts0__band.encode_text(text_buf);
field_tsc.encode_text(text_buf);
field_fhp.encode_text(text_buf);
field_loc__osmux__cid.encode_text(text_buf);
field_rem__osmux__cid.encode_text(text_buf);
}

void ConnHdlrPars::decode_text(Text_Buf& text_buf)
{
field_trx__nr.decode_text(text_buf);
field_chan__nr.decode_text(text_buf);
field_chan__mode.decode_text(text_buf);
field_mr__conf.decode_text(text_buf);
field_t__guard.decode_text(text_buf);
field_l1__pars.decode_text(text_buf);
field_spec.decode_text(text_buf);
field_encr.decode_text(text_buf);
field_bts0__band.decode_text(text_buf);
field_tsc.decode_text(text_buf);
field_fhp.decode_text(text_buf);
field_loc__osmux__cid.decode_text(text_buf);
field_rem__osmux__cid.decode_text(text_buf);
}

struct ConnHdlrPars_template::single_value_struct {
INTEGER_template field_trx__nr;
GSM__Types::RslChannelNr_template field_chan__nr;
RSL__Types::RSL__IE__ChannelMode_template field_chan__mode;
RSL__Types::RSL__IE__MultirateCfg_template field_mr__conf;
FLOAT_template field_t__guard;
ConnL1Pars_template field_l1__pars;
TestSpecUnion_template field_spec;
RSL__Types::RSL__IE__EncryptionInfo_template field_encr;
CHARSTRING_template field_bts0__band;
INTEGER_template field_tsc;
FreqHopPars_template field_fhp;
INTEGER_template field_loc__osmux__cid;
INTEGER_template field_rem__osmux__cid;
};

void ConnHdlrPars_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_trx__nr = ANY_VALUE;
single_value->field_chan__nr = ANY_VALUE;
single_value->field_chan__mode = ANY_VALUE;
single_value->field_mr__conf = ANY_OR_OMIT;
single_value->field_t__guard = ANY_VALUE;
single_value->field_l1__pars = ANY_VALUE;
single_value->field_spec = ANY_OR_OMIT;
single_value->field_encr = ANY_OR_OMIT;
single_value->field_bts0__band = ANY_OR_OMIT;
single_value->field_tsc = ANY_VALUE;
single_value->field_fhp = ANY_VALUE;
single_value->field_loc__osmux__cid = ANY_VALUE;
single_value->field_rem__osmux__cid = ANY_OR_OMIT;
}
}
}

void ConnHdlrPars_template::copy_value(const ConnHdlrPars& other_value)
{
single_value = new single_value_struct;
if (other_value.trx__nr().is_bound()) {
  single_value->field_trx__nr = other_value.trx__nr();
} else {
  single_value->field_trx__nr.clean_up();
}
if (other_value.chan__nr().is_bound()) {
  single_value->field_chan__nr = other_value.chan__nr();
} else {
  single_value->field_chan__nr.clean_up();
}
if (other_value.chan__mode().is_bound()) {
  single_value->field_chan__mode = other_value.chan__mode();
} else {
  single_value->field_chan__mode.clean_up();
}
if (other_value.mr__conf().is_bound()) {
  if (other_value.mr__conf().ispresent()) single_value->field_mr__conf = other_value.mr__conf()();
  else single_value->field_mr__conf = OMIT_VALUE;
} else {
  single_value->field_mr__conf.clean_up();
}
if (other_value.t__guard().is_bound()) {
  single_value->field_t__guard = other_value.t__guard();
} else {
  single_value->field_t__guard.clean_up();
}
if (other_value.l1__pars().is_bound()) {
  single_value->field_l1__pars = other_value.l1__pars();
} else {
  single_value->field_l1__pars.clean_up();
}
if (other_value.spec().is_bound()) {
  if (other_value.spec().ispresent()) single_value->field_spec = other_value.spec()();
  else single_value->field_spec = OMIT_VALUE;
} else {
  single_value->field_spec.clean_up();
}
if (other_value.encr().is_bound()) {
  if (other_value.encr().ispresent()) single_value->field_encr = other_value.encr()();
  else single_value->field_encr = OMIT_VALUE;
} else {
  single_value->field_encr.clean_up();
}
if (other_value.bts0__band().is_bound()) {
  if (other_value.bts0__band().ispresent()) single_value->field_bts0__band = other_value.bts0__band()();
  else single_value->field_bts0__band = OMIT_VALUE;
} else {
  single_value->field_bts0__band.clean_up();
}
if (other_value.tsc().is_bound()) {
  single_value->field_tsc = other_value.tsc();
} else {
  single_value->field_tsc.clean_up();
}
if (other_value.fhp().is_bound()) {
  single_value->field_fhp = other_value.fhp();
} else {
  single_value->field_fhp.clean_up();
}
if (other_value.loc__osmux__cid().is_bound()) {
  single_value->field_loc__osmux__cid = other_value.loc__osmux__cid();
} else {
  single_value->field_loc__osmux__cid.clean_up();
}
if (other_value.rem__osmux__cid().is_bound()) {
  if (other_value.rem__osmux__cid().ispresent()) single_value->field_rem__osmux__cid = other_value.rem__osmux__cid()();
  else single_value->field_rem__osmux__cid = OMIT_VALUE;
} else {
  single_value->field_rem__osmux__cid.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void ConnHdlrPars_template::copy_template(const ConnHdlrPars_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.trx__nr().get_selection()) {
single_value->field_trx__nr = other_value.trx__nr();
} else {
single_value->field_trx__nr.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.chan__nr().get_selection()) {
single_value->field_chan__nr = other_value.chan__nr();
} else {
single_value->field_chan__nr.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.chan__mode().get_selection()) {
single_value->field_chan__mode = other_value.chan__mode();
} else {
single_value->field_chan__mode.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.mr__conf().get_selection()) {
single_value->field_mr__conf = other_value.mr__conf();
} else {
single_value->field_mr__conf.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.t__guard().get_selection()) {
single_value->field_t__guard = other_value.t__guard();
} else {
single_value->field_t__guard.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.l1__pars().get_selection()) {
single_value->field_l1__pars = other_value.l1__pars();
} else {
single_value->field_l1__pars.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.spec().get_selection()) {
single_value->field_spec = other_value.spec();
} else {
single_value->field_spec.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.encr().get_selection()) {
single_value->field_encr = other_value.encr();
} else {
single_value->field_encr.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.bts0__band().get_selection()) {
single_value->field_bts0__band = other_value.bts0__band();
} else {
single_value->field_bts0__band.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tsc().get_selection()) {
single_value->field_tsc = other_value.tsc();
} else {
single_value->field_tsc.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.fhp().get_selection()) {
single_value->field_fhp = other_value.fhp();
} else {
single_value->field_fhp.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.loc__osmux__cid().get_selection()) {
single_value->field_loc__osmux__cid = other_value.loc__osmux__cid();
} else {
single_value->field_loc__osmux__cid.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.rem__osmux__cid().get_selection()) {
single_value->field_rem__osmux__cid = other_value.rem__osmux__cid();
} else {
single_value->field_rem__osmux__cid.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new ConnHdlrPars_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new ConnHdlrPars_template(*other_value.implication_.precondition);
implication_.implied_template = new ConnHdlrPars_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BTS_Tests.ConnHdlrPars.");
break;
}
set_selection(other_value);
}

ConnHdlrPars_template::ConnHdlrPars_template()
{
}

ConnHdlrPars_template::ConnHdlrPars_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

ConnHdlrPars_template::ConnHdlrPars_template(const ConnHdlrPars& other_value)
{
copy_value(other_value);
}

ConnHdlrPars_template::ConnHdlrPars_template(const OPTIONAL<ConnHdlrPars>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const ConnHdlrPars&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BTS_Tests.ConnHdlrPars from an unbound optional field.");
}
}

ConnHdlrPars_template::ConnHdlrPars_template(ConnHdlrPars_template* p_precondition, ConnHdlrPars_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

ConnHdlrPars_template::ConnHdlrPars_template(Dynamic_Match_Interface<ConnHdlrPars>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<ConnHdlrPars>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

ConnHdlrPars_template::ConnHdlrPars_template(const ConnHdlrPars_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

ConnHdlrPars_template::~ConnHdlrPars_template()
{
clean_up();
}

ConnHdlrPars_template& ConnHdlrPars_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

ConnHdlrPars_template& ConnHdlrPars_template::operator=(const ConnHdlrPars& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

ConnHdlrPars_template& ConnHdlrPars_template::operator=(const OPTIONAL<ConnHdlrPars>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const ConnHdlrPars&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @BTS_Tests.ConnHdlrPars.");
}
return *this;
}

ConnHdlrPars_template& ConnHdlrPars_template::operator=(const ConnHdlrPars_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean ConnHdlrPars_template::match(const ConnHdlrPars& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.trx__nr().is_bound()) return FALSE;
if(!single_value->field_trx__nr.match(other_value.trx__nr(), legacy))return FALSE;
if(!other_value.chan__nr().is_bound()) return FALSE;
if(!single_value->field_chan__nr.match(other_value.chan__nr(), legacy))return FALSE;
if(!other_value.chan__mode().is_bound()) return FALSE;
if(!single_value->field_chan__mode.match(other_value.chan__mode(), legacy))return FALSE;
if(!other_value.mr__conf().is_bound()) return FALSE;
if((other_value.mr__conf().ispresent() ? !single_value->field_mr__conf.match((const RSL__Types::RSL__IE__MultirateCfg&)other_value.mr__conf(), legacy) : !single_value->field_mr__conf.match_omit(legacy)))return FALSE;
if(!other_value.t__guard().is_bound()) return FALSE;
if(!single_value->field_t__guard.match(other_value.t__guard(), legacy))return FALSE;
if(!other_value.l1__pars().is_bound()) return FALSE;
if(!single_value->field_l1__pars.match(other_value.l1__pars(), legacy))return FALSE;
if(!other_value.spec().is_bound()) return FALSE;
if((other_value.spec().ispresent() ? !single_value->field_spec.match((const TestSpecUnion&)other_value.spec(), legacy) : !single_value->field_spec.match_omit(legacy)))return FALSE;
if(!other_value.encr().is_bound()) return FALSE;
if((other_value.encr().ispresent() ? !single_value->field_encr.match((const RSL__Types::RSL__IE__EncryptionInfo&)other_value.encr(), legacy) : !single_value->field_encr.match_omit(legacy)))return FALSE;
if(!other_value.bts0__band().is_bound()) return FALSE;
if((other_value.bts0__band().ispresent() ? !single_value->field_bts0__band.match((const CHARSTRING&)other_value.bts0__band(), legacy) : !single_value->field_bts0__band.match_omit(legacy)))return FALSE;
if(!other_value.tsc().is_bound()) return FALSE;
if(!single_value->field_tsc.match(other_value.tsc(), legacy))return FALSE;
if(!other_value.fhp().is_bound()) return FALSE;
if(!single_value->field_fhp.match(other_value.fhp(), legacy))return FALSE;
if(!other_value.loc__osmux__cid().is_bound()) return FALSE;
if(!single_value->field_loc__osmux__cid.match(other_value.loc__osmux__cid(), legacy))return FALSE;
if(!other_value.rem__osmux__cid().is_bound()) return FALSE;
if((other_value.rem__osmux__cid().ispresent() ? !single_value->field_rem__osmux__cid.match((const INTEGER&)other_value.rem__osmux__cid(), legacy) : !single_value->field_rem__osmux__cid.match_omit(legacy)))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BTS_Tests.ConnHdlrPars.");
}
return FALSE;
}

boolean ConnHdlrPars_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_trx__nr.is_bound()
 || single_value->field_chan__nr.is_bound()
 || single_value->field_chan__mode.is_bound()
 || (single_value->field_mr__conf.is_omit() || single_value->field_mr__conf.is_bound())
 || single_value->field_t__guard.is_bound()
 || single_value->field_l1__pars.is_bound()
 || (single_value->field_spec.is_omit() || single_value->field_spec.is_bound())
 || (single_value->field_encr.is_omit() || single_value->field_encr.is_bound())
 || (single_value->field_bts0__band.is_omit() || single_value->field_bts0__band.is_bound())
 || single_value->field_tsc.is_bound()
 || single_value->field_fhp.is_bound()
 || single_value->field_loc__osmux__cid.is_bound()
 || (single_value->field_rem__osmux__cid.is_omit() || single_value->field_rem__osmux__cid.is_bound());
}

boolean ConnHdlrPars_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_trx__nr.is_value()
 && single_value->field_chan__nr.is_value()
 && single_value->field_chan__mode.is_value()
 && (single_value->field_mr__conf.is_omit() || single_value->field_mr__conf.is_value())
 && single_value->field_t__guard.is_value()
 && single_value->field_l1__pars.is_value()
 && (single_value->field_spec.is_omit() || single_value->field_spec.is_value())
 && (single_value->field_encr.is_omit() || single_value->field_encr.is_value())
 && (single_value->field_bts0__band.is_omit() || single_value->field_bts0__band.is_value())
 && single_value->field_tsc.is_value()
 && single_value->field_fhp.is_value()
 && single_value->field_loc__osmux__cid.is_value()
 && (single_value->field_rem__osmux__cid.is_omit() || single_value->field_rem__osmux__cid.is_value());
}

void ConnHdlrPars_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

ConnHdlrPars ConnHdlrPars_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BTS_Tests.ConnHdlrPars.");
ConnHdlrPars ret_val;
if (single_value->field_trx__nr.is_bound()) {
ret_val.trx__nr() = single_value->field_trx__nr.valueof();
}
if (single_value->field_chan__nr.is_bound()) {
ret_val.chan__nr() = single_value->field_chan__nr.valueof();
}
if (single_value->field_chan__mode.is_bound()) {
ret_val.chan__mode() = single_value->field_chan__mode.valueof();
}
if (single_value->field_mr__conf.is_omit()) ret_val.mr__conf() = OMIT_VALUE;
else if (single_value->field_mr__conf.is_bound()) {
ret_val.mr__conf() = single_value->field_mr__conf.valueof();
}
if (single_value->field_t__guard.is_bound()) {
ret_val.t__guard() = single_value->field_t__guard.valueof();
}
if (single_value->field_l1__pars.is_bound()) {
ret_val.l1__pars() = single_value->field_l1__pars.valueof();
}
if (single_value->field_spec.is_omit()) ret_val.spec() = OMIT_VALUE;
else if (single_value->field_spec.is_bound()) {
ret_val.spec() = single_value->field_spec.valueof();
}
if (single_value->field_encr.is_omit()) ret_val.encr() = OMIT_VALUE;
else if (single_value->field_encr.is_bound()) {
ret_val.encr() = single_value->field_encr.valueof();
}
if (single_value->field_bts0__band.is_omit()) ret_val.bts0__band() = OMIT_VALUE;
else if (single_value->field_bts0__band.is_bound()) {
ret_val.bts0__band() = single_value->field_bts0__band.valueof();
}
if (single_value->field_tsc.is_bound()) {
ret_val.tsc() = single_value->field_tsc.valueof();
}
if (single_value->field_fhp.is_bound()) {
ret_val.fhp() = single_value->field_fhp.valueof();
}
if (single_value->field_loc__osmux__cid.is_bound()) {
ret_val.loc__osmux__cid() = single_value->field_loc__osmux__cid.valueof();
}
if (single_value->field_rem__osmux__cid.is_omit()) ret_val.rem__osmux__cid() = OMIT_VALUE;
else if (single_value->field_rem__osmux__cid.is_bound()) {
ret_val.rem__osmux__cid() = single_value->field_rem__osmux__cid.valueof();
}
return ret_val;
}

void ConnHdlrPars_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @BTS_Tests.ConnHdlrPars.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new ConnHdlrPars_template[list_length];
}

ConnHdlrPars_template& ConnHdlrPars_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @BTS_Tests.ConnHdlrPars.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BTS_Tests.ConnHdlrPars.");
return value_list.list_value[list_index];
}

INTEGER_template& ConnHdlrPars_template::trx__nr()
{
set_specific();
return single_value->field_trx__nr;
}

const INTEGER_template& ConnHdlrPars_template::trx__nr() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field trx_nr of a non-specific template of type @BTS_Tests.ConnHdlrPars.");
return single_value->field_trx__nr;
}

GSM__Types::RslChannelNr_template& ConnHdlrPars_template::chan__nr()
{
set_specific();
return single_value->field_chan__nr;
}

const GSM__Types::RslChannelNr_template& ConnHdlrPars_template::chan__nr() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field chan_nr of a non-specific template of type @BTS_Tests.ConnHdlrPars.");
return single_value->field_chan__nr;
}

RSL__Types::RSL__IE__ChannelMode_template& ConnHdlrPars_template::chan__mode()
{
set_specific();
return single_value->field_chan__mode;
}

const RSL__Types::RSL__IE__ChannelMode_template& ConnHdlrPars_template::chan__mode() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field chan_mode of a non-specific template of type @BTS_Tests.ConnHdlrPars.");
return single_value->field_chan__mode;
}

RSL__Types::RSL__IE__MultirateCfg_template& ConnHdlrPars_template::mr__conf()
{
set_specific();
return single_value->field_mr__conf;
}

const RSL__Types::RSL__IE__MultirateCfg_template& ConnHdlrPars_template::mr__conf() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field mr_conf of a non-specific template of type @BTS_Tests.ConnHdlrPars.");
return single_value->field_mr__conf;
}

FLOAT_template& ConnHdlrPars_template::t__guard()
{
set_specific();
return single_value->field_t__guard;
}

const FLOAT_template& ConnHdlrPars_template::t__guard() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field t_guard of a non-specific template of type @BTS_Tests.ConnHdlrPars.");
return single_value->field_t__guard;
}

ConnL1Pars_template& ConnHdlrPars_template::l1__pars()
{
set_specific();
return single_value->field_l1__pars;
}

const ConnL1Pars_template& ConnHdlrPars_template::l1__pars() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field l1_pars of a non-specific template of type @BTS_Tests.ConnHdlrPars.");
return single_value->field_l1__pars;
}

TestSpecUnion_template& ConnHdlrPars_template::spec()
{
set_specific();
return single_value->field_spec;
}

const TestSpecUnion_template& ConnHdlrPars_template::spec() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field spec of a non-specific template of type @BTS_Tests.ConnHdlrPars.");
return single_value->field_spec;
}

RSL__Types::RSL__IE__EncryptionInfo_template& ConnHdlrPars_template::encr()
{
set_specific();
return single_value->field_encr;
}

const RSL__Types::RSL__IE__EncryptionInfo_template& ConnHdlrPars_template::encr() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field encr of a non-specific template of type @BTS_Tests.ConnHdlrPars.");
return single_value->field_encr;
}

CHARSTRING_template& ConnHdlrPars_template::bts0__band()
{
set_specific();
return single_value->field_bts0__band;
}

const CHARSTRING_template& ConnHdlrPars_template::bts0__band() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bts0_band of a non-specific template of type @BTS_Tests.ConnHdlrPars.");
return single_value->field_bts0__band;
}

INTEGER_template& ConnHdlrPars_template::tsc()
{
set_specific();
return single_value->field_tsc;
}

const INTEGER_template& ConnHdlrPars_template::tsc() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tsc of a non-specific template of type @BTS_Tests.ConnHdlrPars.");
return single_value->field_tsc;
}

FreqHopPars_template& ConnHdlrPars_template::fhp()
{
set_specific();
return single_value->field_fhp;
}

const FreqHopPars_template& ConnHdlrPars_template::fhp() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field fhp of a non-specific template of type @BTS_Tests.ConnHdlrPars.");
return single_value->field_fhp;
}

INTEGER_template& ConnHdlrPars_template::loc__osmux__cid()
{
set_specific();
return single_value->field_loc__osmux__cid;
}

const INTEGER_template& ConnHdlrPars_template::loc__osmux__cid() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field loc_osmux_cid of a non-specific template of type @BTS_Tests.ConnHdlrPars.");
return single_value->field_loc__osmux__cid;
}

INTEGER_template& ConnHdlrPars_template::rem__osmux__cid()
{
set_specific();
return single_value->field_rem__osmux__cid;
}

const INTEGER_template& ConnHdlrPars_template::rem__osmux__cid() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rem_osmux_cid of a non-specific template of type @BTS_Tests.ConnHdlrPars.");
return single_value->field_rem__osmux__cid;
}

int ConnHdlrPars_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.ConnHdlrPars which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 8;
      if (single_value->field_mr__conf.is_present()) ret_val++;
      if (single_value->field_spec.is_present()) ret_val++;
      if (single_value->field_encr.is_present()) ret_val++;
      if (single_value->field_bts0__band.is_present()) ret_val++;
      if (single_value->field_rem__osmux__cid.is_present()) ret_val++;
      return ret_val;
    }
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @BTS_Tests.ConnHdlrPars containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.ConnHdlrPars containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.ConnHdlrPars containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.ConnHdlrPars containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.ConnHdlrPars containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.ConnHdlrPars containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.ConnHdlrPars containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.ConnHdlrPars containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BTS_Tests.ConnHdlrPars.");
  }
  return 0;
}

void ConnHdlrPars_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ trx_nr := ");
single_value->field_trx__nr.log();
TTCN_Logger::log_event_str(", chan_nr := ");
single_value->field_chan__nr.log();
TTCN_Logger::log_event_str(", chan_mode := ");
single_value->field_chan__mode.log();
TTCN_Logger::log_event_str(", mr_conf := ");
single_value->field_mr__conf.log();
TTCN_Logger::log_event_str(", t_guard := ");
single_value->field_t__guard.log();
TTCN_Logger::log_event_str(", l1_pars := ");
single_value->field_l1__pars.log();
TTCN_Logger::log_event_str(", spec := ");
single_value->field_spec.log();
TTCN_Logger::log_event_str(", encr := ");
single_value->field_encr.log();
TTCN_Logger::log_event_str(", bts0_band := ");
single_value->field_bts0__band.log();
TTCN_Logger::log_event_str(", tsc := ");
single_value->field_tsc.log();
TTCN_Logger::log_event_str(", fhp := ");
single_value->field_fhp.log();
TTCN_Logger::log_event_str(", loc_osmux_cid := ");
single_value->field_loc__osmux__cid.log();
TTCN_Logger::log_event_str(", rem_osmux_cid := ");
single_value->field_rem__osmux__cid.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void ConnHdlrPars_template::log_match(const ConnHdlrPars& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_trx__nr.match(match_value.trx__nr(), legacy)){
TTCN_Logger::log_logmatch_info(".trx_nr");
single_value->field_trx__nr.log_match(match_value.trx__nr(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_chan__nr.match(match_value.chan__nr(), legacy)){
TTCN_Logger::log_logmatch_info(".chan_nr");
single_value->field_chan__nr.log_match(match_value.chan__nr(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_chan__mode.match(match_value.chan__mode(), legacy)){
TTCN_Logger::log_logmatch_info(".chan_mode");
single_value->field_chan__mode.log_match(match_value.chan__mode(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.mr__conf().ispresent()){
if(!single_value->field_mr__conf.match(match_value.mr__conf(), legacy)){
TTCN_Logger::log_logmatch_info(".mr_conf");
single_value->field_mr__conf.log_match(match_value.mr__conf(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_mr__conf.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".mr_conf := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_mr__conf.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_t__guard.match(match_value.t__guard(), legacy)){
TTCN_Logger::log_logmatch_info(".t_guard");
single_value->field_t__guard.log_match(match_value.t__guard(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_l1__pars.match(match_value.l1__pars(), legacy)){
TTCN_Logger::log_logmatch_info(".l1_pars");
single_value->field_l1__pars.log_match(match_value.l1__pars(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.spec().ispresent()){
if(!single_value->field_spec.match(match_value.spec(), legacy)){
TTCN_Logger::log_logmatch_info(".spec");
single_value->field_spec.log_match(match_value.spec(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_spec.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".spec := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_spec.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.encr().ispresent()){
if(!single_value->field_encr.match(match_value.encr(), legacy)){
TTCN_Logger::log_logmatch_info(".encr");
single_value->field_encr.log_match(match_value.encr(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_encr.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".encr := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_encr.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if (match_value.bts0__band().ispresent()){
if(!single_value->field_bts0__band.match(match_value.bts0__band(), legacy)){
TTCN_Logger::log_logmatch_info(".bts0_band");
single_value->field_bts0__band.log_match(match_value.bts0__band(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_bts0__band.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".bts0_band := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_bts0__band.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_tsc.match(match_value.tsc(), legacy)){
TTCN_Logger::log_logmatch_info(".tsc");
single_value->field_tsc.log_match(match_value.tsc(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_fhp.match(match_value.fhp(), legacy)){
TTCN_Logger::log_logmatch_info(".fhp");
single_value->field_fhp.log_match(match_value.fhp(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_loc__osmux__cid.match(match_value.loc__osmux__cid(), legacy)){
TTCN_Logger::log_logmatch_info(".loc_osmux_cid");
single_value->field_loc__osmux__cid.log_match(match_value.loc__osmux__cid(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.rem__osmux__cid().ispresent()){
if(!single_value->field_rem__osmux__cid.match(match_value.rem__osmux__cid(), legacy)){
TTCN_Logger::log_logmatch_info(".rem_osmux_cid");
single_value->field_rem__osmux__cid.log_match(match_value.rem__osmux__cid(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_rem__osmux__cid.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".rem_osmux_cid := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_rem__osmux__cid.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ trx_nr := ");
single_value->field_trx__nr.log_match(match_value.trx__nr(), legacy);
TTCN_Logger::log_event_str(", chan_nr := ");
single_value->field_chan__nr.log_match(match_value.chan__nr(), legacy);
TTCN_Logger::log_event_str(", chan_mode := ");
single_value->field_chan__mode.log_match(match_value.chan__mode(), legacy);
TTCN_Logger::log_event_str(", mr_conf := ");
if (match_value.mr__conf().ispresent()) {
single_value->field_mr__conf.log_match(match_value.mr__conf(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_mr__conf.log();
if (single_value->field_mr__conf.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", t_guard := ");
single_value->field_t__guard.log_match(match_value.t__guard(), legacy);
TTCN_Logger::log_event_str(", l1_pars := ");
single_value->field_l1__pars.log_match(match_value.l1__pars(), legacy);
TTCN_Logger::log_event_str(", spec := ");
if (match_value.spec().ispresent()) {
single_value->field_spec.log_match(match_value.spec(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_spec.log();
if (single_value->field_spec.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", encr := ");
if (match_value.encr().ispresent()) {
single_value->field_encr.log_match(match_value.encr(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_encr.log();
if (single_value->field_encr.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", bts0_band := ");
if (match_value.bts0__band().ispresent()) {
single_value->field_bts0__band.log_match(match_value.bts0__band(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_bts0__band.log();
if (single_value->field_bts0__band.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", tsc := ");
single_value->field_tsc.log_match(match_value.tsc(), legacy);
TTCN_Logger::log_event_str(", fhp := ");
single_value->field_fhp.log_match(match_value.fhp(), legacy);
TTCN_Logger::log_event_str(", loc_osmux_cid := ");
single_value->field_loc__osmux__cid.log_match(match_value.loc__osmux__cid(), legacy);
TTCN_Logger::log_event_str(", rem_osmux_cid := ");
if (match_value.rem__osmux__cid().ispresent()) {
single_value->field_rem__osmux__cid.log_match(match_value.rem__osmux__cid(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_rem__osmux__cid.log();
if (single_value->field_rem__osmux__cid.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void ConnHdlrPars_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (trx__nr().is_bound()) trx__nr().set_implicit_omit();
if (chan__nr().is_bound()) chan__nr().set_implicit_omit();
if (chan__mode().is_bound()) chan__mode().set_implicit_omit();
if (!mr__conf().is_bound()) mr__conf() = OMIT_VALUE;
else mr__conf().set_implicit_omit();
if (t__guard().is_bound()) t__guard().set_implicit_omit();
if (l1__pars().is_bound()) l1__pars().set_implicit_omit();
if (!spec().is_bound()) spec() = OMIT_VALUE;
else spec().set_implicit_omit();
if (!encr().is_bound()) encr() = OMIT_VALUE;
else encr().set_implicit_omit();
if (!bts0__band().is_bound()) bts0__band() = OMIT_VALUE;
else bts0__band().set_implicit_omit();
if (tsc().is_bound()) tsc().set_implicit_omit();
if (fhp().is_bound()) fhp().set_implicit_omit();
if (loc__osmux__cid().is_bound()) loc__osmux__cid().set_implicit_omit();
if (!rem__osmux__cid().is_bound()) rem__osmux__cid() = OMIT_VALUE;
else rem__osmux__cid().set_implicit_omit();
}

void ConnHdlrPars_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_trx__nr.encode_text(text_buf);
single_value->field_chan__nr.encode_text(text_buf);
single_value->field_chan__mode.encode_text(text_buf);
single_value->field_mr__conf.encode_text(text_buf);
single_value->field_t__guard.encode_text(text_buf);
single_value->field_l1__pars.encode_text(text_buf);
single_value->field_spec.encode_text(text_buf);
single_value->field_encr.encode_text(text_buf);
single_value->field_bts0__band.encode_text(text_buf);
single_value->field_tsc.encode_text(text_buf);
single_value->field_fhp.encode_text(text_buf);
single_value->field_loc__osmux__cid.encode_text(text_buf);
single_value->field_rem__osmux__cid.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BTS_Tests.ConnHdlrPars.");
}
}

void ConnHdlrPars_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_trx__nr.decode_text(text_buf);
single_value->field_chan__nr.decode_text(text_buf);
single_value->field_chan__mode.decode_text(text_buf);
single_value->field_mr__conf.decode_text(text_buf);
single_value->field_t__guard.decode_text(text_buf);
single_value->field_l1__pars.decode_text(text_buf);
single_value->field_spec.decode_text(text_buf);
single_value->field_encr.decode_text(text_buf);
single_value->field_bts0__band.decode_text(text_buf);
single_value->field_tsc.decode_text(text_buf);
single_value->field_fhp.decode_text(text_buf);
single_value->field_loc__osmux__cid.decode_text(text_buf);
single_value->field_rem__osmux__cid.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new ConnHdlrPars_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @BTS_Tests.ConnHdlrPars.");
}
}

void ConnHdlrPars_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    ConnHdlrPars_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (13<param.get_size()) {
      param.error("record template of type @BTS_Tests.ConnHdlrPars has 13 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) trx__nr().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) chan__nr().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) chan__mode().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) mr__conf().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) t__guard().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) l1__pars().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) spec().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) encr().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) bts0__band().set_param(*param.get_elem(8));
    if (param.get_size()>9 && param.get_elem(9)->get_type()!=Module_Param::MP_NotUsed) tsc().set_param(*param.get_elem(9));
    if (param.get_size()>10 && param.get_elem(10)->get_type()!=Module_Param::MP_NotUsed) fhp().set_param(*param.get_elem(10));
    if (param.get_size()>11 && param.get_elem(11)->get_type()!=Module_Param::MP_NotUsed) loc__osmux__cid().set_param(*param.get_elem(11));
    if (param.get_size()>12 && param.get_elem(12)->get_type()!=Module_Param::MP_NotUsed) rem__osmux__cid().set_param(*param.get_elem(12));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "trx_nr")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          trx__nr().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "chan_nr")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          chan__nr().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "chan_mode")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          chan__mode().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "mr_conf")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          mr__conf().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "t_guard")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          t__guard().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "l1_pars")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          l1__pars().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "spec")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          spec().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "encr")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          encr().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bts0_band")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bts0__band().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tsc")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tsc().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "fhp")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          fhp().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "loc_osmux_cid")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          loc__osmux__cid().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "rem_osmux_cid")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rem__osmux__cid().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BTS_Tests.ConnHdlrPars: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    ConnHdlrPars_template* precondition = new ConnHdlrPars_template;
    precondition->set_param(*param.get_elem(0));
    ConnHdlrPars_template* implied_template = new ConnHdlrPars_template;
    implied_template->set_param(*param.get_elem(1));
    *this = ConnHdlrPars_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BTS_Tests.ConnHdlrPars");
  }
  is_ifpresent = param.get_ifpresent();
}

void ConnHdlrPars_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_trx__nr.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.ConnHdlrPars");
single_value->field_chan__nr.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.ConnHdlrPars");
single_value->field_chan__mode.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.ConnHdlrPars");
single_value->field_mr__conf.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.ConnHdlrPars");
single_value->field_t__guard.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.ConnHdlrPars");
single_value->field_l1__pars.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.ConnHdlrPars");
single_value->field_spec.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.ConnHdlrPars");
single_value->field_encr.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.ConnHdlrPars");
single_value->field_bts0__band.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.ConnHdlrPars");
single_value->field_tsc.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.ConnHdlrPars");
single_value->field_fhp.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.ConnHdlrPars");
single_value->field_loc__osmux__cid.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.ConnHdlrPars");
single_value->field_rem__osmux__cid.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.ConnHdlrPars");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@BTS_Tests.ConnHdlrPars");
}

boolean ConnHdlrPars_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean ConnHdlrPars_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void TestSpecUnion::copy_value(const TestSpecUnion& other_value)
{
switch (other_value.union_selection) {
case ALT_rll:
field_rll = new RllTestCase(*other_value.field_rll);
break;
case ALT_top:
field_top = new TopTestCase(*other_value.field_top);
break;
default:
TTCN_error("Assignment of an unbound union value of type @BTS_Tests.TestSpecUnion.");
}
union_selection = other_value.union_selection;
}

TestSpecUnion::TestSpecUnion()
{
union_selection = UNBOUND_VALUE;
}

TestSpecUnion::TestSpecUnion(const TestSpecUnion& other_value)
: Base_Type(){
copy_value(other_value);
}

TestSpecUnion::~TestSpecUnion()
{
clean_up();
}

TestSpecUnion& TestSpecUnion::operator=(const TestSpecUnion& other_value)
{
if (this != &other_value) {
clean_up();
copy_value(other_value);
}
return *this;
}

boolean TestSpecUnion::operator==(const TestSpecUnion& other_value) const
{
if (union_selection == UNBOUND_VALUE) TTCN_error("The left operand of comparison is an unbound value of union type @BTS_Tests.TestSpecUnion.");
if (other_value.union_selection == UNBOUND_VALUE) TTCN_error("The right operand of comparison is an unbound value of union type @BTS_Tests.TestSpecUnion.");
if (union_selection != other_value.union_selection) return FALSE;
switch (union_selection) {
case ALT_rll:
return *field_rll == *other_value.field_rll;
case ALT_top:
return *field_top == *other_value.field_top;
default:
return FALSE;
}
}

RllTestCase& TestSpecUnion::rll()
{
if (union_selection != ALT_rll) {
clean_up();
field_rll = new RllTestCase;
union_selection = ALT_rll;
}
return *field_rll;
}

const RllTestCase& TestSpecUnion::rll() const
{
if (union_selection != ALT_rll) TTCN_error("Using non-selected field rll in a value of union type @BTS_Tests.TestSpecUnion.");
return *field_rll;
}

TopTestCase& TestSpecUnion::top()
{
if (union_selection != ALT_top) {
clean_up();
field_top = new TopTestCase;
union_selection = ALT_top;
}
return *field_top;
}

const TopTestCase& TestSpecUnion::top() const
{
if (union_selection != ALT_top) TTCN_error("Using non-selected field top in a value of union type @BTS_Tests.TestSpecUnion.");
return *field_top;
}

boolean TestSpecUnion::ischosen(union_selection_type checked_selection) const
{
if (checked_selection == UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @BTS_Tests.TestSpecUnion.");
return union_selection == checked_selection;
}

boolean TestSpecUnion::is_bound() const
{
  return union_selection != UNBOUND_VALUE;
}

boolean TestSpecUnion::is_value() const
{
switch (union_selection) {
case UNBOUND_VALUE: return FALSE;
case ALT_rll: return field_rll->is_value();
case ALT_top: return field_top->is_value();
default: TTCN_error("Invalid selection in union is_bound");}
}

void TestSpecUnion::clean_up()
{
switch (union_selection) {
case ALT_rll:
  delete field_rll;
  break;
case ALT_top:
  delete field_top;
  break;
default:
  break;
}
union_selection = UNBOUND_VALUE;
}

void TestSpecUnion::log() const
{
switch (union_selection) {
case ALT_rll:
TTCN_Logger::log_event_str("{ rll := ");
field_rll->log();
TTCN_Logger::log_event_str(" }");
break;
case ALT_top:
TTCN_Logger::log_event_str("{ top := ");
field_top->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_unbound();
}
}

void TestSpecUnion::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "union value");
  Module_Param_Ptr m_p = &param;
  if (m_p->get_type()==Module_Param::MP_Value_List && m_p->get_size()==0) return;
  if (m_p->get_type()!=Module_Param::MP_Assignment_List) {
    param.error("union value with field name was expected");
  }
  Module_Param* mp_last = m_p->get_elem(m_p->get_size()-1);
  char* last_name = mp_last->get_id()->get_name();
  if (!strcmp(last_name, "rll")) {
    rll().set_param(*mp_last);
    if (!rll().is_bound()) clean_up();
    return;
  }
  if (!strcmp(last_name, "top")) {
    top().set_param(*mp_last);
    if (!top().is_bound()) clean_up();
    return;
  }
  mp_last->error("Field %s does not exist in type @BTS_Tests.TestSpecUnion.", last_name);
}

void TestSpecUnion::set_implicit_omit()
{
switch (union_selection) {
case ALT_rll:
field_rll->set_implicit_omit(); break;
case ALT_top:
field_top->set_implicit_omit(); break;
default: break;
}
}

void TestSpecUnion::encode_text(Text_Buf& text_buf) const
{
text_buf.push_int(union_selection);
switch (union_selection) {
case ALT_rll:
field_rll->encode_text(text_buf);
break;
case ALT_top:
field_top->encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an unbound value of union type @BTS_Tests.TestSpecUnion.");
}
}

void TestSpecUnion::decode_text(Text_Buf& text_buf)
{
switch ((union_selection_type)text_buf.pull_int().get_val()) {
case ALT_rll:
rll().decode_text(text_buf);
break;
case ALT_top:
top().decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for type @BTS_Tests.TestSpecUnion.");
}
}

void TestSpecUnion_template::copy_value(const TestSpecUnion& other_value)
{
single_value.union_selection = other_value.get_selection();
switch (single_value.union_selection) {
case TestSpecUnion::ALT_rll:
single_value.field_rll = new RllTestCase_template(other_value.rll());
break;
case TestSpecUnion::ALT_top:
single_value.field_top = new TopTestCase_template(other_value.top());
break;
default:
TTCN_error("Initializing a template with an unbound value of type @BTS_Tests.TestSpecUnion.");
}
set_selection(SPECIFIC_VALUE);
}

void TestSpecUnion_template::copy_template(const TestSpecUnion_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value.union_selection = other_value.single_value.union_selection;
switch (single_value.union_selection) {
case TestSpecUnion::ALT_rll:
single_value.field_rll = new RllTestCase_template(*other_value.single_value.field_rll);
break;
case TestSpecUnion::ALT_top:
single_value.field_top = new TopTestCase_template(*other_value.single_value.field_top);
break;
default:
TTCN_error("Internal error: Invalid union selector in a specific value when copying a template of type @BTS_Tests.TestSpecUnion.");
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new TestSpecUnion_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new TestSpecUnion_template(*other_value.implication_.precondition);
implication_.implied_template = new TestSpecUnion_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized template of union type @BTS_Tests.TestSpecUnion.");
}
set_selection(other_value);
}

TestSpecUnion_template::TestSpecUnion_template()
{
}

TestSpecUnion_template::TestSpecUnion_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

TestSpecUnion_template::TestSpecUnion_template(const TestSpecUnion& other_value)
{
copy_value(other_value);
}

TestSpecUnion_template::TestSpecUnion_template(const OPTIONAL<TestSpecUnion>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const TestSpecUnion&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of union type @BTS_Tests.TestSpecUnion from an unbound optional field.");
}
}

TestSpecUnion_template::TestSpecUnion_template(TestSpecUnion_template* p_precondition, TestSpecUnion_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

TestSpecUnion_template::TestSpecUnion_template(Dynamic_Match_Interface<TestSpecUnion>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<TestSpecUnion>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

TestSpecUnion_template::TestSpecUnion_template(const TestSpecUnion_template& other_value)
: Base_Template(){
copy_template(other_value);
}

TestSpecUnion_template::~TestSpecUnion_template()
{
clean_up();
}

void TestSpecUnion_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case TestSpecUnion::ALT_rll:
delete single_value.field_rll;
break;
case TestSpecUnion::ALT_top:
delete single_value.field_top;
default:
break;
}
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

TestSpecUnion_template& TestSpecUnion_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

TestSpecUnion_template& TestSpecUnion_template::operator=(const TestSpecUnion& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

TestSpecUnion_template& TestSpecUnion_template::operator=(const OPTIONAL<TestSpecUnion>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const TestSpecUnion&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of union type @BTS_Tests.TestSpecUnion.");
}
return *this;
}

TestSpecUnion_template& TestSpecUnion_template::operator=(const TestSpecUnion_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean TestSpecUnion_template::match(const TestSpecUnion& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
{
TestSpecUnion::union_selection_type value_selection = other_value.get_selection();
if (value_selection == TestSpecUnion::UNBOUND_VALUE) return FALSE;
if (value_selection != single_value.union_selection) return FALSE;
switch (value_selection) {
case TestSpecUnion::ALT_rll:
return single_value.field_rll->match(other_value.rll(), legacy);
case TestSpecUnion::ALT_top:
return single_value.field_top->match(other_value.top(), legacy);
default:
TTCN_error("Internal error: Invalid selector in a specific value when matching a template of union type @BTS_Tests.TestSpecUnion.");
}
}
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error ("Matching an uninitialized template of union type @BTS_Tests.TestSpecUnion.");
}
return FALSE;
}

boolean TestSpecUnion_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
switch (single_value.union_selection) {
case TestSpecUnion::ALT_rll:
return single_value.field_rll->is_value();
case TestSpecUnion::ALT_top:
return single_value.field_top->is_value();
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing is_value operation on a template of union type @BTS_Tests.TestSpecUnion.");
}
}

TestSpecUnion TestSpecUnion_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of union type @BTS_Tests.TestSpecUnion.");
TestSpecUnion ret_val;
switch (single_value.union_selection) {
case TestSpecUnion::ALT_rll:
ret_val.rll() = single_value.field_rll->valueof();
break;
case TestSpecUnion::ALT_top:
ret_val.top() = single_value.field_top->valueof();
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing valueof operation on a template of union type @BTS_Tests.TestSpecUnion.");
}
return ret_val;
}

TestSpecUnion_template& TestSpecUnion_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Internal error: Accessing a list element of a non-list template of union type @BTS_Tests.TestSpecUnion.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of union type @BTS_Tests.TestSpecUnion.");
return value_list.list_value[list_index];
}
void TestSpecUnion_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST && template_type != CONJUNCTION_MATCH) TTCN_error ("Internal error: Setting an invalid list for a template of union type @BTS_Tests.TestSpecUnion.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new TestSpecUnion_template[list_length];
}

RllTestCase_template& TestSpecUnion_template::rll()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != TestSpecUnion::ALT_rll) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_rll = new RllTestCase_template(ANY_VALUE);
else single_value.field_rll = new RllTestCase_template;
single_value.union_selection = TestSpecUnion::ALT_rll;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_rll;
}

const RllTestCase_template& TestSpecUnion_template::rll() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field rll in a non-specific template of union type @BTS_Tests.TestSpecUnion.");
if (single_value.union_selection != TestSpecUnion::ALT_rll) TTCN_error("Accessing non-selected field rll in a template of union type @BTS_Tests.TestSpecUnion.");
return *single_value.field_rll;
}

TopTestCase_template& TestSpecUnion_template::top()
{
if (template_selection != SPECIFIC_VALUE || single_value.union_selection != TestSpecUnion::ALT_top) {
template_sel old_selection = template_selection;
clean_up();
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) single_value.field_top = new TopTestCase_template(ANY_VALUE);
else single_value.field_top = new TopTestCase_template;
single_value.union_selection = TestSpecUnion::ALT_top;
set_selection(SPECIFIC_VALUE);
}
return *single_value.field_top;
}

const TopTestCase_template& TestSpecUnion_template::top() const
{
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing field top in a non-specific template of union type @BTS_Tests.TestSpecUnion.");
if (single_value.union_selection != TestSpecUnion::ALT_top) TTCN_error("Accessing non-selected field top in a template of union type @BTS_Tests.TestSpecUnion.");
return *single_value.field_top;
}

boolean TestSpecUnion_template::ischosen(TestSpecUnion::union_selection_type checked_selection) const
{
if (checked_selection == TestSpecUnion::UNBOUND_VALUE) TTCN_error("Internal error: Performing ischosen() operation on an invalid field of union type @BTS_Tests.TestSpecUnion.");
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.union_selection == TestSpecUnion::UNBOUND_VALUE) TTCN_error("Internal error: Invalid selector in a specific value when performing ischosen() operation on a template of union type @BTS_Tests.TestSpecUnion.");
return single_value.union_selection == checked_selection;
case VALUE_LIST:
{
if (value_list.n_values < 1)
TTCN_error("Internal error: Performing ischosen() operation on a template of union type @BTS_Tests.TestSpecUnion containing an empty list.");
boolean ret_val = value_list.list_value[0].ischosen(checked_selection);
for (unsigned int list_count = 1; ret_val == TRUE && list_count < value_list.n_values; list_count++) {
ret_val = value_list.list_value[list_count].ischosen(checked_selection);
}
return ret_val;
}
default:
return FALSE;
}
return FALSE;
}

void TestSpecUnion_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
switch (single_value.union_selection) {
case TestSpecUnion::ALT_rll:
TTCN_Logger::log_event_str("{ rll := ");
single_value.field_rll->log();
TTCN_Logger::log_event_str(" }");
break;
case TestSpecUnion::ALT_top:
TTCN_Logger::log_event_str("{ top := ");
single_value.field_top->log();
TTCN_Logger::log_event_str(" }");
break;
default:
TTCN_Logger::log_event_str("<invalid selector>");
}
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void TestSpecUnion_template::log_match(const TestSpecUnion& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity() && match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
return;
}
if (template_selection == SPECIFIC_VALUE && single_value.union_selection == match_value.get_selection()) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
switch (single_value.union_selection) {
case TestSpecUnion::ALT_rll:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".rll");
single_value.field_rll->log_match(match_value.rll(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ rll := ");
single_value.field_rll->log_match(match_value.rll(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
case TestSpecUnion::ALT_top:
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
TTCN_Logger::log_logmatch_info(".top");
single_value.field_top->log_match(match_value.top(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
} else {
TTCN_Logger::log_event_str("{ top := ");
single_value.field_top->log_match(match_value.top(), legacy);
TTCN_Logger::log_event_str(" }");
}
break;
default:
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str("<invalid selector>");
}
} else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void TestSpecUnion_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
switch (single_value.union_selection) {
case TestSpecUnion::ALT_rll:
single_value.field_rll->set_implicit_omit(); break;
case TestSpecUnion::ALT_top:
single_value.field_top->set_implicit_omit(); break;
default: break;
}
}

void TestSpecUnion_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value.union_selection);
switch (single_value.union_selection) {
case TestSpecUnion::ALT_rll:
single_value.field_rll->encode_text(text_buf);
break;
case TestSpecUnion::ALT_top:
single_value.field_top->encode_text(text_buf);
break;
default:
TTCN_error("Internal error: Invalid selector in a specific value when encoding a template of union type @BTS_Tests.TestSpecUnion.");
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized template of type @BTS_Tests.TestSpecUnion.");
}
}

void TestSpecUnion_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
{
single_value.union_selection = TestSpecUnion::UNBOUND_VALUE;
TestSpecUnion::union_selection_type new_selection = (TestSpecUnion::union_selection_type)text_buf.pull_int().get_val();
switch (new_selection) {
case TestSpecUnion::ALT_rll:
single_value.field_rll = new RllTestCase_template;
single_value.field_rll->decode_text(text_buf);
break;
case TestSpecUnion::ALT_top:
single_value.field_top = new TopTestCase_template;
single_value.field_top->decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized union selector was received for a template of type @BTS_Tests.TestSpecUnion.");
}
single_value.union_selection = new_selection;
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new TestSpecUnion_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: Unrecognized selector was received in a template of type @BTS_Tests.TestSpecUnion.");
}
}

boolean TestSpecUnion_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean TestSpecUnion_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int v_idx=0; v_idx<value_list.n_values; v_idx++)
if (value_list.list_value[v_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void TestSpecUnion_template::set_param(Module_Param& param)
{
  if (dynamic_cast<Module_Param_Name*>(param.get_id()) != NULL &&
      param.get_id()->next_name()) {
    char* param_field = param.get_id()->get_current_name();
    if (param_field[0] >= '0' && param_field[0] <= '9') {
      param.error("Unexpected array index in module parameter, expected a valid field"
        " name for union template type `@BTS_Tests.TestSpecUnion'");
    }
    if (strcmp("rll", param_field) == 0) {
      rll().set_param(param);
      return;
    } else if (strcmp("top", param_field) == 0) {
      top().set_param(param);
      return;
    } else param.error("Field `%s' not found in union template type `@BTS_Tests.TestSpecUnion'", param_field);
  }
  param.basic_check(Module_Param::BC_TEMPLATE, "union template");
  Module_Param_Ptr m_p = &param;
  switch (m_p->get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    TestSpecUnion_template new_temp;
    new_temp.set_type(m_p->get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (m_p->get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), m_p->get_size());
    for (size_t p_i=0; p_i<m_p->get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*m_p->get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (m_p->get_size()==0) break;
    param.type_error("union template", "@BTS_Tests.TestSpecUnion");
    break;
  case Module_Param::MP_Assignment_List: {
    Module_Param* mp_last = m_p->get_elem(m_p->get_size()-1);
    char* last_name = mp_last->get_id()->get_name();
    if (!strcmp(last_name, "rll")) {
      rll().set_param(*mp_last);
      break;
    }
    if (!strcmp(last_name, "top")) {
      top().set_param(*mp_last);
      break;
    }
    mp_last->error("Field %s does not exist in type @BTS_Tests.TestSpecUnion.", last_name);
  } break;
  case Module_Param::MP_Implication_Template: {
    TestSpecUnion_template* precondition = new TestSpecUnion_template;
    precondition->set_param(*m_p->get_elem(0));
    TestSpecUnion_template* implied_template = new TestSpecUnion_template;
    implied_template->set_param(*m_p->get_elem(1));
    *this = TestSpecUnion_template(precondition, implied_template);
  } break;
  default:
    param.type_error("union template", "@BTS_Tests.TestSpecUnion");
  }
  is_ifpresent = param.get_ifpresent();
}

void TestSpecUnion_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
switch (single_value.union_selection) {
case TestSpecUnion::ALT_rll:
single_value.field_rll->check_restriction(t_res, t_name ? t_name : "@BTS_Tests.TestSpecUnion");
return;
case TestSpecUnion::ALT_top:
single_value.field_top->check_restriction(t_res, t_name ? t_name : "@BTS_Tests.TestSpecUnion");
return;
default:
TTCN_error("Internal error: Invalid selector in a specific value when performing check_restriction operation on a template of union type @BTS_Tests.TestSpecUnion.");
}
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@BTS_Tests.TestSpecUnion");
}

RllTestCase::RllTestCase()
{
}

RllTestCase::RllTestCase(const INTEGER& par_sapi,
    const GSM__Types::RslLinkId& par_link__id,
    const OCTETSTRING& par_l3,
    const BOOLEAN& par_exp,
    const RSL__Types::RSL__IE__ActivationType& par_act__type)
  :   field_sapi(par_sapi),
  field_link__id(par_link__id),
  field_l3(par_l3),
  field_exp(par_exp),
  field_act__type(par_act__type)
{
}

RllTestCase::RllTestCase(const RllTestCase& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BTS_Tests.RllTestCase.");
if (other_value.sapi().is_bound()) field_sapi = other_value.sapi();
else field_sapi.clean_up();
if (other_value.link__id().is_bound()) field_link__id = other_value.link__id();
else field_link__id.clean_up();
if (other_value.l3().is_bound()) field_l3 = other_value.l3();
else field_l3.clean_up();
if (other_value.exp().is_bound()) field_exp = other_value.exp();
else field_exp.clean_up();
if (other_value.act__type().is_bound()) field_act__type = other_value.act__type();
else field_act__type.clean_up();
}

void RllTestCase::clean_up()
{
field_sapi.clean_up();
field_link__id.clean_up();
field_l3.clean_up();
field_exp.clean_up();
field_act__type.clean_up();
}

const TTCN_Typedescriptor_t* RllTestCase::get_descriptor() const { return &RllTestCase_descr_; }
RllTestCase& RllTestCase::operator=(const RllTestCase& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BTS_Tests.RllTestCase.");
  if (other_value.sapi().is_bound()) field_sapi = other_value.sapi();
  else field_sapi.clean_up();
  if (other_value.link__id().is_bound()) field_link__id = other_value.link__id();
  else field_link__id.clean_up();
  if (other_value.l3().is_bound()) field_l3 = other_value.l3();
  else field_l3.clean_up();
  if (other_value.exp().is_bound()) field_exp = other_value.exp();
  else field_exp.clean_up();
  if (other_value.act__type().is_bound()) field_act__type = other_value.act__type();
  else field_act__type.clean_up();
}
return *this;
}

boolean RllTestCase::operator==(const RllTestCase& other_value) const
{
return field_sapi==other_value.field_sapi
  && field_link__id==other_value.field_link__id
  && field_l3==other_value.field_l3
  && field_exp==other_value.field_exp
  && field_act__type==other_value.field_act__type;
}

boolean RllTestCase::is_bound() const
{
return (field_sapi.is_bound())
  || (field_link__id.is_bound())
  || (field_l3.is_bound())
  || (field_exp.is_bound())
  || (field_act__type.is_bound());
}
boolean RllTestCase::is_value() const
{
return field_sapi.is_value()
  && field_link__id.is_value()
  && field_l3.is_value()
  && field_exp.is_value()
  && field_act__type.is_value();
}
void RllTestCase::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ sapi := ");
field_sapi.log();
TTCN_Logger::log_event_str(", link_id := ");
field_link__id.log();
TTCN_Logger::log_event_str(", l3 := ");
field_l3.log();
TTCN_Logger::log_event_str(", exp := ");
field_exp.log();
TTCN_Logger::log_event_str(", act_type := ");
field_act__type.log();
TTCN_Logger::log_event_str(" }");
}

void RllTestCase::set_implicit_omit()
{
if (sapi().is_bound()) sapi().set_implicit_omit();
if (link__id().is_bound()) link__id().set_implicit_omit();
if (l3().is_bound()) l3().set_implicit_omit();
if (exp().is_bound()) exp().set_implicit_omit();
if (act__type().is_bound()) act__type().set_implicit_omit();
}

void RllTestCase::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (5<param.get_size()) {
      param.error("record value of type @BTS_Tests.RllTestCase has 5 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) sapi().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) link__id().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) l3().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) exp().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) act__type().set_param(*param.get_elem(4));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sapi")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sapi().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "link_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          link__id().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "l3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          l3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "exp")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          exp().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "act_type")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          act__type().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BTS_Tests.RllTestCase: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BTS_Tests.RllTestCase");
  }
}

void RllTestCase::encode_text(Text_Buf& text_buf) const
{
field_sapi.encode_text(text_buf);
field_link__id.encode_text(text_buf);
field_l3.encode_text(text_buf);
field_exp.encode_text(text_buf);
field_act__type.encode_text(text_buf);
}

void RllTestCase::decode_text(Text_Buf& text_buf)
{
field_sapi.decode_text(text_buf);
field_link__id.decode_text(text_buf);
field_l3.decode_text(text_buf);
field_exp.decode_text(text_buf);
field_act__type.decode_text(text_buf);
}

struct RllTestCase_template::single_value_struct {
INTEGER_template field_sapi;
GSM__Types::RslLinkId_template field_link__id;
OCTETSTRING_template field_l3;
BOOLEAN_template field_exp;
RSL__Types::RSL__IE__ActivationType_template field_act__type;
};

void RllTestCase_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_sapi = ANY_VALUE;
single_value->field_link__id = ANY_VALUE;
single_value->field_l3 = ANY_VALUE;
single_value->field_exp = ANY_VALUE;
single_value->field_act__type = ANY_VALUE;
}
}
}

void RllTestCase_template::copy_value(const RllTestCase& other_value)
{
single_value = new single_value_struct;
if (other_value.sapi().is_bound()) {
  single_value->field_sapi = other_value.sapi();
} else {
  single_value->field_sapi.clean_up();
}
if (other_value.link__id().is_bound()) {
  single_value->field_link__id = other_value.link__id();
} else {
  single_value->field_link__id.clean_up();
}
if (other_value.l3().is_bound()) {
  single_value->field_l3 = other_value.l3();
} else {
  single_value->field_l3.clean_up();
}
if (other_value.exp().is_bound()) {
  single_value->field_exp = other_value.exp();
} else {
  single_value->field_exp.clean_up();
}
if (other_value.act__type().is_bound()) {
  single_value->field_act__type = other_value.act__type();
} else {
  single_value->field_act__type.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void RllTestCase_template::copy_template(const RllTestCase_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.sapi().get_selection()) {
single_value->field_sapi = other_value.sapi();
} else {
single_value->field_sapi.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.link__id().get_selection()) {
single_value->field_link__id = other_value.link__id();
} else {
single_value->field_link__id.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.l3().get_selection()) {
single_value->field_l3 = other_value.l3();
} else {
single_value->field_l3.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.exp().get_selection()) {
single_value->field_exp = other_value.exp();
} else {
single_value->field_exp.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.act__type().get_selection()) {
single_value->field_act__type = other_value.act__type();
} else {
single_value->field_act__type.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new RllTestCase_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new RllTestCase_template(*other_value.implication_.precondition);
implication_.implied_template = new RllTestCase_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BTS_Tests.RllTestCase.");
break;
}
set_selection(other_value);
}

RllTestCase_template::RllTestCase_template()
{
}

RllTestCase_template::RllTestCase_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

RllTestCase_template::RllTestCase_template(const RllTestCase& other_value)
{
copy_value(other_value);
}

RllTestCase_template::RllTestCase_template(const OPTIONAL<RllTestCase>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const RllTestCase&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BTS_Tests.RllTestCase from an unbound optional field.");
}
}

RllTestCase_template::RllTestCase_template(RllTestCase_template* p_precondition, RllTestCase_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

RllTestCase_template::RllTestCase_template(Dynamic_Match_Interface<RllTestCase>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<RllTestCase>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

RllTestCase_template::RllTestCase_template(const RllTestCase_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

RllTestCase_template::~RllTestCase_template()
{
clean_up();
}

RllTestCase_template& RllTestCase_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

RllTestCase_template& RllTestCase_template::operator=(const RllTestCase& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

RllTestCase_template& RllTestCase_template::operator=(const OPTIONAL<RllTestCase>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const RllTestCase&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @BTS_Tests.RllTestCase.");
}
return *this;
}

RllTestCase_template& RllTestCase_template::operator=(const RllTestCase_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean RllTestCase_template::match(const RllTestCase& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.sapi().is_bound()) return FALSE;
if(!single_value->field_sapi.match(other_value.sapi(), legacy))return FALSE;
if(!other_value.link__id().is_bound()) return FALSE;
if(!single_value->field_link__id.match(other_value.link__id(), legacy))return FALSE;
if(!other_value.l3().is_bound()) return FALSE;
if(!single_value->field_l3.match(other_value.l3(), legacy))return FALSE;
if(!other_value.exp().is_bound()) return FALSE;
if(!single_value->field_exp.match(other_value.exp(), legacy))return FALSE;
if(!other_value.act__type().is_bound()) return FALSE;
if(!single_value->field_act__type.match(other_value.act__type(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BTS_Tests.RllTestCase.");
}
return FALSE;
}

boolean RllTestCase_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_sapi.is_bound()
 || single_value->field_link__id.is_bound()
 || single_value->field_l3.is_bound()
 || single_value->field_exp.is_bound()
 || single_value->field_act__type.is_bound();
}

boolean RllTestCase_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_sapi.is_value()
 && single_value->field_link__id.is_value()
 && single_value->field_l3.is_value()
 && single_value->field_exp.is_value()
 && single_value->field_act__type.is_value();
}

void RllTestCase_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

RllTestCase RllTestCase_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BTS_Tests.RllTestCase.");
RllTestCase ret_val;
if (single_value->field_sapi.is_bound()) {
ret_val.sapi() = single_value->field_sapi.valueof();
}
if (single_value->field_link__id.is_bound()) {
ret_val.link__id() = single_value->field_link__id.valueof();
}
if (single_value->field_l3.is_bound()) {
ret_val.l3() = single_value->field_l3.valueof();
}
if (single_value->field_exp.is_bound()) {
ret_val.exp() = single_value->field_exp.valueof();
}
if (single_value->field_act__type.is_bound()) {
ret_val.act__type() = single_value->field_act__type.valueof();
}
return ret_val;
}

void RllTestCase_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @BTS_Tests.RllTestCase.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new RllTestCase_template[list_length];
}

RllTestCase_template& RllTestCase_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @BTS_Tests.RllTestCase.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BTS_Tests.RllTestCase.");
return value_list.list_value[list_index];
}

INTEGER_template& RllTestCase_template::sapi()
{
set_specific();
return single_value->field_sapi;
}

const INTEGER_template& RllTestCase_template::sapi() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field sapi of a non-specific template of type @BTS_Tests.RllTestCase.");
return single_value->field_sapi;
}

GSM__Types::RslLinkId_template& RllTestCase_template::link__id()
{
set_specific();
return single_value->field_link__id;
}

const GSM__Types::RslLinkId_template& RllTestCase_template::link__id() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field link_id of a non-specific template of type @BTS_Tests.RllTestCase.");
return single_value->field_link__id;
}

OCTETSTRING_template& RllTestCase_template::l3()
{
set_specific();
return single_value->field_l3;
}

const OCTETSTRING_template& RllTestCase_template::l3() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field l3 of a non-specific template of type @BTS_Tests.RllTestCase.");
return single_value->field_l3;
}

BOOLEAN_template& RllTestCase_template::exp()
{
set_specific();
return single_value->field_exp;
}

const BOOLEAN_template& RllTestCase_template::exp() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field exp of a non-specific template of type @BTS_Tests.RllTestCase.");
return single_value->field_exp;
}

RSL__Types::RSL__IE__ActivationType_template& RllTestCase_template::act__type()
{
set_specific();
return single_value->field_act__type;
}

const RSL__Types::RSL__IE__ActivationType_template& RllTestCase_template::act__type() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field act_type of a non-specific template of type @BTS_Tests.RllTestCase.");
return single_value->field_act__type;
}

int RllTestCase_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.RllTestCase which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 5;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @BTS_Tests.RllTestCase containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.RllTestCase containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.RllTestCase containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.RllTestCase containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.RllTestCase containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.RllTestCase containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.RllTestCase containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.RllTestCase containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BTS_Tests.RllTestCase.");
  }
  return 0;
}

void RllTestCase_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ sapi := ");
single_value->field_sapi.log();
TTCN_Logger::log_event_str(", link_id := ");
single_value->field_link__id.log();
TTCN_Logger::log_event_str(", l3 := ");
single_value->field_l3.log();
TTCN_Logger::log_event_str(", exp := ");
single_value->field_exp.log();
TTCN_Logger::log_event_str(", act_type := ");
single_value->field_act__type.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void RllTestCase_template::log_match(const RllTestCase& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_sapi.match(match_value.sapi(), legacy)){
TTCN_Logger::log_logmatch_info(".sapi");
single_value->field_sapi.log_match(match_value.sapi(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_link__id.match(match_value.link__id(), legacy)){
TTCN_Logger::log_logmatch_info(".link_id");
single_value->field_link__id.log_match(match_value.link__id(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_l3.match(match_value.l3(), legacy)){
TTCN_Logger::log_logmatch_info(".l3");
single_value->field_l3.log_match(match_value.l3(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_exp.match(match_value.exp(), legacy)){
TTCN_Logger::log_logmatch_info(".exp");
single_value->field_exp.log_match(match_value.exp(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_act__type.match(match_value.act__type(), legacy)){
TTCN_Logger::log_logmatch_info(".act_type");
single_value->field_act__type.log_match(match_value.act__type(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ sapi := ");
single_value->field_sapi.log_match(match_value.sapi(), legacy);
TTCN_Logger::log_event_str(", link_id := ");
single_value->field_link__id.log_match(match_value.link__id(), legacy);
TTCN_Logger::log_event_str(", l3 := ");
single_value->field_l3.log_match(match_value.l3(), legacy);
TTCN_Logger::log_event_str(", exp := ");
single_value->field_exp.log_match(match_value.exp(), legacy);
TTCN_Logger::log_event_str(", act_type := ");
single_value->field_act__type.log_match(match_value.act__type(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void RllTestCase_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (sapi().is_bound()) sapi().set_implicit_omit();
if (link__id().is_bound()) link__id().set_implicit_omit();
if (l3().is_bound()) l3().set_implicit_omit();
if (exp().is_bound()) exp().set_implicit_omit();
if (act__type().is_bound()) act__type().set_implicit_omit();
}

void RllTestCase_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_sapi.encode_text(text_buf);
single_value->field_link__id.encode_text(text_buf);
single_value->field_l3.encode_text(text_buf);
single_value->field_exp.encode_text(text_buf);
single_value->field_act__type.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BTS_Tests.RllTestCase.");
}
}

void RllTestCase_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_sapi.decode_text(text_buf);
single_value->field_link__id.decode_text(text_buf);
single_value->field_l3.decode_text(text_buf);
single_value->field_exp.decode_text(text_buf);
single_value->field_act__type.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new RllTestCase_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @BTS_Tests.RllTestCase.");
}
}

void RllTestCase_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    RllTestCase_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (5<param.get_size()) {
      param.error("record template of type @BTS_Tests.RllTestCase has 5 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) sapi().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) link__id().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) l3().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) exp().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) act__type().set_param(*param.get_elem(4));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "sapi")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          sapi().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "link_id")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          link__id().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "l3")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          l3().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "exp")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          exp().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "act_type")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          act__type().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BTS_Tests.RllTestCase: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    RllTestCase_template* precondition = new RllTestCase_template;
    precondition->set_param(*param.get_elem(0));
    RllTestCase_template* implied_template = new RllTestCase_template;
    implied_template->set_param(*param.get_elem(1));
    *this = RllTestCase_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BTS_Tests.RllTestCase");
  }
  is_ifpresent = param.get_ifpresent();
}

void RllTestCase_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_sapi.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.RllTestCase");
single_value->field_link__id.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.RllTestCase");
single_value->field_l3.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.RllTestCase");
single_value->field_exp.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.RllTestCase");
single_value->field_act__type.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.RllTestCase");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@BTS_Tests.RllTestCase");
}

boolean RllTestCase_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean RllTestCase_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}


const TopTestStep TopTestCase_steps::UNBOUND_ELEM;
TopTestCase_steps::TopTestCase_steps()
{
val_ptr = NULL;
}

TopTestCase_steps::TopTestCase_steps(null_type)
{
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
}

TopTestCase_steps::TopTestCase_steps(const TopTestCase_steps& other_value)
{
if (!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BTS_Tests.TopTestCase.steps.");
val_ptr = other_value.val_ptr;
val_ptr->ref_count++;
}

TopTestCase_steps::~TopTestCase_steps()
{
clean_up();
if (val_ptr != NULL) val_ptr = NULL;
}

void TopTestCase_steps::clean_up()
{
if (val_ptr != NULL) {
if (val_ptr->ref_count > 1) {
val_ptr->ref_count--;
val_ptr = NULL;
}
else if (val_ptr->ref_count == 1) {
for (int elem_count = 0; elem_count < val_ptr->n_elements;
elem_count++)
if (val_ptr->value_elements[elem_count] != NULL)
delete val_ptr->value_elements[elem_count];
free_pointers((void**)val_ptr->value_elements);
delete val_ptr;
val_ptr = NULL;
}
else
TTCN_error("Internal error: Invalid reference counter in a record of/set of value.");
}
}

TopTestCase_steps& TopTestCase_steps::operator=(null_type)
{
clean_up();
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
return *this;
}

TopTestCase_steps& TopTestCase_steps::operator=(const TopTestCase_steps& other_value)
{
if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @BTS_Tests.TopTestCase.steps.");
if (this != &other_value) {
clean_up();
val_ptr = other_value.val_ptr;
val_ptr->ref_count++;
}
return *this;
}

boolean TopTestCase_steps::operator==(null_type) const
{
if (val_ptr == NULL)
TTCN_error("The left operand of comparison is an unbound value of type @BTS_Tests.TopTestCase.steps.");
return val_ptr->n_elements == 0 ;
}

boolean TopTestCase_steps::operator==(const TopTestCase_steps& other_value) const
{
if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @BTS_Tests.TopTestCase.steps.");
if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @BTS_Tests.TopTestCase.steps.");
if (val_ptr == other_value.val_ptr) return TRUE;
if (val_ptr->n_elements != (other_value.val_ptr)->n_elements)
return FALSE;
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++){
if (val_ptr->value_elements[elem_count] != NULL){
if ((other_value.val_ptr)->value_elements[elem_count] != NULL){
  if (*val_ptr->value_elements[elem_count] != *(other_value.val_ptr)->value_elements[elem_count]) return FALSE;
} else return FALSE;
} else {
if ((other_value.val_ptr)->value_elements[elem_count] != NULL) return FALSE;
}
}
return TRUE;
}

TopTestStep& TopTestCase_steps::operator[](int index_value)
{
if (index_value < 0) TTCN_error("Accessing an element of type @BTS_Tests.TopTestCase.steps using a negative index: %d.", index_value);
if (val_ptr == NULL) {
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
} else if (val_ptr->ref_count > 1) {
struct recordof_setof_struct *new_val_ptr = new recordof_setof_struct;
new_val_ptr->ref_count = 1;
new_val_ptr->n_elements = (index_value >= val_ptr->n_elements) ? index_value + 1 : val_ptr->n_elements;
new_val_ptr->value_elements = (TopTestStep**)allocate_pointers(new_val_ptr->n_elements);
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++){
if (val_ptr->value_elements[elem_count] != NULL){
new_val_ptr->value_elements[elem_count] = new TopTestStep(*(val_ptr->value_elements[elem_count]));
}
}
clean_up();
val_ptr = new_val_ptr;
}
if (index_value >= val_ptr->n_elements) set_size(index_value + 1);
if (val_ptr->value_elements[index_value] == NULL) {
val_ptr->value_elements[index_value] = new TopTestStep;
}
return *val_ptr->value_elements[index_value];
}

TopTestStep& TopTestCase_steps::operator[](const INTEGER& index_value)
{
index_value.must_bound("Using an unbound integer value for indexing a value of type @BTS_Tests.TopTestCase.steps.");
return (*this)[(int)index_value];
}

const TopTestStep& TopTestCase_steps::operator[](int index_value) const
{
if (val_ptr == NULL)
TTCN_error("Accessing an element in an unbound value of type @BTS_Tests.TopTestCase.steps.");
if (index_value < 0) TTCN_error("Accessing an element of type @BTS_Tests.TopTestCase.steps using a negative index: %d.", index_value);
if (index_value >= val_ptr->n_elements) TTCN_error("Index overflow in a value of type @BTS_Tests.TopTestCase.steps: The index is %d, but the value has only %d elements.", index_value, val_ptr->n_elements);
return (val_ptr->value_elements[index_value] == NULL) ?
UNBOUND_ELEM : *val_ptr->value_elements[index_value];
}

const TopTestStep& TopTestCase_steps::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a value of type @BTS_Tests.TopTestCase.steps.");
return (*this)[(int)index_value];
}

TopTestCase_steps TopTestCase_steps::operator<<=(int rotate_count) const
{
return *this >>= (-rotate_count);
}

TopTestCase_steps TopTestCase_steps::operator<<=(const INTEGER& rotate_count) const
{
rotate_count.must_bound("Unbound integer operand of rotate left operator.");
return *this >>= (int)(-rotate_count);
}

TopTestCase_steps TopTestCase_steps::operator>>=(const INTEGER& rotate_count) const
{
rotate_count.must_bound("Unbound integer operand of rotate right operator.");
return *this >>= (int)rotate_count;
}

TopTestCase_steps TopTestCase_steps::operator>>=(int rotate_count) const
{
if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @BTS_Tests.TopTestCase.steps.");
if (val_ptr->n_elements == 0) return *this;
int rc;
if (rotate_count>=0) rc = rotate_count % val_ptr->n_elements;
else rc = val_ptr->n_elements - ((-rotate_count) % val_ptr->n_elements);
if (rc == 0) return *this;
TopTestCase_steps ret_val;
ret_val.set_size(val_ptr->n_elements);
for (int i=0; i<val_ptr->n_elements; i++) {
if (val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[(i+rc)%val_ptr->n_elements] =new TopTestStep(*val_ptr->value_elements[i]);
}
}
return ret_val;
}

TopTestCase_steps TopTestCase_steps::operator+(const TopTestCase_steps& other_value) const
{
if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @BTS_Tests.TopTestCase.steps concatenation.");
if (val_ptr->n_elements == 0) return other_value;
if (other_value.val_ptr->n_elements == 0) return *this;
TopTestCase_steps ret_val;
ret_val.set_size(val_ptr->n_elements+other_value.val_ptr->n_elements);
for (int i=0; i<val_ptr->n_elements; i++) {
if (val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i] = new TopTestStep(*val_ptr->value_elements[i]);
}
}
for (int i=0; i<other_value.val_ptr->n_elements; i++) {
if (other_value.val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i+val_ptr->n_elements] = new TopTestStep(*other_value.val_ptr->value_elements[i]);
}
}
return ret_val;
}

TopTestCase_steps TopTestCase_steps::substr(int index, int returncount) const
{
if (val_ptr == NULL) TTCN_error("The first argument of substr() is an unbound value of type @BTS_Tests.TopTestCase.steps.");
check_substr_arguments(val_ptr->n_elements, index, returncount, "@BTS_Tests.TopTestCase.steps","element");
TopTestCase_steps ret_val;
ret_val.set_size(returncount);
for (int i=0; i<returncount; i++) {
if (val_ptr->value_elements[i+index] != NULL) {
ret_val.val_ptr->value_elements[i] = new TopTestStep(*val_ptr->value_elements[i+index]);
}
}
return ret_val;
}

TopTestCase_steps TopTestCase_steps::replace(int index, int len, const TopTestCase_steps& repl) const
{
if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @BTS_Tests.TopTestCase.steps.");
if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @BTS_Tests.TopTestCase.steps.");
check_replace_arguments(val_ptr->n_elements, index, len, "@BTS_Tests.TopTestCase.steps","element");
TopTestCase_steps ret_val;
ret_val.set_size(val_ptr->n_elements + repl.val_ptr->n_elements - len);
for (int i = 0; i < index; i++) {
if (val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i] = new TopTestStep(*val_ptr->value_elements[i]);
}
}
for (int i = 0; i < repl.val_ptr->n_elements; i++) {
if (repl.val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i+index] = new TopTestStep(*repl.val_ptr->value_elements[i]);
}
}
for (int i = 0; i < val_ptr->n_elements - index - len; i++) {
if (val_ptr->value_elements[index+i+len] != NULL) {
ret_val.val_ptr->value_elements[index+i+repl.val_ptr->n_elements] = new TopTestStep(*val_ptr->value_elements[index+i+len]);
}
}
return ret_val;
}

TopTestCase_steps TopTestCase_steps::replace(int index, int len, const TopTestCase_steps_template& repl) const
{
if (!repl.is_value()) TTCN_error("The fourth argument of function replace() is a template with non-specific value.");
return replace(index, len, repl.valueof());
}

void TopTestCase_steps::set_size(int new_size)
{
if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @BTS_Tests.TopTestCase.steps.");
if (val_ptr == NULL) {
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
} else if (val_ptr->ref_count > 1) {
struct recordof_setof_struct *new_val_ptr = new recordof_setof_struct;
new_val_ptr->ref_count = 1;
new_val_ptr->n_elements = (new_size < val_ptr->n_elements) ? new_size : val_ptr->n_elements;
new_val_ptr->value_elements = (TopTestStep**)allocate_pointers(new_val_ptr->n_elements);
for (int elem_count = 0; elem_count < new_val_ptr->n_elements; elem_count++) {
if (val_ptr->value_elements[elem_count] != NULL){
new_val_ptr->value_elements[elem_count] = new TopTestStep(*(val_ptr->value_elements[elem_count]));
}
}
clean_up();
val_ptr = new_val_ptr;
}
if (new_size > val_ptr->n_elements) {
val_ptr->value_elements = (TopTestStep**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size);
#ifdef TITAN_MEMORY_DEBUG_SET_RECORD_OF
if((val_ptr->n_elements/1000)!=(new_size/1000)) TTCN_warning("New size of type @BTS_Tests.TopTestCase.steps: %d",new_size);
#endif
val_ptr->n_elements = new_size;
} else if (new_size < val_ptr->n_elements) {
for (int elem_count = new_size; elem_count < val_ptr->n_elements; elem_count++)
if (val_ptr->value_elements[elem_count] != NULL)delete val_ptr->value_elements[elem_count];
val_ptr->value_elements = (TopTestStep**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size);
val_ptr->n_elements = new_size;
}
}

boolean TopTestCase_steps::is_value() const
{
if (val_ptr == NULL) return FALSE;
for(int i = 0; i < val_ptr->n_elements; ++i) {
if (val_ptr->value_elements[i] == NULL || !val_ptr->value_elements[i]->is_value()) return FALSE;
}
return TRUE;
}

int TopTestCase_steps::size_of() const
{
if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @BTS_Tests.TopTestCase.steps.");
return val_ptr->n_elements;
}

int TopTestCase_steps::lengthof() const
{
if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @BTS_Tests.TopTestCase.steps.");
for (int my_length=val_ptr->n_elements; my_length>0; my_length--) if (val_ptr->value_elements[my_length-1] != NULL) return my_length;
return 0;
}

void TopTestCase_steps::log() const
{
if (val_ptr == NULL) {;
TTCN_Logger::log_event_unbound();
return;
}
switch (val_ptr->n_elements) {
case 0:
TTCN_Logger::log_event_str("{ }");
break;
default:
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
(*this)[elem_count].log();
}
TTCN_Logger::log_event_str(" }");
}
}

void TopTestCase_steps::set_implicit_omit()
{
if (val_ptr == NULL) return;
for (int i = 0; i < val_ptr->n_elements; i++) {
if (val_ptr->value_elements[i] != NULL) val_ptr->value_elements[i]->set_implicit_omit();
}
}

void TopTestCase_steps::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE|Module_Param::BC_LIST, "record of value");
  switch (param.get_operation_type()) {
  case Module_Param::OT_ASSIGN:
    if (param.get_type()==Module_Param::MP_Value_List && param.get_size()==0) {
      *this = NULL_VALUE;
      return;
    }
    switch (param.get_type()) {
    case Module_Param::MP_Value_List:
      set_size(param.get_size());
      for (size_t i=0; i<param.get_size(); ++i) {
        Module_Param* const curr = param.get_elem(i);
        if (curr->get_type()!=Module_Param::MP_NotUsed) {
          (*this)[i].set_param(*curr);
          if (!(*this)[i].is_bound()) {
            delete val_ptr->value_elements[i];
            val_ptr->value_elements[i] = NULL;
          }
        }
      }
      break;
    case Module_Param::MP_Indexed_List:
      for (size_t i=0; i<param.get_size(); ++i) {
        Module_Param* const curr = param.get_elem(i);
        (*this)[curr->get_id()->get_index()].set_param(*curr);
        if (!(*this)[curr->get_id()->get_index()].is_bound()) {
          delete val_ptr->value_elements[curr->get_id()->get_index()];
          val_ptr->value_elements[curr->get_id()->get_index()] = NULL;
        }
      }
      break;
    default:
      param.type_error("record of value", "@BTS_Tests.TopTestCase.steps");
    }
    break;
  case Module_Param::OT_CONCAT:
    switch (param.get_type()) {
    case Module_Param::MP_Value_List: {
      if (!is_bound()) *this = NULL_VALUE;
      int start_idx = lengthof();
      for (size_t i=0; i<param.get_size(); ++i) {
        Module_Param* const curr = param.get_elem(i);
        if ((curr->get_type()!=Module_Param::MP_NotUsed)) {
          (*this)[start_idx+(int)i].set_param(*curr);
        }
      }
    } break;
    case Module_Param::MP_Indexed_List:
      param.error("Cannot concatenate an indexed value list");
      break;
    default:
      param.type_error("record of value", "@BTS_Tests.TopTestCase.steps");
    }
    break;
  default:
    TTCN_error("Internal error: Unknown operation type.");
  }
}

void TopTestCase_steps::encode_text(Text_Buf& text_buf) const
{
if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @BTS_Tests.TopTestCase.steps.");
text_buf.push_int(val_ptr->n_elements);
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++)
(*this)[elem_count].encode_text(text_buf);
}

void TopTestCase_steps::decode_text(Text_Buf& text_buf)
{
clean_up();
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = text_buf.pull_int().get_val();
if (val_ptr->n_elements < 0) TTCN_error("Text decoder: Negative size was received for a value of type @BTS_Tests.TopTestCase.steps.");
val_ptr->value_elements = (TopTestStep**)allocate_pointers(val_ptr->n_elements);
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) {
val_ptr->value_elements[elem_count] = new TopTestStep;
val_ptr->value_elements[elem_count]->decode_text(text_buf);
}
}

void TopTestCase_steps_template::copy_value(const TopTestCase_steps& other_value)
{
if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @BTS_Tests.TopTestCase.steps with an unbound value.");
single_value.n_elements = other_value.size_of();
single_value.value_elements = (TopTestStep_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (other_value[elem_count].is_bound()) {
single_value.value_elements[elem_count] = new TopTestStep_template(other_value[elem_count]);
} else {
single_value.value_elements[elem_count] = new TopTestStep_template;
}
}
set_selection(SPECIFIC_VALUE);
}

void TopTestCase_steps_template::copy_template(const TopTestCase_steps_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value.n_elements = other_value.single_value.n_elements;
single_value.value_elements = (TopTestStep_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (UNINITIALIZED_TEMPLATE != other_value.single_value.value_elements[elem_count]->get_selection()) {
single_value.value_elements[elem_count] = new TopTestStep_template(*other_value.single_value.value_elements[elem_count]);
} else {
single_value.value_elements[elem_count] = new TopTestStep_template;
}
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new TopTestCase_steps_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new TopTestCase_steps_template(*other_value.implication_.precondition);
implication_.implied_template = new TopTestCase_steps_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BTS_Tests.TopTestCase.steps.");
break;
}
set_selection(other_value);
}

boolean TopTestCase_steps_template::match_function_specific(const Base_Type *value_ptr, int value_index, const Restricted_Length_Template *template_ptr, int template_index, boolean legacy)
{
if (value_index >= 0) return ((const TopTestCase_steps_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const TopTestCase_steps*)value_ptr)[value_index], legacy);
else return ((const TopTestCase_steps_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit();
}

TopTestCase_steps_template::TopTestCase_steps_template()
{
}

TopTestCase_steps_template::TopTestCase_steps_template(template_sel other_value)
 : Base_Record_Of_Template(other_value)
{
check_single_selection(other_value);
}

TopTestCase_steps_template::TopTestCase_steps_template(null_type)
 : Base_Record_Of_Template(SPECIFIC_VALUE)
{
single_value.n_elements = 0;
single_value.value_elements = NULL;
}

TopTestCase_steps_template::TopTestCase_steps_template(const TopTestCase_steps& other_value)
{
copy_value(other_value);
}

TopTestCase_steps_template::TopTestCase_steps_template(const OPTIONAL<TopTestCase_steps>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const TopTestCase_steps&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BTS_Tests.TopTestCase.steps from an unbound optional field.");
}
}

TopTestCase_steps_template::TopTestCase_steps_template(TopTestCase_steps_template* p_precondition, TopTestCase_steps_template* p_implied_template)
 : Base_Record_Of_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

TopTestCase_steps_template::TopTestCase_steps_template(Dynamic_Match_Interface<TopTestCase_steps>* p_dyn_match)
 : Base_Record_Of_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<TopTestCase_steps>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

TopTestCase_steps_template::TopTestCase_steps_template(const TopTestCase_steps_template& other_value)
 : Base_Record_Of_Template()
{
copy_template(other_value);
}

TopTestCase_steps_template::~TopTestCase_steps_template()
{
clean_up();
}

void TopTestCase_steps_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
delete single_value.value_elements[elem_count];
free_pointers((void**)single_value.value_elements);
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

TopTestCase_steps_template& TopTestCase_steps_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

TopTestCase_steps_template& TopTestCase_steps_template::operator=(null_type)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value.n_elements = 0;
single_value.value_elements = NULL;
return *this;
}

TopTestCase_steps_template& TopTestCase_steps_template::operator=(const TopTestCase_steps& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

TopTestCase_steps_template& TopTestCase_steps_template::operator=(const OPTIONAL<TopTestCase_steps>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const TopTestCase_steps&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @BTS_Tests.TopTestCase.steps.");
}
return *this;
}

TopTestCase_steps_template& TopTestCase_steps_template::operator=(const TopTestCase_steps_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

TopTestStep_template& TopTestCase_steps_template::operator[](int index_value)
{
if (index_value < 0) TTCN_error("Accessing an element of a template for type @BTS_Tests.TopTestCase.steps using a negative index: %d.", index_value);
switch (template_selection)
{
  case SPECIFIC_VALUE:
    if(index_value < single_value.n_elements) break;
    // no break
  case OMIT_VALUE:
  case ANY_VALUE:
  case ANY_OR_OMIT:
  case UNINITIALIZED_TEMPLATE:
    set_size(index_value + 1);
    break;
  default:
    TTCN_error("Accessing an element of a non-specific template for type @BTS_Tests.TopTestCase.steps.");
    break;
}
return *single_value.value_elements[index_value];
}

TopTestStep_template& TopTestCase_steps_template::operator[](const INTEGER& index_value)
{
index_value.must_bound("Using an unbound integer value for indexing a template of type @BTS_Tests.TopTestCase.steps.");
return (*this)[(int)index_value];
}

const TopTestStep_template& TopTestCase_steps_template::operator[](int index_value) const
{
if (index_value < 0) TTCN_error("Accessing an element of a template for type @BTS_Tests.TopTestCase.steps using a negative index: %d.", index_value);
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing an element of a non-specific template for type @BTS_Tests.TopTestCase.steps.");
if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @BTS_Tests.TopTestCase.steps: The index is %d, but the template has only %d elements.", index_value, single_value.n_elements);
return *single_value.value_elements[index_value];
}

const TopTestStep_template& TopTestCase_steps_template::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a template of type @BTS_Tests.TopTestCase.steps.");
return (*this)[(int)index_value];
}

void TopTestCase_steps_template::set_size(int new_size)
{
if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a template of type @BTS_Tests.TopTestCase.steps.");
template_sel old_selection = template_selection;
if (old_selection != SPECIFIC_VALUE) {
clean_up();
set_selection(SPECIFIC_VALUE);
single_value.n_elements = 0;
single_value.value_elements = NULL;
}
if (new_size > single_value.n_elements) {
single_value.value_elements = (TopTestStep_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
for (int elem_count = single_value.n_elements; elem_count < new_size; elem_count++)
single_value.value_elements[elem_count] = new TopTestStep_template(ANY_VALUE);
} else {
for (int elem_count = single_value.n_elements; elem_count < new_size; elem_count++)
single_value.value_elements[elem_count] = new TopTestStep_template;
}
single_value.n_elements = new_size;
} else if (new_size < single_value.n_elements) {
for (int elem_count = new_size; elem_count < single_value.n_elements; elem_count++)
delete single_value.value_elements[elem_count];
single_value.value_elements = (TopTestStep_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size);
single_value.n_elements = new_size;
}
}

int TopTestCase_steps_template::n_elem() const
{
  switch (template_selection) {
  case SPECIFIC_VALUE:
    return single_value.n_elements;
    break;
  case VALUE_LIST:
    return value_list.n_values;
    break;
  default:
    TTCN_error("Performing n_elem");
  }
}

int TopTestCase_steps_template::size_of(boolean is_size) const
{
const char* op_name = is_size ? "size" : "length";
int min_size;
boolean has_any_or_none;
if (is_ifpresent) TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.TopTestCase.steps which has an ifpresent attribute.", op_name);
switch (template_selection)
{
case SPECIFIC_VALUE: {
  min_size = 0;
  has_any_or_none = FALSE;
  int elem_count = single_value.n_elements;
  if (!is_size) { while (elem_count>0 && !single_value.value_elements[elem_count-1]->is_bound()) elem_count--; }
  for (int i=0; i<elem_count; i++) {
    switch (single_value.value_elements[i]->get_selection()) {
    case OMIT_VALUE:
      TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.TopTestCase.steps containing omit element.", op_name);
    case ANY_OR_OMIT:
      has_any_or_none = TRUE;
      break;
    default:
      min_size++;
      break;
    }
  }
} break;
case OMIT_VALUE:
  TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.TopTestCase.steps containing omit value.", op_name);
case ANY_VALUE:
case ANY_OR_OMIT:
  min_size = 0;
  has_any_or_none = TRUE;
  break;
case VALUE_LIST:
{
  if (value_list.n_values<1)
    TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.TopTestCase.steps containing an empty list.", op_name);
  int item_size = value_list.list_value[0].size_of(is_size);
  for (unsigned int i = 1; i < value_list.n_values; i++) {
    if (value_list.list_value[i].size_of(is_size)!=item_size)
      TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.TopTestCase.steps containing a value list with different sizes.", op_name);
  }
  min_size = item_size;
  has_any_or_none = FALSE;
  break;
}
case COMPLEMENTED_LIST:
  TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.TopTestCase.steps containing complemented list.", op_name);
default:
  TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @BTS_Tests.TopTestCase.steps.", op_name);
}
return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @BTS_Tests.TopTestCase.steps");
}

boolean TopTestCase_steps_template::match(const TopTestCase_steps& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
int value_length = other_value.size_of();
if (!match_length(value_length)) return FALSE;
switch (template_selection) {
case SPECIFIC_VALUE:
return match_record_of(&other_value, value_length, this, single_value.n_elements, match_function_specific, legacy);
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching with an uninitialized/unsupported template of type @BTS_Tests.TopTestCase.steps.");
}
return FALSE;
}

boolean TopTestCase_steps_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
if (!single_value.value_elements[elem_count]->is_value()) return FALSE;
return TRUE;
}

TopTestCase_steps TopTestCase_steps_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of type @BTS_Tests.TopTestCase.steps.");
TopTestCase_steps ret_val;
ret_val.set_size(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
if (single_value.value_elements[elem_count]->is_bound()) {
ret_val[elem_count] = single_value.value_elements[elem_count]->valueof();
}
return ret_val;
}

TopTestCase_steps TopTestCase_steps_template::substr(int index, int returncount) const
{
if (!is_value()) TTCN_error("The first argument of function substr() is a template with non-specific value.");
return valueof().substr(index, returncount);
}

TopTestCase_steps TopTestCase_steps_template::replace(int index, int len, const TopTestCase_steps_template& repl) const
{
if (!is_value()) TTCN_error("The first argument of function replace() is a template with non-specific value.");
if (!repl.is_value()) TTCN_error("The fourth argument of function replace() is a template with non-specific value.");
return valueof().replace(index, len, repl.valueof());
}

TopTestCase_steps TopTestCase_steps_template::replace(int index, int len, const TopTestCase_steps& repl) const
{
if (!is_value()) TTCN_error("The first argument of function replace() is a template with non-specific value.");
return valueof().replace(index, len, repl);
}

void TopTestCase_steps_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = list_length;
value_list.list_value = new TopTestCase_steps_template[list_length];
break;
default:
TTCN_error("Internal error: Setting an invalid type for a template of type @BTS_Tests.TopTestCase.steps.");
}
set_selection(template_type);
}

TopTestCase_steps_template& TopTestCase_steps_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Internal error: Accessing a list element of a non-list template of type @BTS_Tests.TopTestCase.steps.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @BTS_Tests.TopTestCase.steps.");
return value_list.list_value[list_index];
}

void TopTestCase_steps_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.n_elements > 0) {
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
if (permutation_starts_at(elem_count)) TTCN_Logger::log_event_str("permutation(");
single_value.value_elements[elem_count]->log();
if (permutation_ends_at(elem_count)) TTCN_Logger::log_char(')');
}
TTCN_Logger::log_event_str(" }");
} else TTCN_Logger::log_event_str("{ }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_restricted();
log_ifpresent();
}

void TopTestCase_steps_template::log_match(const TopTestCase_steps& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
}else{
if (template_selection == SPECIFIC_VALUE && single_value.n_elements > 0 && get_number_of_permutations() == 0 && single_value.n_elements == match_value.size_of()) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if(!single_value.value_elements[elem_count]->match(match_value[elem_count], legacy)){
TTCN_Logger::log_logmatch_info("[%d]", elem_count);
single_value.value_elements[elem_count]->log_match(match_value[elem_count], legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
log_match_length(single_value.n_elements);
} else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE && single_value.n_elements > 0 && get_number_of_permutations() == 0 && single_value.n_elements == match_value.size_of()) {
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
single_value.value_elements[elem_count]->log_match(match_value[elem_count], legacy);
}
TTCN_Logger::log_event_str(" }");
log_match_length(single_value.n_elements);
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void TopTestCase_steps_template::encode_text(Text_Buf& text_buf) const
{
encode_text_permutation(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
single_value.value_elements[elem_count]->encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BTS_Tests.TopTestCase.steps.");
}
}

void TopTestCase_steps_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_permutation(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value.n_elements = text_buf.pull_int().get_val();
if (single_value.n_elements < 0) TTCN_error("Text decoder: Negative size was received for a template of type @BTS_Tests.TopTestCase.steps.");
single_value.value_elements = (TopTestStep_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
single_value.value_elements[elem_count] = new TopTestStep_template;
single_value.value_elements[elem_count]->decode_text(text_buf);
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new TopTestCase_steps_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of type @BTS_Tests.TopTestCase.steps.");
}
}

boolean TopTestCase_steps_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean TopTestCase_steps_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void TopTestCase_steps_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
for (int i = 0; i < single_value.n_elements; i++) {
if (single_value.value_elements[i] != NULL) single_value.value_elements[i]->set_implicit_omit();
}
}

void TopTestCase_steps_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE|Module_Param::BC_LIST, "record of template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    TopTestCase_steps_template temp;
    temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = temp;
    break; }
  case Module_Param::MP_Indexed_List:
    if (template_selection!=SPECIFIC_VALUE) set_size(0);
    for (size_t p_i=0; p_i<param.get_size(); ++p_i) {
      (*this)[(int)(param.get_elem(p_i)->get_id()->get_index())].set_param(*param.get_elem(p_i));
    }
    break;
  case Module_Param::MP_Value_List: {
    set_size(param.get_size());
    int curr_idx = 0;
    for (size_t p_i=0; p_i<param.get_size(); ++p_i) {
      switch (param.get_elem(p_i)->get_type()) {
      case Module_Param::MP_NotUsed:
        curr_idx++;
        break;
      case Module_Param::MP_Permutation_Template: {
        int perm_start_idx = curr_idx;
        Module_Param* param_i = param.get_elem(p_i);
        for (size_t perm_i=0; perm_i<param_i->get_size(); perm_i++) {
          (*this)[curr_idx].set_param(*(param_i->get_elem(perm_i)));
          curr_idx++;
        }
        int perm_end_idx = curr_idx - 1;
        add_permutation(perm_start_idx, perm_end_idx);
      } break;
      default:
        (*this)[curr_idx].set_param(*param.get_elem(p_i));
        curr_idx++;
      }
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    TopTestCase_steps_template* precondition = new TopTestCase_steps_template;
    precondition->set_param(*param.get_elem(0));
    TopTestCase_steps_template* implied_template = new TopTestCase_steps_template;
    implied_template->set_param(*param.get_elem(1));
    *this = TopTestCase_steps_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record of template", "@BTS_Tests.TopTestCase.steps");
  }
  is_ifpresent = param.get_ifpresent();
  set_length_range(param);
}

void TopTestCase_steps_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
for (int i=0; i<single_value.n_elements; i++) single_value.value_elements[i]->check_restriction(t_res, t_name ? t_name : "@BTS_Tests.TopTestCase.steps");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@BTS_Tests.TopTestCase.steps");
}

boolean TopTestCase_steps_template::get_istemplate_kind(const char* type) const {
if (!strcmp(type, "AnyElement")) {
  if (template_selection != SPECIFIC_VALUE) {
    return FALSE;
  }
  for (int i = 0; i < single_value.n_elements; i++) {
    if (single_value.value_elements[i]->get_selection() == ANY_VALUE) {
      return TRUE;
    }
  }
  return FALSE;
} else if (!strcmp(type, "AnyElementsOrNone")) {
  if (template_selection != SPECIFIC_VALUE) {
    return FALSE;
  }
  for (int i = 0; i < single_value.n_elements; i++) {
    if (single_value.value_elements[i]->get_selection() == ANY_OR_OMIT) {
      return TRUE;
    }
  }
  return FALSE;
} else if (!strcmp(type, "permutation")) {
  return number_of_permutations;
} else if (!strcmp(type, "length")) {
  return length_restriction_type != NO_LENGTH_RESTRICTION;
} else {
  return Base_Template::get_istemplate_kind(type);
}
}
TopTestStep::TopTestStep()
{
}

TopTestStep::TopTestStep(const OPTIONAL< GSM__RR__Types::MeasurementResults >& par_meas__res,
    const INTEGER& par_overpower__sacch,
    const INTEGER& par_overpower__facch)
  :   field_meas__res(par_meas__res),
  field_overpower__sacch(par_overpower__sacch),
  field_overpower__facch(par_overpower__facch)
{
}

TopTestStep::TopTestStep(const TopTestStep& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BTS_Tests.TopTestStep.");
if (other_value.meas__res().is_bound()) field_meas__res = other_value.meas__res();
else field_meas__res.clean_up();
if (other_value.overpower__sacch().is_bound()) field_overpower__sacch = other_value.overpower__sacch();
else field_overpower__sacch.clean_up();
if (other_value.overpower__facch().is_bound()) field_overpower__facch = other_value.overpower__facch();
else field_overpower__facch.clean_up();
}

void TopTestStep::clean_up()
{
field_meas__res.clean_up();
field_overpower__sacch.clean_up();
field_overpower__facch.clean_up();
}

const TTCN_Typedescriptor_t* TopTestStep::get_descriptor() const { return &TopTestStep_descr_; }
TopTestStep& TopTestStep::operator=(const TopTestStep& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BTS_Tests.TopTestStep.");
  if (other_value.meas__res().is_bound()) field_meas__res = other_value.meas__res();
  else field_meas__res.clean_up();
  if (other_value.overpower__sacch().is_bound()) field_overpower__sacch = other_value.overpower__sacch();
  else field_overpower__sacch.clean_up();
  if (other_value.overpower__facch().is_bound()) field_overpower__facch = other_value.overpower__facch();
  else field_overpower__facch.clean_up();
}
return *this;
}

boolean TopTestStep::operator==(const TopTestStep& other_value) const
{
return field_meas__res==other_value.field_meas__res
  && field_overpower__sacch==other_value.field_overpower__sacch
  && field_overpower__facch==other_value.field_overpower__facch;
}

boolean TopTestStep::is_bound() const
{
return (OPTIONAL_OMIT == field_meas__res.get_selection() || field_meas__res.is_bound())
  || (field_overpower__sacch.is_bound())
  || (field_overpower__facch.is_bound());
}
boolean TopTestStep::is_value() const
{
return (OPTIONAL_OMIT == field_meas__res.get_selection() || field_meas__res.is_value())
  && field_overpower__sacch.is_value()
  && field_overpower__facch.is_value();
}
int TopTestStep::size_of() const
{
  int ret_val = 2;
  if (field_meas__res.ispresent()) ret_val++;
  return ret_val;
}

void TopTestStep::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ meas_res := ");
field_meas__res.log();
TTCN_Logger::log_event_str(", overpower_sacch := ");
field_overpower__sacch.log();
TTCN_Logger::log_event_str(", overpower_facch := ");
field_overpower__facch.log();
TTCN_Logger::log_event_str(" }");
}

void TopTestStep::set_implicit_omit()
{
if (!meas__res().is_bound()) meas__res() = OMIT_VALUE;
else meas__res().set_implicit_omit();
if (overpower__sacch().is_bound()) overpower__sacch().set_implicit_omit();
if (overpower__facch().is_bound()) overpower__facch().set_implicit_omit();
}

void TopTestStep::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record value of type @BTS_Tests.TopTestStep has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) meas__res().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) overpower__sacch().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) overpower__facch().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "meas_res")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          meas__res().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "overpower_sacch")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          overpower__sacch().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "overpower_facch")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          overpower__facch().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BTS_Tests.TopTestStep: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BTS_Tests.TopTestStep");
  }
}

void TopTestStep::encode_text(Text_Buf& text_buf) const
{
field_meas__res.encode_text(text_buf);
field_overpower__sacch.encode_text(text_buf);
field_overpower__facch.encode_text(text_buf);
}

void TopTestStep::decode_text(Text_Buf& text_buf)
{
field_meas__res.decode_text(text_buf);
field_overpower__sacch.decode_text(text_buf);
field_overpower__facch.decode_text(text_buf);
}

struct TopTestStep_template::single_value_struct {
GSM__RR__Types::MeasurementResults_template field_meas__res;
INTEGER_template field_overpower__sacch;
INTEGER_template field_overpower__facch;
};

void TopTestStep_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_meas__res = ANY_OR_OMIT;
single_value->field_overpower__sacch = ANY_VALUE;
single_value->field_overpower__facch = ANY_VALUE;
}
}
}

void TopTestStep_template::copy_value(const TopTestStep& other_value)
{
single_value = new single_value_struct;
if (other_value.meas__res().is_bound()) {
  if (other_value.meas__res().ispresent()) single_value->field_meas__res = other_value.meas__res()();
  else single_value->field_meas__res = OMIT_VALUE;
} else {
  single_value->field_meas__res.clean_up();
}
if (other_value.overpower__sacch().is_bound()) {
  single_value->field_overpower__sacch = other_value.overpower__sacch();
} else {
  single_value->field_overpower__sacch.clean_up();
}
if (other_value.overpower__facch().is_bound()) {
  single_value->field_overpower__facch = other_value.overpower__facch();
} else {
  single_value->field_overpower__facch.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void TopTestStep_template::copy_template(const TopTestStep_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.meas__res().get_selection()) {
single_value->field_meas__res = other_value.meas__res();
} else {
single_value->field_meas__res.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.overpower__sacch().get_selection()) {
single_value->field_overpower__sacch = other_value.overpower__sacch();
} else {
single_value->field_overpower__sacch.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.overpower__facch().get_selection()) {
single_value->field_overpower__facch = other_value.overpower__facch();
} else {
single_value->field_overpower__facch.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new TopTestStep_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new TopTestStep_template(*other_value.implication_.precondition);
implication_.implied_template = new TopTestStep_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BTS_Tests.TopTestStep.");
break;
}
set_selection(other_value);
}

TopTestStep_template::TopTestStep_template()
{
}

TopTestStep_template::TopTestStep_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

TopTestStep_template::TopTestStep_template(const TopTestStep& other_value)
{
copy_value(other_value);
}

TopTestStep_template::TopTestStep_template(const OPTIONAL<TopTestStep>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const TopTestStep&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BTS_Tests.TopTestStep from an unbound optional field.");
}
}

TopTestStep_template::TopTestStep_template(TopTestStep_template* p_precondition, TopTestStep_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

TopTestStep_template::TopTestStep_template(Dynamic_Match_Interface<TopTestStep>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<TopTestStep>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

TopTestStep_template::TopTestStep_template(const TopTestStep_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

TopTestStep_template::~TopTestStep_template()
{
clean_up();
}

TopTestStep_template& TopTestStep_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

TopTestStep_template& TopTestStep_template::operator=(const TopTestStep& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

TopTestStep_template& TopTestStep_template::operator=(const OPTIONAL<TopTestStep>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const TopTestStep&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @BTS_Tests.TopTestStep.");
}
return *this;
}

TopTestStep_template& TopTestStep_template::operator=(const TopTestStep_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean TopTestStep_template::match(const TopTestStep& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.meas__res().is_bound()) return FALSE;
if((other_value.meas__res().ispresent() ? !single_value->field_meas__res.match((const GSM__RR__Types::MeasurementResults&)other_value.meas__res(), legacy) : !single_value->field_meas__res.match_omit(legacy)))return FALSE;
if(!other_value.overpower__sacch().is_bound()) return FALSE;
if(!single_value->field_overpower__sacch.match(other_value.overpower__sacch(), legacy))return FALSE;
if(!other_value.overpower__facch().is_bound()) return FALSE;
if(!single_value->field_overpower__facch.match(other_value.overpower__facch(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BTS_Tests.TopTestStep.");
}
return FALSE;
}

boolean TopTestStep_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return (single_value->field_meas__res.is_omit() || single_value->field_meas__res.is_bound())
 || single_value->field_overpower__sacch.is_bound()
 || single_value->field_overpower__facch.is_bound();
}

boolean TopTestStep_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return (single_value->field_meas__res.is_omit() || single_value->field_meas__res.is_value())
 && single_value->field_overpower__sacch.is_value()
 && single_value->field_overpower__facch.is_value();
}

void TopTestStep_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

TopTestStep TopTestStep_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BTS_Tests.TopTestStep.");
TopTestStep ret_val;
if (single_value->field_meas__res.is_omit()) ret_val.meas__res() = OMIT_VALUE;
else if (single_value->field_meas__res.is_bound()) {
ret_val.meas__res() = single_value->field_meas__res.valueof();
}
if (single_value->field_overpower__sacch.is_bound()) {
ret_val.overpower__sacch() = single_value->field_overpower__sacch.valueof();
}
if (single_value->field_overpower__facch.is_bound()) {
ret_val.overpower__facch() = single_value->field_overpower__facch.valueof();
}
return ret_val;
}

void TopTestStep_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @BTS_Tests.TopTestStep.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new TopTestStep_template[list_length];
}

TopTestStep_template& TopTestStep_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @BTS_Tests.TopTestStep.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BTS_Tests.TopTestStep.");
return value_list.list_value[list_index];
}

GSM__RR__Types::MeasurementResults_template& TopTestStep_template::meas__res()
{
set_specific();
return single_value->field_meas__res;
}

const GSM__RR__Types::MeasurementResults_template& TopTestStep_template::meas__res() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field meas_res of a non-specific template of type @BTS_Tests.TopTestStep.");
return single_value->field_meas__res;
}

INTEGER_template& TopTestStep_template::overpower__sacch()
{
set_specific();
return single_value->field_overpower__sacch;
}

const INTEGER_template& TopTestStep_template::overpower__sacch() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field overpower_sacch of a non-specific template of type @BTS_Tests.TopTestStep.");
return single_value->field_overpower__sacch;
}

INTEGER_template& TopTestStep_template::overpower__facch()
{
set_specific();
return single_value->field_overpower__facch;
}

const INTEGER_template& TopTestStep_template::overpower__facch() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field overpower_facch of a non-specific template of type @BTS_Tests.TopTestStep.");
return single_value->field_overpower__facch;
}

int TopTestStep_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.TopTestStep which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 2;
      if (single_value->field_meas__res.is_present()) ret_val++;
      return ret_val;
    }
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @BTS_Tests.TopTestStep containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.TopTestStep containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.TopTestStep containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.TopTestStep containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.TopTestStep containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.TopTestStep containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.TopTestStep containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.TopTestStep containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BTS_Tests.TopTestStep.");
  }
  return 0;
}

void TopTestStep_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ meas_res := ");
single_value->field_meas__res.log();
TTCN_Logger::log_event_str(", overpower_sacch := ");
single_value->field_overpower__sacch.log();
TTCN_Logger::log_event_str(", overpower_facch := ");
single_value->field_overpower__facch.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void TopTestStep_template::log_match(const TopTestStep& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if (match_value.meas__res().ispresent()){
if(!single_value->field_meas__res.match(match_value.meas__res(), legacy)){
TTCN_Logger::log_logmatch_info(".meas_res");
single_value->field_meas__res.log_match(match_value.meas__res(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_meas__res.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".meas_res := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_meas__res.log();
TTCN_Logger::log_event_str(" unmatched");
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
if(!single_value->field_overpower__sacch.match(match_value.overpower__sacch(), legacy)){
TTCN_Logger::log_logmatch_info(".overpower_sacch");
single_value->field_overpower__sacch.log_match(match_value.overpower__sacch(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_overpower__facch.match(match_value.overpower__facch(), legacy)){
TTCN_Logger::log_logmatch_info(".overpower_facch");
single_value->field_overpower__facch.log_match(match_value.overpower__facch(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ meas_res := ");
if (match_value.meas__res().ispresent()) {
single_value->field_meas__res.log_match(match_value.meas__res(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_meas__res.log();
if (single_value->field_meas__res.match_omit(legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
TTCN_Logger::log_event_str(", overpower_sacch := ");
single_value->field_overpower__sacch.log_match(match_value.overpower__sacch(), legacy);
TTCN_Logger::log_event_str(", overpower_facch := ");
single_value->field_overpower__facch.log_match(match_value.overpower__facch(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void TopTestStep_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (!meas__res().is_bound()) meas__res() = OMIT_VALUE;
else meas__res().set_implicit_omit();
if (overpower__sacch().is_bound()) overpower__sacch().set_implicit_omit();
if (overpower__facch().is_bound()) overpower__facch().set_implicit_omit();
}

void TopTestStep_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_meas__res.encode_text(text_buf);
single_value->field_overpower__sacch.encode_text(text_buf);
single_value->field_overpower__facch.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BTS_Tests.TopTestStep.");
}
}

void TopTestStep_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_meas__res.decode_text(text_buf);
single_value->field_overpower__sacch.decode_text(text_buf);
single_value->field_overpower__facch.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new TopTestStep_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @BTS_Tests.TopTestStep.");
}
}

void TopTestStep_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    TopTestStep_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record template of type @BTS_Tests.TopTestStep has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) meas__res().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) overpower__sacch().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) overpower__facch().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "meas_res")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          meas__res().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "overpower_sacch")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          overpower__sacch().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "overpower_facch")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          overpower__facch().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BTS_Tests.TopTestStep: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    TopTestStep_template* precondition = new TopTestStep_template;
    precondition->set_param(*param.get_elem(0));
    TopTestStep_template* implied_template = new TopTestStep_template;
    implied_template->set_param(*param.get_elem(1));
    *this = TopTestStep_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BTS_Tests.TopTestStep");
  }
  is_ifpresent = param.get_ifpresent();
}

void TopTestStep_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_meas__res.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.TopTestStep");
single_value->field_overpower__sacch.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.TopTestStep");
single_value->field_overpower__facch.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.TopTestStep");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@BTS_Tests.TopTestStep");
}

boolean TopTestStep_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean TopTestStep_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

TopTestCase::TopTestCase()
{
}

TopTestCase::TopTestCase(const RSL__Types::RSL__IE__BS__Power& par_bs__power,
    const RSL__Types::RSL__IE__OSMO__TopAcchCap& par_top__cap,
    const TopTestCase_steps& par_steps)
  :   field_bs__power(par_bs__power),
  field_top__cap(par_top__cap),
  field_steps(par_steps)
{
}

TopTestCase::TopTestCase(const TopTestCase& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BTS_Tests.TopTestCase.");
if (other_value.bs__power().is_bound()) field_bs__power = other_value.bs__power();
else field_bs__power.clean_up();
if (other_value.top__cap().is_bound()) field_top__cap = other_value.top__cap();
else field_top__cap.clean_up();
if (other_value.steps().is_bound()) field_steps = other_value.steps();
else field_steps.clean_up();
}

void TopTestCase::clean_up()
{
field_bs__power.clean_up();
field_top__cap.clean_up();
field_steps.clean_up();
}

const TTCN_Typedescriptor_t* TopTestCase::get_descriptor() const { return &TopTestCase_descr_; }
TopTestCase& TopTestCase::operator=(const TopTestCase& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BTS_Tests.TopTestCase.");
  if (other_value.bs__power().is_bound()) field_bs__power = other_value.bs__power();
  else field_bs__power.clean_up();
  if (other_value.top__cap().is_bound()) field_top__cap = other_value.top__cap();
  else field_top__cap.clean_up();
  if (other_value.steps().is_bound()) field_steps = other_value.steps();
  else field_steps.clean_up();
}
return *this;
}

boolean TopTestCase::operator==(const TopTestCase& other_value) const
{
return field_bs__power==other_value.field_bs__power
  && field_top__cap==other_value.field_top__cap
  && field_steps==other_value.field_steps;
}

boolean TopTestCase::is_bound() const
{
return (field_bs__power.is_bound())
  || (field_top__cap.is_bound())
  || (field_steps.is_bound());
}
boolean TopTestCase::is_value() const
{
return field_bs__power.is_value()
  && field_top__cap.is_value()
  && field_steps.is_value();
}
void TopTestCase::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ bs_power := ");
field_bs__power.log();
TTCN_Logger::log_event_str(", top_cap := ");
field_top__cap.log();
TTCN_Logger::log_event_str(", steps := ");
field_steps.log();
TTCN_Logger::log_event_str(" }");
}

void TopTestCase::set_implicit_omit()
{
if (bs__power().is_bound()) bs__power().set_implicit_omit();
if (top__cap().is_bound()) top__cap().set_implicit_omit();
if (steps().is_bound()) steps().set_implicit_omit();
}

void TopTestCase::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record value of type @BTS_Tests.TopTestCase has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bs__power().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) top__cap().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) steps().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bs_power")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bs__power().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "top_cap")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          top__cap().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "steps")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          steps().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BTS_Tests.TopTestCase: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BTS_Tests.TopTestCase");
  }
}

void TopTestCase::encode_text(Text_Buf& text_buf) const
{
field_bs__power.encode_text(text_buf);
field_top__cap.encode_text(text_buf);
field_steps.encode_text(text_buf);
}

void TopTestCase::decode_text(Text_Buf& text_buf)
{
field_bs__power.decode_text(text_buf);
field_top__cap.decode_text(text_buf);
field_steps.decode_text(text_buf);
}

struct TopTestCase_template::single_value_struct {
RSL__Types::RSL__IE__BS__Power_template field_bs__power;
RSL__Types::RSL__IE__OSMO__TopAcchCap_template field_top__cap;
TopTestCase_steps_template field_steps;
};

void TopTestCase_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_bs__power = ANY_VALUE;
single_value->field_top__cap = ANY_VALUE;
single_value->field_steps = ANY_VALUE;
}
}
}

void TopTestCase_template::copy_value(const TopTestCase& other_value)
{
single_value = new single_value_struct;
if (other_value.bs__power().is_bound()) {
  single_value->field_bs__power = other_value.bs__power();
} else {
  single_value->field_bs__power.clean_up();
}
if (other_value.top__cap().is_bound()) {
  single_value->field_top__cap = other_value.top__cap();
} else {
  single_value->field_top__cap.clean_up();
}
if (other_value.steps().is_bound()) {
  single_value->field_steps = other_value.steps();
} else {
  single_value->field_steps.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void TopTestCase_template::copy_template(const TopTestCase_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.bs__power().get_selection()) {
single_value->field_bs__power = other_value.bs__power();
} else {
single_value->field_bs__power.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.top__cap().get_selection()) {
single_value->field_top__cap = other_value.top__cap();
} else {
single_value->field_top__cap.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.steps().get_selection()) {
single_value->field_steps = other_value.steps();
} else {
single_value->field_steps.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new TopTestCase_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new TopTestCase_template(*other_value.implication_.precondition);
implication_.implied_template = new TopTestCase_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BTS_Tests.TopTestCase.");
break;
}
set_selection(other_value);
}

TopTestCase_template::TopTestCase_template()
{
}

TopTestCase_template::TopTestCase_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

TopTestCase_template::TopTestCase_template(const TopTestCase& other_value)
{
copy_value(other_value);
}

TopTestCase_template::TopTestCase_template(const OPTIONAL<TopTestCase>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const TopTestCase&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BTS_Tests.TopTestCase from an unbound optional field.");
}
}

TopTestCase_template::TopTestCase_template(TopTestCase_template* p_precondition, TopTestCase_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

TopTestCase_template::TopTestCase_template(Dynamic_Match_Interface<TopTestCase>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<TopTestCase>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

TopTestCase_template::TopTestCase_template(const TopTestCase_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

TopTestCase_template::~TopTestCase_template()
{
clean_up();
}

TopTestCase_template& TopTestCase_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

TopTestCase_template& TopTestCase_template::operator=(const TopTestCase& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

TopTestCase_template& TopTestCase_template::operator=(const OPTIONAL<TopTestCase>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const TopTestCase&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @BTS_Tests.TopTestCase.");
}
return *this;
}

TopTestCase_template& TopTestCase_template::operator=(const TopTestCase_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean TopTestCase_template::match(const TopTestCase& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.bs__power().is_bound()) return FALSE;
if(!single_value->field_bs__power.match(other_value.bs__power(), legacy))return FALSE;
if(!other_value.top__cap().is_bound()) return FALSE;
if(!single_value->field_top__cap.match(other_value.top__cap(), legacy))return FALSE;
if(!other_value.steps().is_bound()) return FALSE;
if(!single_value->field_steps.match(other_value.steps(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BTS_Tests.TopTestCase.");
}
return FALSE;
}

boolean TopTestCase_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_bs__power.is_bound()
 || single_value->field_top__cap.is_bound()
 || single_value->field_steps.is_bound();
}

boolean TopTestCase_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_bs__power.is_value()
 && single_value->field_top__cap.is_value()
 && single_value->field_steps.is_value();
}

void TopTestCase_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

TopTestCase TopTestCase_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BTS_Tests.TopTestCase.");
TopTestCase ret_val;
if (single_value->field_bs__power.is_bound()) {
ret_val.bs__power() = single_value->field_bs__power.valueof();
}
if (single_value->field_top__cap.is_bound()) {
ret_val.top__cap() = single_value->field_top__cap.valueof();
}
if (single_value->field_steps.is_bound()) {
ret_val.steps() = single_value->field_steps.valueof();
}
return ret_val;
}

void TopTestCase_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @BTS_Tests.TopTestCase.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new TopTestCase_template[list_length];
}

TopTestCase_template& TopTestCase_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @BTS_Tests.TopTestCase.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BTS_Tests.TopTestCase.");
return value_list.list_value[list_index];
}

RSL__Types::RSL__IE__BS__Power_template& TopTestCase_template::bs__power()
{
set_specific();
return single_value->field_bs__power;
}

const RSL__Types::RSL__IE__BS__Power_template& TopTestCase_template::bs__power() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bs_power of a non-specific template of type @BTS_Tests.TopTestCase.");
return single_value->field_bs__power;
}

RSL__Types::RSL__IE__OSMO__TopAcchCap_template& TopTestCase_template::top__cap()
{
set_specific();
return single_value->field_top__cap;
}

const RSL__Types::RSL__IE__OSMO__TopAcchCap_template& TopTestCase_template::top__cap() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field top_cap of a non-specific template of type @BTS_Tests.TopTestCase.");
return single_value->field_top__cap;
}

TopTestCase_steps_template& TopTestCase_template::steps()
{
set_specific();
return single_value->field_steps;
}

const TopTestCase_steps_template& TopTestCase_template::steps() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field steps of a non-specific template of type @BTS_Tests.TopTestCase.");
return single_value->field_steps;
}

int TopTestCase_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.TopTestCase which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 3;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @BTS_Tests.TopTestCase containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.TopTestCase containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.TopTestCase containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.TopTestCase containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.TopTestCase containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.TopTestCase containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.TopTestCase containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.TopTestCase containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BTS_Tests.TopTestCase.");
  }
  return 0;
}

void TopTestCase_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ bs_power := ");
single_value->field_bs__power.log();
TTCN_Logger::log_event_str(", top_cap := ");
single_value->field_top__cap.log();
TTCN_Logger::log_event_str(", steps := ");
single_value->field_steps.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void TopTestCase_template::log_match(const TopTestCase& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_bs__power.match(match_value.bs__power(), legacy)){
TTCN_Logger::log_logmatch_info(".bs_power");
single_value->field_bs__power.log_match(match_value.bs__power(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_top__cap.match(match_value.top__cap(), legacy)){
TTCN_Logger::log_logmatch_info(".top_cap");
single_value->field_top__cap.log_match(match_value.top__cap(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_steps.match(match_value.steps(), legacy)){
TTCN_Logger::log_logmatch_info(".steps");
single_value->field_steps.log_match(match_value.steps(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ bs_power := ");
single_value->field_bs__power.log_match(match_value.bs__power(), legacy);
TTCN_Logger::log_event_str(", top_cap := ");
single_value->field_top__cap.log_match(match_value.top__cap(), legacy);
TTCN_Logger::log_event_str(", steps := ");
single_value->field_steps.log_match(match_value.steps(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void TopTestCase_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (bs__power().is_bound()) bs__power().set_implicit_omit();
if (top__cap().is_bound()) top__cap().set_implicit_omit();
if (steps().is_bound()) steps().set_implicit_omit();
}

void TopTestCase_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_bs__power.encode_text(text_buf);
single_value->field_top__cap.encode_text(text_buf);
single_value->field_steps.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BTS_Tests.TopTestCase.");
}
}

void TopTestCase_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_bs__power.decode_text(text_buf);
single_value->field_top__cap.decode_text(text_buf);
single_value->field_steps.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new TopTestCase_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @BTS_Tests.TopTestCase.");
}
}

void TopTestCase_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    TopTestCase_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (3<param.get_size()) {
      param.error("record template of type @BTS_Tests.TopTestCase has 3 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) bs__power().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) top__cap().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) steps().set_param(*param.get_elem(2));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bs_power")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bs__power().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "top_cap")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          top__cap().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "steps")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          steps().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BTS_Tests.TopTestCase: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    TopTestCase_template* precondition = new TopTestCase_template;
    precondition->set_param(*param.get_elem(0));
    TopTestCase_template* implied_template = new TopTestCase_template;
    implied_template->set_param(*param.get_elem(1));
    *this = TopTestCase_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BTS_Tests.TopTestCase");
  }
  is_ifpresent = param.get_ifpresent();
}

void TopTestCase_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_bs__power.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.TopTestCase");
single_value->field_top__cap.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.TopTestCase");
single_value->field_steps.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.TopTestCase");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@BTS_Tests.TopTestCase");
}

boolean TopTestCase_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean TopTestCase_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

as__pcu__info__ind_Default::as__pcu__info__ind_Default(PCUIF__CodecPort::PCUIF__CODEC__PT& pt, const INTEGER& pcu__conn__id, PCUIF__Types::PCUIF__Message& pcu__last__info)
 : Default_Base("as_pcu_info_ind"), par_pt(pt), par_pcu__conn__id(pcu__conn__id), par_pcu__last__info(pcu__last__info)
{
}

alt_status as__pcu__info__ind_Default::call_altstep(boolean first_alt_run)
{
return as__pcu__info__ind_instance(par_pt, par_pcu__conn__id, par_pcu__last__info, first_alt_run);
}

void__fn::void__fn()
{
referred_function = NULL;
}

void__fn::void__fn(function_pointer other_value)
{
referred_function = other_value;
}

void__fn::void__fn(const void__fn& other_value)
: Base_Type(){
other_value.must_bound("Copying an unbound @BTS_Tests.void_fn value.");
referred_function = other_value.referred_function;
}

void__fn& void__fn::operator=(function_pointer other_value)
{
referred_function = other_value;
return *this;
}

void__fn& void__fn::operator=(const void__fn& other_value)
{
other_value.must_bound("Assignment of an unbound value.");
referred_function = other_value.referred_function;
return *this;
}

boolean void__fn::operator==(function_pointer other_value) const
{
must_bound("Unbound left operand of @BTS_Tests.void_fn comparison.");
return referred_function == other_value;
}

boolean void__fn::operator==(const void__fn& other_value) const
{
must_bound("Unbound left operand of @BTS_Tests.void_fn comparison.");
other_value.must_bound("Unbound right operand of @BTS_Tests.void_fn comparison.");
return referred_function == other_value.referred_function;
}

void void__fn::invoke(const CHARSTRING& id) const
{
must_bound("Call of unbound function.");
if(referred_function == (void__fn::function_pointer)Module_List::get_fat_null())
TTCN_error("null reference cannot be invoked.");
referred_function(id);
}

void void__fn::start(const COMPONENT& component_reference, const CHARSTRING& id) const
{
((void__fn::start_pointer)Module_List::lookup_start_by_function_address((genericfunc_t)referred_function))(component_reference, id);
}

void void__fn::log() const
{
Module_List::log_function((genericfunc_t)referred_function);
}

void void__fn::set_param(Module_Param& param)
{
  param.error("Not supported.");
}

void void__fn::encode_text(Text_Buf& text_buf) const
{
Module_List::encode_function(text_buf,(genericfunc_t)referred_function);
}

void void__fn::decode_text(Text_Buf& text_buf)
{
Module_List::decode_function(text_buf,(genericfunc_t*)&referred_function);
}

boolean operator==(void__fn::function_pointer value, const void__fn& other_value)
{
other_value.must_bound("Unbound right operand of @BTS_Tests.void_fn comparison.");
return value == other_value.referred_function;
}

void void__fn_template::copy_template(const void__fn_template& other_value)
{
switch(other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new void__fn_template[value_list.n_values];
for(unsigned int i = 0; i < value_list.n_values; i++)
value_list.list_value[i] = other_value.value_list.list_value[i];
break;
default:
TTCN_error("Copying an unitialized/unsupported @BTS_Tests.void_fn template.");
}
set_selection(other_value);
}

void__fn_template::void__fn_template()
{
}

void__fn_template::void__fn_template(template_sel other_value)
  : Base_Template(other_value)
{
check_single_selection(other_value);
}

void__fn_template::void__fn_template(void__fn::function_pointer other_value)
  : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

void__fn_template::void__fn_template(const void__fn& other_value)
  :Base_Template(SPECIFIC_VALUE)
{
other_value.must_bound("Creating a template from an unbound @BTS_Tests.void_fn value.");
single_value = other_value.referred_function;
}

void__fn_template::void__fn_template(const OPTIONAL<void__fn>& other_value)
{
if(other_value.ispresent()) {
set_selection(SPECIFIC_VALUE);
single_value = ((const void__fn&)other_value()).referred_function;
} else set_selection(OMIT_VALUE);
}

void__fn_template::void__fn_template(const void__fn_template& other_value)
  :Base_Template()
{
copy_template(other_value);
}

void__fn_template::~void__fn_template()
{
  clean_up();
}

void void__fn_template::clean_up(){
if(template_selection == VALUE_LIST ||
template_selection == COMPLEMENTED_LIST)
delete[] value_list.list_value;
template_selection = UNINITIALIZED_TEMPLATE;
}

void__fn_template& void__fn_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

void__fn_template& void__fn_template::operator=(void__fn::function_pointer other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;}

void__fn_template& void__fn_template::operator=(const void__fn& other_value)
{
other_value.must_bound("Assignment of an unbound @BTS_Tests.void_fn value to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.referred_function;
return *this;
}

void__fn_template& void__fn_template::operator=(const OPTIONAL<void__fn>& other_value)
{
clean_up();
if(other_value.ispresent()) { 
set_selection(SPECIFIC_VALUE);
single_value = ((const void__fn&)other_value()).referred_function;
} else set_selection(OMIT_VALUE);
return *this;}

void__fn_template& void__fn_template::operator=(const void__fn_template& other_value)
{
if(&other_value != this) {
clean_up();copy_template(other_value);
}
return *this;
}

boolean void__fn_template::match(void__fn::function_pointer other_value, boolean) const
{
switch(template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for(unsigned int i = 0; i < value_list.n_values; i++)
if(value_list.list_value[i].match(other_value))
return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
default:
TTCN_error("Matching with an unitialized/unsupported @BTS_Tests.void_fn template.");
};
return FALSE;
}

boolean void__fn_template::match(const void__fn& other_value, boolean) const
{
  if (!other_value.is_bound()) return FALSE;
return match(other_value.referred_function);
}

void__fn void__fn_template::valueof() const
{
if(template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific @BTS_Tests.void_fn template.");
return single_value;
}

void void__fn_template::set_type(template_sel template_type, unsigned int list_length)
{
if(template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST)
TTCN_error("Setting an invalid type for an @BTS_Tests.void_fn template.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new void__fn_template[list_length];
}

void__fn_template& void__fn_template::list_item(unsigned int list_index) const
{
if(template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST)
TTCN_error("Accessing a list element of a non-list template of type @BTS_Tests.void_fn");
if(list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BTS_Tests.void_fn.");
return value_list.list_value[list_index];
}

void void__fn_template::log() const
{
switch(template_selection) {
case SPECIFIC_VALUE:
Module_List::log_function((genericfunc_t)single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case VALUE_LIST:
TTCN_Logger::log_char('(');
for(unsigned int i = 0; i < value_list.n_values; i++) {
if(i > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[i].log();
}
TTCN_Logger::log_char(')');
break;
default:
log_generic();
}
log_ifpresent();
}

void void__fn_template::log_match(const void__fn& match_value, boolean legacy) const
{
log();
TTCN_Logger::log_event_str(" with ");
match_value.log();
if(match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void void__fn_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch(template_selection) {
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case SPECIFIC_VALUE:
Module_List::encode_function(text_buf, (genericfunc_t)single_value);
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for(unsigned int i = 0; i < value_list.n_values; i++)
value_list.list_value[i].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BTS_Tests.void_fn.");
}
}

void void__fn_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch(template_selection) {
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case SPECIFIC_VALUE:
Module_List::decode_function(text_buf,(genericfunc_t*)&single_value);
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new void__fn_template[value_list.n_values];
for(unsigned int i = 0; i < value_list.n_values; i++)
value_list.list_value[i].decode_text(text_buf);
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @BTS_Tests.void_fn.");
}
}

boolean void__fn_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean void__fn_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void void__fn_template::set_param(Module_Param& param)
{
  param.error("Not supported.");
}

void void__fn_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@BTS_Tests.void_fn");
}

as__Tguard_Default::as__Tguard_Default()
 : Default_Base("as_Tguard")
{
}

alt_status as__Tguard_Default::call_altstep(boolean first_alt_run)
{
return as__Tguard_instance(first_alt_run);
}

as__l1ctl__dl__msg_Default::as__l1ctl__dl__msg_Default(L1CTL__Types::L1ctlMessage& msg, const OCTETSTRING_template& tr__data, const GSM__Types::RslChannelNr_template& chan__nr, const GSM__Types::RslLinkId_template& link__id)
 : Default_Base("as_l1ctl_dl_msg"), par_msg(msg), par_tr__data(tr__data), par_chan__nr(chan__nr), par_link__id(link__id)
{
}

alt_status as__l1ctl__dl__msg_Default::call_altstep(boolean first_alt_run)
{
return as__l1ctl__dl__msg_instance(par_msg, par_tr__data, par_chan__nr, par_link__id, first_alt_run);
}

as__dl__lapdm__dummy_Default::as__dl__lapdm__dummy_Default(const GSM__Types::RslChannelNr_template& chan__nr, const GSM__Types::RslLinkId_template& link__id, const INTEGER_template& sapi, const BOOLEAN& do__repeat)
 : Default_Base("as_dl_lapdm_dummy"), par_chan__nr(chan__nr), par_link__id(link__id), par_sapi(sapi), par_do__repeat(do__repeat)
{
}

alt_status as__dl__lapdm__dummy_Default::call_altstep(boolean first_alt_run)
{
return as__dl__lapdm__dummy_instance(par_chan__nr, par_link__id, par_sapi, par_do__repeat, first_alt_run);
}

as__dl__dcch__lapdm__ab_Default::as__dl__dcch__lapdm__ab_Default(LAPDm__Types::LapdmFrameAB& frame, const LAPDm__Types::LapdmFrameAB_template& tr__frame, const GSM__Types::RslLinkId_template& link__id)
 : Default_Base("as_dl_dcch_lapdm_ab"), par_frame(frame), par_tr__frame(tr__frame), par_link__id(link__id)
{
}

alt_status as__dl__dcch__lapdm__ab_Default::call_altstep(boolean first_alt_run)
{
return as__dl__dcch__lapdm__ab_instance(par_frame, par_tr__frame, par_link__id, first_alt_run);
}

as__dl__sacch__lapdm__ab_Default::as__dl__sacch__lapdm__ab_Default(GSM__RR__Types::SacchL1Header& l1h, LAPDm__Types::LapdmFrameAB& frame, const LAPDm__Types::LapdmFrameAB_template& tr__frame, const GSM__RR__Types::SacchL1Header_template& tr__l1h, const INTEGER_template& sapi)
 : Default_Base("as_dl_sacch_lapdm_ab"), par_l1h(l1h), par_frame(frame), par_tr__frame(tr__frame), par_tr__l1h(tr__l1h), par_sapi(sapi)
{
}

alt_status as__dl__sacch__lapdm__ab_Default::call_altstep(boolean first_alt_run)
{
return as__dl__sacch__lapdm__ab_instance(par_l1h, par_frame, par_tr__frame, par_tr__l1h, par_sapi, first_alt_run);
}

as__dl__dcch__pdu_Default::as__dl__dcch__pdu_Default(MobileL3__Types::PDU__ML3__NW__MS& pdu, const MobileL3__Types::PDU__ML3__NW__MS_template& tr__pdu, const INTEGER_template& sapi)
 : Default_Base("as_dl_dcch_pdu"), par_pdu(pdu), par_tr__pdu(tr__pdu), par_sapi(sapi)
{
}

alt_status as__dl__dcch__pdu_Default::call_altstep(boolean first_alt_run)
{
return as__dl__dcch__pdu_instance(par_pdu, par_tr__pdu, par_sapi, first_alt_run);
}

WrongChanNrCase::WrongChanNrCase()
{
}

WrongChanNrCase::WrongChanNrCase(const GSM__Types::RslChannelNr& par_chan__nr,
    const CHARSTRING& par_description)
  :   field_chan__nr(par_chan__nr),
  field_description(par_description)
{
}

WrongChanNrCase::WrongChanNrCase(const WrongChanNrCase& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BTS_Tests.WrongChanNrCase.");
if (other_value.chan__nr().is_bound()) field_chan__nr = other_value.chan__nr();
else field_chan__nr.clean_up();
if (other_value.description().is_bound()) field_description = other_value.description();
else field_description.clean_up();
}

void WrongChanNrCase::clean_up()
{
field_chan__nr.clean_up();
field_description.clean_up();
}

const TTCN_Typedescriptor_t* WrongChanNrCase::get_descriptor() const { return &WrongChanNrCase_descr_; }
WrongChanNrCase& WrongChanNrCase::operator=(const WrongChanNrCase& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BTS_Tests.WrongChanNrCase.");
  if (other_value.chan__nr().is_bound()) field_chan__nr = other_value.chan__nr();
  else field_chan__nr.clean_up();
  if (other_value.description().is_bound()) field_description = other_value.description();
  else field_description.clean_up();
}
return *this;
}

boolean WrongChanNrCase::operator==(const WrongChanNrCase& other_value) const
{
return field_chan__nr==other_value.field_chan__nr
  && field_description==other_value.field_description;
}

boolean WrongChanNrCase::is_bound() const
{
return (field_chan__nr.is_bound())
  || (field_description.is_bound());
}
boolean WrongChanNrCase::is_value() const
{
return field_chan__nr.is_value()
  && field_description.is_value();
}
void WrongChanNrCase::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ chan_nr := ");
field_chan__nr.log();
TTCN_Logger::log_event_str(", description := ");
field_description.log();
TTCN_Logger::log_event_str(" }");
}

void WrongChanNrCase::set_implicit_omit()
{
if (chan__nr().is_bound()) chan__nr().set_implicit_omit();
if (description().is_bound()) description().set_implicit_omit();
}

void WrongChanNrCase::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record value of type @BTS_Tests.WrongChanNrCase has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) chan__nr().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) description().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "chan_nr")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          chan__nr().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "description")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          description().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BTS_Tests.WrongChanNrCase: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BTS_Tests.WrongChanNrCase");
  }
}

void WrongChanNrCase::encode_text(Text_Buf& text_buf) const
{
field_chan__nr.encode_text(text_buf);
field_description.encode_text(text_buf);
}

void WrongChanNrCase::decode_text(Text_Buf& text_buf)
{
field_chan__nr.decode_text(text_buf);
field_description.decode_text(text_buf);
}

struct WrongChanNrCase_template::single_value_struct {
GSM__Types::RslChannelNr_template field_chan__nr;
CHARSTRING_template field_description;
};

void WrongChanNrCase_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_chan__nr = ANY_VALUE;
single_value->field_description = ANY_VALUE;
}
}
}

void WrongChanNrCase_template::copy_value(const WrongChanNrCase& other_value)
{
single_value = new single_value_struct;
if (other_value.chan__nr().is_bound()) {
  single_value->field_chan__nr = other_value.chan__nr();
} else {
  single_value->field_chan__nr.clean_up();
}
if (other_value.description().is_bound()) {
  single_value->field_description = other_value.description();
} else {
  single_value->field_description.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void WrongChanNrCase_template::copy_template(const WrongChanNrCase_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.chan__nr().get_selection()) {
single_value->field_chan__nr = other_value.chan__nr();
} else {
single_value->field_chan__nr.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.description().get_selection()) {
single_value->field_description = other_value.description();
} else {
single_value->field_description.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new WrongChanNrCase_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new WrongChanNrCase_template(*other_value.implication_.precondition);
implication_.implied_template = new WrongChanNrCase_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BTS_Tests.WrongChanNrCase.");
break;
}
set_selection(other_value);
}

WrongChanNrCase_template::WrongChanNrCase_template()
{
}

WrongChanNrCase_template::WrongChanNrCase_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

WrongChanNrCase_template::WrongChanNrCase_template(const WrongChanNrCase& other_value)
{
copy_value(other_value);
}

WrongChanNrCase_template::WrongChanNrCase_template(const OPTIONAL<WrongChanNrCase>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const WrongChanNrCase&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BTS_Tests.WrongChanNrCase from an unbound optional field.");
}
}

WrongChanNrCase_template::WrongChanNrCase_template(WrongChanNrCase_template* p_precondition, WrongChanNrCase_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

WrongChanNrCase_template::WrongChanNrCase_template(Dynamic_Match_Interface<WrongChanNrCase>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<WrongChanNrCase>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

WrongChanNrCase_template::WrongChanNrCase_template(const WrongChanNrCase_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

WrongChanNrCase_template::~WrongChanNrCase_template()
{
clean_up();
}

WrongChanNrCase_template& WrongChanNrCase_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

WrongChanNrCase_template& WrongChanNrCase_template::operator=(const WrongChanNrCase& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

WrongChanNrCase_template& WrongChanNrCase_template::operator=(const OPTIONAL<WrongChanNrCase>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const WrongChanNrCase&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @BTS_Tests.WrongChanNrCase.");
}
return *this;
}

WrongChanNrCase_template& WrongChanNrCase_template::operator=(const WrongChanNrCase_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean WrongChanNrCase_template::match(const WrongChanNrCase& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.chan__nr().is_bound()) return FALSE;
if(!single_value->field_chan__nr.match(other_value.chan__nr(), legacy))return FALSE;
if(!other_value.description().is_bound()) return FALSE;
if(!single_value->field_description.match(other_value.description(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BTS_Tests.WrongChanNrCase.");
}
return FALSE;
}

boolean WrongChanNrCase_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_chan__nr.is_bound()
 || single_value->field_description.is_bound();
}

boolean WrongChanNrCase_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_chan__nr.is_value()
 && single_value->field_description.is_value();
}

void WrongChanNrCase_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

WrongChanNrCase WrongChanNrCase_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BTS_Tests.WrongChanNrCase.");
WrongChanNrCase ret_val;
if (single_value->field_chan__nr.is_bound()) {
ret_val.chan__nr() = single_value->field_chan__nr.valueof();
}
if (single_value->field_description.is_bound()) {
ret_val.description() = single_value->field_description.valueof();
}
return ret_val;
}

void WrongChanNrCase_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @BTS_Tests.WrongChanNrCase.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new WrongChanNrCase_template[list_length];
}

WrongChanNrCase_template& WrongChanNrCase_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @BTS_Tests.WrongChanNrCase.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BTS_Tests.WrongChanNrCase.");
return value_list.list_value[list_index];
}

GSM__Types::RslChannelNr_template& WrongChanNrCase_template::chan__nr()
{
set_specific();
return single_value->field_chan__nr;
}

const GSM__Types::RslChannelNr_template& WrongChanNrCase_template::chan__nr() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field chan_nr of a non-specific template of type @BTS_Tests.WrongChanNrCase.");
return single_value->field_chan__nr;
}

CHARSTRING_template& WrongChanNrCase_template::description()
{
set_specific();
return single_value->field_description;
}

const CHARSTRING_template& WrongChanNrCase_template::description() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field description of a non-specific template of type @BTS_Tests.WrongChanNrCase.");
return single_value->field_description;
}

int WrongChanNrCase_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.WrongChanNrCase which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 2;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @BTS_Tests.WrongChanNrCase containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.WrongChanNrCase containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.WrongChanNrCase containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.WrongChanNrCase containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.WrongChanNrCase containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.WrongChanNrCase containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.WrongChanNrCase containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.WrongChanNrCase containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BTS_Tests.WrongChanNrCase.");
  }
  return 0;
}

void WrongChanNrCase_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ chan_nr := ");
single_value->field_chan__nr.log();
TTCN_Logger::log_event_str(", description := ");
single_value->field_description.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void WrongChanNrCase_template::log_match(const WrongChanNrCase& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_chan__nr.match(match_value.chan__nr(), legacy)){
TTCN_Logger::log_logmatch_info(".chan_nr");
single_value->field_chan__nr.log_match(match_value.chan__nr(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_description.match(match_value.description(), legacy)){
TTCN_Logger::log_logmatch_info(".description");
single_value->field_description.log_match(match_value.description(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ chan_nr := ");
single_value->field_chan__nr.log_match(match_value.chan__nr(), legacy);
TTCN_Logger::log_event_str(", description := ");
single_value->field_description.log_match(match_value.description(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void WrongChanNrCase_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (chan__nr().is_bound()) chan__nr().set_implicit_omit();
if (description().is_bound()) description().set_implicit_omit();
}

void WrongChanNrCase_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_chan__nr.encode_text(text_buf);
single_value->field_description.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BTS_Tests.WrongChanNrCase.");
}
}

void WrongChanNrCase_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_chan__nr.decode_text(text_buf);
single_value->field_description.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new WrongChanNrCase_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @BTS_Tests.WrongChanNrCase.");
}
}

void WrongChanNrCase_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    WrongChanNrCase_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record template of type @BTS_Tests.WrongChanNrCase has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) chan__nr().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) description().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "chan_nr")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          chan__nr().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "description")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          description().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BTS_Tests.WrongChanNrCase: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    WrongChanNrCase_template* precondition = new WrongChanNrCase_template;
    precondition->set_param(*param.get_elem(0));
    WrongChanNrCase_template* implied_template = new WrongChanNrCase_template;
    implied_template->set_param(*param.get_elem(1));
    *this = WrongChanNrCase_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BTS_Tests.WrongChanNrCase");
  }
  is_ifpresent = param.get_ifpresent();
}

void WrongChanNrCase_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_chan__nr.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.WrongChanNrCase");
single_value->field_description.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.WrongChanNrCase");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@BTS_Tests.WrongChanNrCase");
}

boolean WrongChanNrCase_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean WrongChanNrCase_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}


const WrongChanNrCase WrongChanNrCases::UNBOUND_ELEM;
WrongChanNrCases::WrongChanNrCases()
{
val_ptr = NULL;
}

WrongChanNrCases::WrongChanNrCases(null_type)
{
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
}

WrongChanNrCases::WrongChanNrCases(const WrongChanNrCases& other_value)
{
if (!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BTS_Tests.WrongChanNrCases.");
val_ptr = other_value.val_ptr;
val_ptr->ref_count++;
}

WrongChanNrCases::~WrongChanNrCases()
{
clean_up();
if (val_ptr != NULL) val_ptr = NULL;
}

void WrongChanNrCases::clean_up()
{
if (val_ptr != NULL) {
if (val_ptr->ref_count > 1) {
val_ptr->ref_count--;
val_ptr = NULL;
}
else if (val_ptr->ref_count == 1) {
for (int elem_count = 0; elem_count < val_ptr->n_elements;
elem_count++)
if (val_ptr->value_elements[elem_count] != NULL)
delete val_ptr->value_elements[elem_count];
free_pointers((void**)val_ptr->value_elements);
delete val_ptr;
val_ptr = NULL;
}
else
TTCN_error("Internal error: Invalid reference counter in a record of/set of value.");
}
}

WrongChanNrCases& WrongChanNrCases::operator=(null_type)
{
clean_up();
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
return *this;
}

WrongChanNrCases& WrongChanNrCases::operator=(const WrongChanNrCases& other_value)
{
if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @BTS_Tests.WrongChanNrCases.");
if (this != &other_value) {
clean_up();
val_ptr = other_value.val_ptr;
val_ptr->ref_count++;
}
return *this;
}

boolean WrongChanNrCases::operator==(null_type) const
{
if (val_ptr == NULL)
TTCN_error("The left operand of comparison is an unbound value of type @BTS_Tests.WrongChanNrCases.");
return val_ptr->n_elements == 0 ;
}

boolean WrongChanNrCases::operator==(const WrongChanNrCases& other_value) const
{
if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @BTS_Tests.WrongChanNrCases.");
if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @BTS_Tests.WrongChanNrCases.");
if (val_ptr == other_value.val_ptr) return TRUE;
if (val_ptr->n_elements != (other_value.val_ptr)->n_elements)
return FALSE;
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++){
if (val_ptr->value_elements[elem_count] != NULL){
if ((other_value.val_ptr)->value_elements[elem_count] != NULL){
  if (*val_ptr->value_elements[elem_count] != *(other_value.val_ptr)->value_elements[elem_count]) return FALSE;
} else return FALSE;
} else {
if ((other_value.val_ptr)->value_elements[elem_count] != NULL) return FALSE;
}
}
return TRUE;
}

WrongChanNrCase& WrongChanNrCases::operator[](int index_value)
{
if (index_value < 0) TTCN_error("Accessing an element of type @BTS_Tests.WrongChanNrCases using a negative index: %d.", index_value);
if (val_ptr == NULL) {
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
} else if (val_ptr->ref_count > 1) {
struct recordof_setof_struct *new_val_ptr = new recordof_setof_struct;
new_val_ptr->ref_count = 1;
new_val_ptr->n_elements = (index_value >= val_ptr->n_elements) ? index_value + 1 : val_ptr->n_elements;
new_val_ptr->value_elements = (WrongChanNrCase**)allocate_pointers(new_val_ptr->n_elements);
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++){
if (val_ptr->value_elements[elem_count] != NULL){
new_val_ptr->value_elements[elem_count] = new WrongChanNrCase(*(val_ptr->value_elements[elem_count]));
}
}
clean_up();
val_ptr = new_val_ptr;
}
if (index_value >= val_ptr->n_elements) set_size(index_value + 1);
if (val_ptr->value_elements[index_value] == NULL) {
val_ptr->value_elements[index_value] = new WrongChanNrCase;
}
return *val_ptr->value_elements[index_value];
}

WrongChanNrCase& WrongChanNrCases::operator[](const INTEGER& index_value)
{
index_value.must_bound("Using an unbound integer value for indexing a value of type @BTS_Tests.WrongChanNrCases.");
return (*this)[(int)index_value];
}

const WrongChanNrCase& WrongChanNrCases::operator[](int index_value) const
{
if (val_ptr == NULL)
TTCN_error("Accessing an element in an unbound value of type @BTS_Tests.WrongChanNrCases.");
if (index_value < 0) TTCN_error("Accessing an element of type @BTS_Tests.WrongChanNrCases using a negative index: %d.", index_value);
if (index_value >= val_ptr->n_elements) TTCN_error("Index overflow in a value of type @BTS_Tests.WrongChanNrCases: The index is %d, but the value has only %d elements.", index_value, val_ptr->n_elements);
return (val_ptr->value_elements[index_value] == NULL) ?
UNBOUND_ELEM : *val_ptr->value_elements[index_value];
}

const WrongChanNrCase& WrongChanNrCases::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a value of type @BTS_Tests.WrongChanNrCases.");
return (*this)[(int)index_value];
}

WrongChanNrCases WrongChanNrCases::operator<<=(int rotate_count) const
{
return *this >>= (-rotate_count);
}

WrongChanNrCases WrongChanNrCases::operator<<=(const INTEGER& rotate_count) const
{
rotate_count.must_bound("Unbound integer operand of rotate left operator.");
return *this >>= (int)(-rotate_count);
}

WrongChanNrCases WrongChanNrCases::operator>>=(const INTEGER& rotate_count) const
{
rotate_count.must_bound("Unbound integer operand of rotate right operator.");
return *this >>= (int)rotate_count;
}

WrongChanNrCases WrongChanNrCases::operator>>=(int rotate_count) const
{
if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @BTS_Tests.WrongChanNrCases.");
if (val_ptr->n_elements == 0) return *this;
int rc;
if (rotate_count>=0) rc = rotate_count % val_ptr->n_elements;
else rc = val_ptr->n_elements - ((-rotate_count) % val_ptr->n_elements);
if (rc == 0) return *this;
WrongChanNrCases ret_val;
ret_val.set_size(val_ptr->n_elements);
for (int i=0; i<val_ptr->n_elements; i++) {
if (val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[(i+rc)%val_ptr->n_elements] =new WrongChanNrCase(*val_ptr->value_elements[i]);
}
}
return ret_val;
}

WrongChanNrCases WrongChanNrCases::operator+(const WrongChanNrCases& other_value) const
{
if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @BTS_Tests.WrongChanNrCases concatenation.");
if (val_ptr->n_elements == 0) return other_value;
if (other_value.val_ptr->n_elements == 0) return *this;
WrongChanNrCases ret_val;
ret_val.set_size(val_ptr->n_elements+other_value.val_ptr->n_elements);
for (int i=0; i<val_ptr->n_elements; i++) {
if (val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i] = new WrongChanNrCase(*val_ptr->value_elements[i]);
}
}
for (int i=0; i<other_value.val_ptr->n_elements; i++) {
if (other_value.val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i+val_ptr->n_elements] = new WrongChanNrCase(*other_value.val_ptr->value_elements[i]);
}
}
return ret_val;
}

WrongChanNrCases WrongChanNrCases::substr(int index, int returncount) const
{
if (val_ptr == NULL) TTCN_error("The first argument of substr() is an unbound value of type @BTS_Tests.WrongChanNrCases.");
check_substr_arguments(val_ptr->n_elements, index, returncount, "@BTS_Tests.WrongChanNrCases","element");
WrongChanNrCases ret_val;
ret_val.set_size(returncount);
for (int i=0; i<returncount; i++) {
if (val_ptr->value_elements[i+index] != NULL) {
ret_val.val_ptr->value_elements[i] = new WrongChanNrCase(*val_ptr->value_elements[i+index]);
}
}
return ret_val;
}

WrongChanNrCases WrongChanNrCases::replace(int index, int len, const WrongChanNrCases& repl) const
{
if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @BTS_Tests.WrongChanNrCases.");
if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @BTS_Tests.WrongChanNrCases.");
check_replace_arguments(val_ptr->n_elements, index, len, "@BTS_Tests.WrongChanNrCases","element");
WrongChanNrCases ret_val;
ret_val.set_size(val_ptr->n_elements + repl.val_ptr->n_elements - len);
for (int i = 0; i < index; i++) {
if (val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i] = new WrongChanNrCase(*val_ptr->value_elements[i]);
}
}
for (int i = 0; i < repl.val_ptr->n_elements; i++) {
if (repl.val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i+index] = new WrongChanNrCase(*repl.val_ptr->value_elements[i]);
}
}
for (int i = 0; i < val_ptr->n_elements - index - len; i++) {
if (val_ptr->value_elements[index+i+len] != NULL) {
ret_val.val_ptr->value_elements[index+i+repl.val_ptr->n_elements] = new WrongChanNrCase(*val_ptr->value_elements[index+i+len]);
}
}
return ret_val;
}

WrongChanNrCases WrongChanNrCases::replace(int index, int len, const WrongChanNrCases_template& repl) const
{
if (!repl.is_value()) TTCN_error("The fourth argument of function replace() is a template with non-specific value.");
return replace(index, len, repl.valueof());
}

void WrongChanNrCases::set_size(int new_size)
{
if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @BTS_Tests.WrongChanNrCases.");
if (val_ptr == NULL) {
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
} else if (val_ptr->ref_count > 1) {
struct recordof_setof_struct *new_val_ptr = new recordof_setof_struct;
new_val_ptr->ref_count = 1;
new_val_ptr->n_elements = (new_size < val_ptr->n_elements) ? new_size : val_ptr->n_elements;
new_val_ptr->value_elements = (WrongChanNrCase**)allocate_pointers(new_val_ptr->n_elements);
for (int elem_count = 0; elem_count < new_val_ptr->n_elements; elem_count++) {
if (val_ptr->value_elements[elem_count] != NULL){
new_val_ptr->value_elements[elem_count] = new WrongChanNrCase(*(val_ptr->value_elements[elem_count]));
}
}
clean_up();
val_ptr = new_val_ptr;
}
if (new_size > val_ptr->n_elements) {
val_ptr->value_elements = (WrongChanNrCase**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size);
#ifdef TITAN_MEMORY_DEBUG_SET_RECORD_OF
if((val_ptr->n_elements/1000)!=(new_size/1000)) TTCN_warning("New size of type @BTS_Tests.WrongChanNrCases: %d",new_size);
#endif
val_ptr->n_elements = new_size;
} else if (new_size < val_ptr->n_elements) {
for (int elem_count = new_size; elem_count < val_ptr->n_elements; elem_count++)
if (val_ptr->value_elements[elem_count] != NULL)delete val_ptr->value_elements[elem_count];
val_ptr->value_elements = (WrongChanNrCase**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size);
val_ptr->n_elements = new_size;
}
}

boolean WrongChanNrCases::is_value() const
{
if (val_ptr == NULL) return FALSE;
for(int i = 0; i < val_ptr->n_elements; ++i) {
if (val_ptr->value_elements[i] == NULL || !val_ptr->value_elements[i]->is_value()) return FALSE;
}
return TRUE;
}

int WrongChanNrCases::size_of() const
{
if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @BTS_Tests.WrongChanNrCases.");
return val_ptr->n_elements;
}

int WrongChanNrCases::lengthof() const
{
if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @BTS_Tests.WrongChanNrCases.");
for (int my_length=val_ptr->n_elements; my_length>0; my_length--) if (val_ptr->value_elements[my_length-1] != NULL) return my_length;
return 0;
}

void WrongChanNrCases::log() const
{
if (val_ptr == NULL) {;
TTCN_Logger::log_event_unbound();
return;
}
switch (val_ptr->n_elements) {
case 0:
TTCN_Logger::log_event_str("{ }");
break;
default:
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
(*this)[elem_count].log();
}
TTCN_Logger::log_event_str(" }");
}
}

void WrongChanNrCases::set_implicit_omit()
{
if (val_ptr == NULL) return;
for (int i = 0; i < val_ptr->n_elements; i++) {
if (val_ptr->value_elements[i] != NULL) val_ptr->value_elements[i]->set_implicit_omit();
}
}

void WrongChanNrCases::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE|Module_Param::BC_LIST, "record of value");
  switch (param.get_operation_type()) {
  case Module_Param::OT_ASSIGN:
    if (param.get_type()==Module_Param::MP_Value_List && param.get_size()==0) {
      *this = NULL_VALUE;
      return;
    }
    switch (param.get_type()) {
    case Module_Param::MP_Value_List:
      set_size(param.get_size());
      for (size_t i=0; i<param.get_size(); ++i) {
        Module_Param* const curr = param.get_elem(i);
        if (curr->get_type()!=Module_Param::MP_NotUsed) {
          (*this)[i].set_param(*curr);
          if (!(*this)[i].is_bound()) {
            delete val_ptr->value_elements[i];
            val_ptr->value_elements[i] = NULL;
          }
        }
      }
      break;
    case Module_Param::MP_Indexed_List:
      for (size_t i=0; i<param.get_size(); ++i) {
        Module_Param* const curr = param.get_elem(i);
        (*this)[curr->get_id()->get_index()].set_param(*curr);
        if (!(*this)[curr->get_id()->get_index()].is_bound()) {
          delete val_ptr->value_elements[curr->get_id()->get_index()];
          val_ptr->value_elements[curr->get_id()->get_index()] = NULL;
        }
      }
      break;
    default:
      param.type_error("record of value", "@BTS_Tests.WrongChanNrCases");
    }
    break;
  case Module_Param::OT_CONCAT:
    switch (param.get_type()) {
    case Module_Param::MP_Value_List: {
      if (!is_bound()) *this = NULL_VALUE;
      int start_idx = lengthof();
      for (size_t i=0; i<param.get_size(); ++i) {
        Module_Param* const curr = param.get_elem(i);
        if ((curr->get_type()!=Module_Param::MP_NotUsed)) {
          (*this)[start_idx+(int)i].set_param(*curr);
        }
      }
    } break;
    case Module_Param::MP_Indexed_List:
      param.error("Cannot concatenate an indexed value list");
      break;
    default:
      param.type_error("record of value", "@BTS_Tests.WrongChanNrCases");
    }
    break;
  default:
    TTCN_error("Internal error: Unknown operation type.");
  }
}

void WrongChanNrCases::encode_text(Text_Buf& text_buf) const
{
if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @BTS_Tests.WrongChanNrCases.");
text_buf.push_int(val_ptr->n_elements);
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++)
(*this)[elem_count].encode_text(text_buf);
}

void WrongChanNrCases::decode_text(Text_Buf& text_buf)
{
clean_up();
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = text_buf.pull_int().get_val();
if (val_ptr->n_elements < 0) TTCN_error("Text decoder: Negative size was received for a value of type @BTS_Tests.WrongChanNrCases.");
val_ptr->value_elements = (WrongChanNrCase**)allocate_pointers(val_ptr->n_elements);
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) {
val_ptr->value_elements[elem_count] = new WrongChanNrCase;
val_ptr->value_elements[elem_count]->decode_text(text_buf);
}
}

void WrongChanNrCases_template::copy_value(const WrongChanNrCases& other_value)
{
if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @BTS_Tests.WrongChanNrCases with an unbound value.");
single_value.n_elements = other_value.size_of();
single_value.value_elements = (WrongChanNrCase_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (other_value[elem_count].is_bound()) {
single_value.value_elements[elem_count] = new WrongChanNrCase_template(other_value[elem_count]);
} else {
single_value.value_elements[elem_count] = new WrongChanNrCase_template;
}
}
set_selection(SPECIFIC_VALUE);
}

void WrongChanNrCases_template::copy_template(const WrongChanNrCases_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value.n_elements = other_value.single_value.n_elements;
single_value.value_elements = (WrongChanNrCase_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (UNINITIALIZED_TEMPLATE != other_value.single_value.value_elements[elem_count]->get_selection()) {
single_value.value_elements[elem_count] = new WrongChanNrCase_template(*other_value.single_value.value_elements[elem_count]);
} else {
single_value.value_elements[elem_count] = new WrongChanNrCase_template;
}
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new WrongChanNrCases_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new WrongChanNrCases_template(*other_value.implication_.precondition);
implication_.implied_template = new WrongChanNrCases_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BTS_Tests.WrongChanNrCases.");
break;
}
set_selection(other_value);
}

boolean WrongChanNrCases_template::match_function_specific(const Base_Type *value_ptr, int value_index, const Restricted_Length_Template *template_ptr, int template_index, boolean legacy)
{
if (value_index >= 0) return ((const WrongChanNrCases_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const WrongChanNrCases*)value_ptr)[value_index], legacy);
else return ((const WrongChanNrCases_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit();
}

WrongChanNrCases_template::WrongChanNrCases_template()
{
}

WrongChanNrCases_template::WrongChanNrCases_template(template_sel other_value)
 : Base_Record_Of_Template(other_value)
{
check_single_selection(other_value);
}

WrongChanNrCases_template::WrongChanNrCases_template(null_type)
 : Base_Record_Of_Template(SPECIFIC_VALUE)
{
single_value.n_elements = 0;
single_value.value_elements = NULL;
}

WrongChanNrCases_template::WrongChanNrCases_template(const WrongChanNrCases& other_value)
{
copy_value(other_value);
}

WrongChanNrCases_template::WrongChanNrCases_template(const OPTIONAL<WrongChanNrCases>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const WrongChanNrCases&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BTS_Tests.WrongChanNrCases from an unbound optional field.");
}
}

WrongChanNrCases_template::WrongChanNrCases_template(WrongChanNrCases_template* p_precondition, WrongChanNrCases_template* p_implied_template)
 : Base_Record_Of_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

WrongChanNrCases_template::WrongChanNrCases_template(Dynamic_Match_Interface<WrongChanNrCases>* p_dyn_match)
 : Base_Record_Of_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<WrongChanNrCases>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

WrongChanNrCases_template::WrongChanNrCases_template(const WrongChanNrCases_template& other_value)
 : Base_Record_Of_Template()
{
copy_template(other_value);
}

WrongChanNrCases_template::~WrongChanNrCases_template()
{
clean_up();
}

void WrongChanNrCases_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
delete single_value.value_elements[elem_count];
free_pointers((void**)single_value.value_elements);
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

WrongChanNrCases_template& WrongChanNrCases_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

WrongChanNrCases_template& WrongChanNrCases_template::operator=(null_type)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value.n_elements = 0;
single_value.value_elements = NULL;
return *this;
}

WrongChanNrCases_template& WrongChanNrCases_template::operator=(const WrongChanNrCases& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

WrongChanNrCases_template& WrongChanNrCases_template::operator=(const OPTIONAL<WrongChanNrCases>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const WrongChanNrCases&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @BTS_Tests.WrongChanNrCases.");
}
return *this;
}

WrongChanNrCases_template& WrongChanNrCases_template::operator=(const WrongChanNrCases_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

WrongChanNrCase_template& WrongChanNrCases_template::operator[](int index_value)
{
if (index_value < 0) TTCN_error("Accessing an element of a template for type @BTS_Tests.WrongChanNrCases using a negative index: %d.", index_value);
switch (template_selection)
{
  case SPECIFIC_VALUE:
    if(index_value < single_value.n_elements) break;
    // no break
  case OMIT_VALUE:
  case ANY_VALUE:
  case ANY_OR_OMIT:
  case UNINITIALIZED_TEMPLATE:
    set_size(index_value + 1);
    break;
  default:
    TTCN_error("Accessing an element of a non-specific template for type @BTS_Tests.WrongChanNrCases.");
    break;
}
return *single_value.value_elements[index_value];
}

WrongChanNrCase_template& WrongChanNrCases_template::operator[](const INTEGER& index_value)
{
index_value.must_bound("Using an unbound integer value for indexing a template of type @BTS_Tests.WrongChanNrCases.");
return (*this)[(int)index_value];
}

const WrongChanNrCase_template& WrongChanNrCases_template::operator[](int index_value) const
{
if (index_value < 0) TTCN_error("Accessing an element of a template for type @BTS_Tests.WrongChanNrCases using a negative index: %d.", index_value);
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing an element of a non-specific template for type @BTS_Tests.WrongChanNrCases.");
if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @BTS_Tests.WrongChanNrCases: The index is %d, but the template has only %d elements.", index_value, single_value.n_elements);
return *single_value.value_elements[index_value];
}

const WrongChanNrCase_template& WrongChanNrCases_template::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a template of type @BTS_Tests.WrongChanNrCases.");
return (*this)[(int)index_value];
}

void WrongChanNrCases_template::set_size(int new_size)
{
if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a template of type @BTS_Tests.WrongChanNrCases.");
template_sel old_selection = template_selection;
if (old_selection != SPECIFIC_VALUE) {
clean_up();
set_selection(SPECIFIC_VALUE);
single_value.n_elements = 0;
single_value.value_elements = NULL;
}
if (new_size > single_value.n_elements) {
single_value.value_elements = (WrongChanNrCase_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
for (int elem_count = single_value.n_elements; elem_count < new_size; elem_count++)
single_value.value_elements[elem_count] = new WrongChanNrCase_template(ANY_VALUE);
} else {
for (int elem_count = single_value.n_elements; elem_count < new_size; elem_count++)
single_value.value_elements[elem_count] = new WrongChanNrCase_template;
}
single_value.n_elements = new_size;
} else if (new_size < single_value.n_elements) {
for (int elem_count = new_size; elem_count < single_value.n_elements; elem_count++)
delete single_value.value_elements[elem_count];
single_value.value_elements = (WrongChanNrCase_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size);
single_value.n_elements = new_size;
}
}

int WrongChanNrCases_template::n_elem() const
{
  switch (template_selection) {
  case SPECIFIC_VALUE:
    return single_value.n_elements;
    break;
  case VALUE_LIST:
    return value_list.n_values;
    break;
  default:
    TTCN_error("Performing n_elem");
  }
}

int WrongChanNrCases_template::size_of(boolean is_size) const
{
const char* op_name = is_size ? "size" : "length";
int min_size;
boolean has_any_or_none;
if (is_ifpresent) TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.WrongChanNrCases which has an ifpresent attribute.", op_name);
switch (template_selection)
{
case SPECIFIC_VALUE: {
  min_size = 0;
  has_any_or_none = FALSE;
  int elem_count = single_value.n_elements;
  if (!is_size) { while (elem_count>0 && !single_value.value_elements[elem_count-1]->is_bound()) elem_count--; }
  for (int i=0; i<elem_count; i++) {
    switch (single_value.value_elements[i]->get_selection()) {
    case OMIT_VALUE:
      TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.WrongChanNrCases containing omit element.", op_name);
    case ANY_OR_OMIT:
      has_any_or_none = TRUE;
      break;
    default:
      min_size++;
      break;
    }
  }
} break;
case OMIT_VALUE:
  TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.WrongChanNrCases containing omit value.", op_name);
case ANY_VALUE:
case ANY_OR_OMIT:
  min_size = 0;
  has_any_or_none = TRUE;
  break;
case VALUE_LIST:
{
  if (value_list.n_values<1)
    TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.WrongChanNrCases containing an empty list.", op_name);
  int item_size = value_list.list_value[0].size_of(is_size);
  for (unsigned int i = 1; i < value_list.n_values; i++) {
    if (value_list.list_value[i].size_of(is_size)!=item_size)
      TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.WrongChanNrCases containing a value list with different sizes.", op_name);
  }
  min_size = item_size;
  has_any_or_none = FALSE;
  break;
}
case COMPLEMENTED_LIST:
  TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.WrongChanNrCases containing complemented list.", op_name);
default:
  TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @BTS_Tests.WrongChanNrCases.", op_name);
}
return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @BTS_Tests.WrongChanNrCases");
}

boolean WrongChanNrCases_template::match(const WrongChanNrCases& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
int value_length = other_value.size_of();
if (!match_length(value_length)) return FALSE;
switch (template_selection) {
case SPECIFIC_VALUE:
return match_record_of(&other_value, value_length, this, single_value.n_elements, match_function_specific, legacy);
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching with an uninitialized/unsupported template of type @BTS_Tests.WrongChanNrCases.");
}
return FALSE;
}

boolean WrongChanNrCases_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
if (!single_value.value_elements[elem_count]->is_value()) return FALSE;
return TRUE;
}

WrongChanNrCases WrongChanNrCases_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of type @BTS_Tests.WrongChanNrCases.");
WrongChanNrCases ret_val;
ret_val.set_size(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
if (single_value.value_elements[elem_count]->is_bound()) {
ret_val[elem_count] = single_value.value_elements[elem_count]->valueof();
}
return ret_val;
}

WrongChanNrCases WrongChanNrCases_template::substr(int index, int returncount) const
{
if (!is_value()) TTCN_error("The first argument of function substr() is a template with non-specific value.");
return valueof().substr(index, returncount);
}

WrongChanNrCases WrongChanNrCases_template::replace(int index, int len, const WrongChanNrCases_template& repl) const
{
if (!is_value()) TTCN_error("The first argument of function replace() is a template with non-specific value.");
if (!repl.is_value()) TTCN_error("The fourth argument of function replace() is a template with non-specific value.");
return valueof().replace(index, len, repl.valueof());
}

WrongChanNrCases WrongChanNrCases_template::replace(int index, int len, const WrongChanNrCases& repl) const
{
if (!is_value()) TTCN_error("The first argument of function replace() is a template with non-specific value.");
return valueof().replace(index, len, repl);
}

void WrongChanNrCases_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = list_length;
value_list.list_value = new WrongChanNrCases_template[list_length];
break;
default:
TTCN_error("Internal error: Setting an invalid type for a template of type @BTS_Tests.WrongChanNrCases.");
}
set_selection(template_type);
}

WrongChanNrCases_template& WrongChanNrCases_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Internal error: Accessing a list element of a non-list template of type @BTS_Tests.WrongChanNrCases.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @BTS_Tests.WrongChanNrCases.");
return value_list.list_value[list_index];
}

void WrongChanNrCases_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.n_elements > 0) {
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
if (permutation_starts_at(elem_count)) TTCN_Logger::log_event_str("permutation(");
single_value.value_elements[elem_count]->log();
if (permutation_ends_at(elem_count)) TTCN_Logger::log_char(')');
}
TTCN_Logger::log_event_str(" }");
} else TTCN_Logger::log_event_str("{ }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_restricted();
log_ifpresent();
}

void WrongChanNrCases_template::log_match(const WrongChanNrCases& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
}else{
if (template_selection == SPECIFIC_VALUE && single_value.n_elements > 0 && get_number_of_permutations() == 0 && single_value.n_elements == match_value.size_of()) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if(!single_value.value_elements[elem_count]->match(match_value[elem_count], legacy)){
TTCN_Logger::log_logmatch_info("[%d]", elem_count);
single_value.value_elements[elem_count]->log_match(match_value[elem_count], legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
log_match_length(single_value.n_elements);
} else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE && single_value.n_elements > 0 && get_number_of_permutations() == 0 && single_value.n_elements == match_value.size_of()) {
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
single_value.value_elements[elem_count]->log_match(match_value[elem_count], legacy);
}
TTCN_Logger::log_event_str(" }");
log_match_length(single_value.n_elements);
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void WrongChanNrCases_template::encode_text(Text_Buf& text_buf) const
{
encode_text_permutation(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
single_value.value_elements[elem_count]->encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BTS_Tests.WrongChanNrCases.");
}
}

void WrongChanNrCases_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_permutation(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value.n_elements = text_buf.pull_int().get_val();
if (single_value.n_elements < 0) TTCN_error("Text decoder: Negative size was received for a template of type @BTS_Tests.WrongChanNrCases.");
single_value.value_elements = (WrongChanNrCase_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
single_value.value_elements[elem_count] = new WrongChanNrCase_template;
single_value.value_elements[elem_count]->decode_text(text_buf);
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new WrongChanNrCases_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of type @BTS_Tests.WrongChanNrCases.");
}
}

boolean WrongChanNrCases_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean WrongChanNrCases_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void WrongChanNrCases_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
for (int i = 0; i < single_value.n_elements; i++) {
if (single_value.value_elements[i] != NULL) single_value.value_elements[i]->set_implicit_omit();
}
}

void WrongChanNrCases_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE|Module_Param::BC_LIST, "record of template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    WrongChanNrCases_template temp;
    temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = temp;
    break; }
  case Module_Param::MP_Indexed_List:
    if (template_selection!=SPECIFIC_VALUE) set_size(0);
    for (size_t p_i=0; p_i<param.get_size(); ++p_i) {
      (*this)[(int)(param.get_elem(p_i)->get_id()->get_index())].set_param(*param.get_elem(p_i));
    }
    break;
  case Module_Param::MP_Value_List: {
    set_size(param.get_size());
    int curr_idx = 0;
    for (size_t p_i=0; p_i<param.get_size(); ++p_i) {
      switch (param.get_elem(p_i)->get_type()) {
      case Module_Param::MP_NotUsed:
        curr_idx++;
        break;
      case Module_Param::MP_Permutation_Template: {
        int perm_start_idx = curr_idx;
        Module_Param* param_i = param.get_elem(p_i);
        for (size_t perm_i=0; perm_i<param_i->get_size(); perm_i++) {
          (*this)[curr_idx].set_param(*(param_i->get_elem(perm_i)));
          curr_idx++;
        }
        int perm_end_idx = curr_idx - 1;
        add_permutation(perm_start_idx, perm_end_idx);
      } break;
      default:
        (*this)[curr_idx].set_param(*param.get_elem(p_i));
        curr_idx++;
      }
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    WrongChanNrCases_template* precondition = new WrongChanNrCases_template;
    precondition->set_param(*param.get_elem(0));
    WrongChanNrCases_template* implied_template = new WrongChanNrCases_template;
    implied_template->set_param(*param.get_elem(1));
    *this = WrongChanNrCases_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record of template", "@BTS_Tests.WrongChanNrCases");
  }
  is_ifpresent = param.get_ifpresent();
  set_length_range(param);
}

void WrongChanNrCases_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
for (int i=0; i<single_value.n_elements; i++) single_value.value_elements[i]->check_restriction(t_res, t_name ? t_name : "@BTS_Tests.WrongChanNrCases");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@BTS_Tests.WrongChanNrCases");
}

boolean WrongChanNrCases_template::get_istemplate_kind(const char* type) const {
if (!strcmp(type, "AnyElement")) {
  if (template_selection != SPECIFIC_VALUE) {
    return FALSE;
  }
  for (int i = 0; i < single_value.n_elements; i++) {
    if (single_value.value_elements[i]->get_selection() == ANY_VALUE) {
      return TRUE;
    }
  }
  return FALSE;
} else if (!strcmp(type, "AnyElementsOrNone")) {
  if (template_selection != SPECIFIC_VALUE) {
    return FALSE;
  }
  for (int i = 0; i < single_value.n_elements; i++) {
    if (single_value.value_elements[i]->get_selection() == ANY_OR_OMIT) {
      return TRUE;
    }
  }
  return FALSE;
} else if (!strcmp(type, "permutation")) {
  return number_of_permutations;
} else if (!strcmp(type, "length")) {
  return length_restriction_type != NO_LENGTH_RESTRICTION;
} else {
  return Base_Template::get_istemplate_kind(type);
}
}
as__l1__sacch__loop_Default::as__l1__sacch__loop_Default()
 : Default_Base("as_l1_sacch_loop")
{
}

alt_status as__l1__sacch__loop_Default::call_altstep(boolean first_alt_run)
{
return as__l1__sacch__loop_instance(first_alt_run);
}

as__l1__sacch__l1h_Default::as__l1__sacch__l1h_Default(GSM__RR__Types::SacchL1Header& l1h, const BOOLEAN& do__apply)
 : Default_Base("as_l1_sacch_l1h"), par_l1h(l1h), par_do__apply(do__apply)
{
}

alt_status as__l1__sacch__l1h_Default::call_altstep(boolean first_alt_run)
{
return as__l1__sacch__l1h_instance(par_l1h, par_do__apply, first_alt_run);
}

as__l1__dcch__loop_Default::as__l1__dcch__loop_Default()
 : Default_Base("as_l1_dcch_loop")
{
}

alt_status as__l1__dcch__loop_Default::call_altstep(boolean first_alt_run)
{
return as__l1__dcch__loop_instance(first_alt_run);
}

as__l1__tch__loop_Default::as__l1__tch__loop_Default()
 : Default_Base("as_l1_tch_loop")
{
}

alt_status as__l1__tch__loop_Default::call_altstep(boolean first_alt_run)
{
return as__l1__tch__loop_instance(first_alt_run);
}

as__meas__res_Default::as__meas__res_Default(const BOOLEAN& verify__meas)
 : Default_Base("as_meas_res"), par_verify__meas(verify__meas)
{
}

alt_status as__meas__res_Default::call_altstep(boolean first_alt_run)
{
return as__meas__res_instance(par_verify__meas, first_alt_run);
}

allowedFn::allowedFn()
{
}

allowedFn::allowedFn(const INTEGER& par_frame__nr)
  :   field_frame__nr(par_frame__nr)
{
}

allowedFn::allowedFn(const allowedFn& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BTS_Tests.allowedFn.");
if (other_value.frame__nr().is_bound()) field_frame__nr = other_value.frame__nr();
else field_frame__nr.clean_up();
}

void allowedFn::clean_up()
{
field_frame__nr.clean_up();
}

const TTCN_Typedescriptor_t* allowedFn::get_descriptor() const { return &allowedFn_descr_; }
allowedFn& allowedFn::operator=(const allowedFn& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BTS_Tests.allowedFn.");
  if (other_value.frame__nr().is_bound()) field_frame__nr = other_value.frame__nr();
  else field_frame__nr.clean_up();
}
return *this;
}

boolean allowedFn::operator==(const allowedFn& other_value) const
{
return field_frame__nr==other_value.field_frame__nr;
}

boolean allowedFn::is_bound() const
{
return (field_frame__nr.is_bound());
}
boolean allowedFn::is_value() const
{
return field_frame__nr.is_value();
}
void allowedFn::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ frame_nr := ");
field_frame__nr.log();
TTCN_Logger::log_event_str(" }");
}

void allowedFn::set_implicit_omit()
{
if (frame__nr().is_bound()) frame__nr().set_implicit_omit();
}

void allowedFn::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (1<param.get_size()) {
      param.error("record value of type @BTS_Tests.allowedFn has 1 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) frame__nr().set_param(*param.get_elem(0));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "frame_nr")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          frame__nr().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BTS_Tests.allowedFn: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BTS_Tests.allowedFn");
  }
}

void allowedFn::encode_text(Text_Buf& text_buf) const
{
field_frame__nr.encode_text(text_buf);
}

void allowedFn::decode_text(Text_Buf& text_buf)
{
field_frame__nr.decode_text(text_buf);
}

struct allowedFn_template::single_value_struct {
INTEGER_template field_frame__nr;
};

void allowedFn_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_frame__nr = ANY_VALUE;
}
}
}

void allowedFn_template::copy_value(const allowedFn& other_value)
{
single_value = new single_value_struct;
if (other_value.frame__nr().is_bound()) {
  single_value->field_frame__nr = other_value.frame__nr();
} else {
  single_value->field_frame__nr.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void allowedFn_template::copy_template(const allowedFn_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.frame__nr().get_selection()) {
single_value->field_frame__nr = other_value.frame__nr();
} else {
single_value->field_frame__nr.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new allowedFn_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new allowedFn_template(*other_value.implication_.precondition);
implication_.implied_template = new allowedFn_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BTS_Tests.allowedFn.");
break;
}
set_selection(other_value);
}

allowedFn_template::allowedFn_template()
{
}

allowedFn_template::allowedFn_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

allowedFn_template::allowedFn_template(const allowedFn& other_value)
{
copy_value(other_value);
}

allowedFn_template::allowedFn_template(const OPTIONAL<allowedFn>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const allowedFn&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BTS_Tests.allowedFn from an unbound optional field.");
}
}

allowedFn_template::allowedFn_template(allowedFn_template* p_precondition, allowedFn_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

allowedFn_template::allowedFn_template(Dynamic_Match_Interface<allowedFn>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<allowedFn>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

allowedFn_template::allowedFn_template(const allowedFn_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

allowedFn_template::~allowedFn_template()
{
clean_up();
}

allowedFn_template& allowedFn_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

allowedFn_template& allowedFn_template::operator=(const allowedFn& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

allowedFn_template& allowedFn_template::operator=(const OPTIONAL<allowedFn>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const allowedFn&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @BTS_Tests.allowedFn.");
}
return *this;
}

allowedFn_template& allowedFn_template::operator=(const allowedFn_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean allowedFn_template::match(const allowedFn& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.frame__nr().is_bound()) return FALSE;
if(!single_value->field_frame__nr.match(other_value.frame__nr(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BTS_Tests.allowedFn.");
}
return FALSE;
}

boolean allowedFn_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_frame__nr.is_bound();
}

boolean allowedFn_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_frame__nr.is_value();
}

void allowedFn_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

allowedFn allowedFn_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BTS_Tests.allowedFn.");
allowedFn ret_val;
if (single_value->field_frame__nr.is_bound()) {
ret_val.frame__nr() = single_value->field_frame__nr.valueof();
}
return ret_val;
}

void allowedFn_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @BTS_Tests.allowedFn.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new allowedFn_template[list_length];
}

allowedFn_template& allowedFn_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @BTS_Tests.allowedFn.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BTS_Tests.allowedFn.");
return value_list.list_value[list_index];
}

INTEGER_template& allowedFn_template::frame__nr()
{
set_specific();
return single_value->field_frame__nr;
}

const INTEGER_template& allowedFn_template::frame__nr() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field frame_nr of a non-specific template of type @BTS_Tests.allowedFn.");
return single_value->field_frame__nr;
}

int allowedFn_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.allowedFn which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 1;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @BTS_Tests.allowedFn containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.allowedFn containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.allowedFn containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.allowedFn containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.allowedFn containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.allowedFn containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.allowedFn containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.allowedFn containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BTS_Tests.allowedFn.");
  }
  return 0;
}

void allowedFn_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ frame_nr := ");
single_value->field_frame__nr.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void allowedFn_template::log_match(const allowedFn& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_frame__nr.match(match_value.frame__nr(), legacy)){
TTCN_Logger::log_logmatch_info(".frame_nr");
single_value->field_frame__nr.log_match(match_value.frame__nr(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ frame_nr := ");
single_value->field_frame__nr.log_match(match_value.frame__nr(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void allowedFn_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (frame__nr().is_bound()) frame__nr().set_implicit_omit();
}

void allowedFn_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_frame__nr.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BTS_Tests.allowedFn.");
}
}

void allowedFn_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_frame__nr.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new allowedFn_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @BTS_Tests.allowedFn.");
}
}

void allowedFn_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    allowedFn_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (1<param.get_size()) {
      param.error("record template of type @BTS_Tests.allowedFn has 1 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) frame__nr().set_param(*param.get_elem(0));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "frame_nr")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          frame__nr().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BTS_Tests.allowedFn: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    allowedFn_template* precondition = new allowedFn_template;
    precondition->set_param(*param.get_elem(0));
    allowedFn_template* implied_template = new allowedFn_template;
    implied_template->set_param(*param.get_elem(1));
    *this = allowedFn_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BTS_Tests.allowedFn");
  }
  is_ifpresent = param.get_ifpresent();
}

void allowedFn_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_frame__nr.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.allowedFn");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@BTS_Tests.allowedFn");
}

boolean allowedFn_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean allowedFn_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

as__l1__count__paging_Default::as__l1__count__paging_Default(INTEGER& num__paging__rcv__msgs, INTEGER& num__paging__rcv__ids, const PagingTestCfg& cfg)
 : Default_Base("as_l1_count_paging"), par_num__paging__rcv__msgs(num__paging__rcv__msgs), par_num__paging__rcv__ids(num__paging__rcv__ids), par_cfg(cfg)
{
}

alt_status as__l1__count__paging_Default::call_altstep(boolean first_alt_run)
{
return as__l1__count__paging_instance(par_num__paging__rcv__msgs, par_num__paging__rcv__ids, par_cfg, first_alt_run);
}

PagingTestCfg::PagingTestCfg()
{
}

PagingTestCfg::PagingTestCfg(const BOOLEAN& par_combined__ccch,
    const INTEGER& par_bs__ag__blks__res,
    const FLOAT& par_load__factor,
    const INTEGER& par_ps__load__modulus,
    const BOOLEAN& par_ps__wait__cong,
    const FLOAT& par_queue__drain__timeout,
    const BOOLEAN& par_exp__load__ind,
    const BOOLEAN& par_exp__overload,
    const BOOLEAN& par_use__tmsi)
  :   field_combined__ccch(par_combined__ccch),
  field_bs__ag__blks__res(par_bs__ag__blks__res),
  field_load__factor(par_load__factor),
  field_ps__load__modulus(par_ps__load__modulus),
  field_ps__wait__cong(par_ps__wait__cong),
  field_queue__drain__timeout(par_queue__drain__timeout),
  field_exp__load__ind(par_exp__load__ind),
  field_exp__overload(par_exp__overload),
  field_use__tmsi(par_use__tmsi)
{
}

PagingTestCfg::PagingTestCfg(const PagingTestCfg& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BTS_Tests.PagingTestCfg.");
if (other_value.combined__ccch().is_bound()) field_combined__ccch = other_value.combined__ccch();
else field_combined__ccch.clean_up();
if (other_value.bs__ag__blks__res().is_bound()) field_bs__ag__blks__res = other_value.bs__ag__blks__res();
else field_bs__ag__blks__res.clean_up();
if (other_value.load__factor().is_bound()) field_load__factor = other_value.load__factor();
else field_load__factor.clean_up();
if (other_value.ps__load__modulus().is_bound()) field_ps__load__modulus = other_value.ps__load__modulus();
else field_ps__load__modulus.clean_up();
if (other_value.ps__wait__cong().is_bound()) field_ps__wait__cong = other_value.ps__wait__cong();
else field_ps__wait__cong.clean_up();
if (other_value.queue__drain__timeout().is_bound()) field_queue__drain__timeout = other_value.queue__drain__timeout();
else field_queue__drain__timeout.clean_up();
if (other_value.exp__load__ind().is_bound()) field_exp__load__ind = other_value.exp__load__ind();
else field_exp__load__ind.clean_up();
if (other_value.exp__overload().is_bound()) field_exp__overload = other_value.exp__overload();
else field_exp__overload.clean_up();
if (other_value.use__tmsi().is_bound()) field_use__tmsi = other_value.use__tmsi();
else field_use__tmsi.clean_up();
}

void PagingTestCfg::clean_up()
{
field_combined__ccch.clean_up();
field_bs__ag__blks__res.clean_up();
field_load__factor.clean_up();
field_ps__load__modulus.clean_up();
field_ps__wait__cong.clean_up();
field_queue__drain__timeout.clean_up();
field_exp__load__ind.clean_up();
field_exp__overload.clean_up();
field_use__tmsi.clean_up();
}

const TTCN_Typedescriptor_t* PagingTestCfg::get_descriptor() const { return &PagingTestCfg_descr_; }
PagingTestCfg& PagingTestCfg::operator=(const PagingTestCfg& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BTS_Tests.PagingTestCfg.");
  if (other_value.combined__ccch().is_bound()) field_combined__ccch = other_value.combined__ccch();
  else field_combined__ccch.clean_up();
  if (other_value.bs__ag__blks__res().is_bound()) field_bs__ag__blks__res = other_value.bs__ag__blks__res();
  else field_bs__ag__blks__res.clean_up();
  if (other_value.load__factor().is_bound()) field_load__factor = other_value.load__factor();
  else field_load__factor.clean_up();
  if (other_value.ps__load__modulus().is_bound()) field_ps__load__modulus = other_value.ps__load__modulus();
  else field_ps__load__modulus.clean_up();
  if (other_value.ps__wait__cong().is_bound()) field_ps__wait__cong = other_value.ps__wait__cong();
  else field_ps__wait__cong.clean_up();
  if (other_value.queue__drain__timeout().is_bound()) field_queue__drain__timeout = other_value.queue__drain__timeout();
  else field_queue__drain__timeout.clean_up();
  if (other_value.exp__load__ind().is_bound()) field_exp__load__ind = other_value.exp__load__ind();
  else field_exp__load__ind.clean_up();
  if (other_value.exp__overload().is_bound()) field_exp__overload = other_value.exp__overload();
  else field_exp__overload.clean_up();
  if (other_value.use__tmsi().is_bound()) field_use__tmsi = other_value.use__tmsi();
  else field_use__tmsi.clean_up();
}
return *this;
}

boolean PagingTestCfg::operator==(const PagingTestCfg& other_value) const
{
return field_combined__ccch==other_value.field_combined__ccch
  && field_bs__ag__blks__res==other_value.field_bs__ag__blks__res
  && field_load__factor==other_value.field_load__factor
  && field_ps__load__modulus==other_value.field_ps__load__modulus
  && field_ps__wait__cong==other_value.field_ps__wait__cong
  && field_queue__drain__timeout==other_value.field_queue__drain__timeout
  && field_exp__load__ind==other_value.field_exp__load__ind
  && field_exp__overload==other_value.field_exp__overload
  && field_use__tmsi==other_value.field_use__tmsi;
}

boolean PagingTestCfg::is_bound() const
{
return (field_combined__ccch.is_bound())
  || (field_bs__ag__blks__res.is_bound())
  || (field_load__factor.is_bound())
  || (field_ps__load__modulus.is_bound())
  || (field_ps__wait__cong.is_bound())
  || (field_queue__drain__timeout.is_bound())
  || (field_exp__load__ind.is_bound())
  || (field_exp__overload.is_bound())
  || (field_use__tmsi.is_bound());
}
boolean PagingTestCfg::is_value() const
{
return field_combined__ccch.is_value()
  && field_bs__ag__blks__res.is_value()
  && field_load__factor.is_value()
  && field_ps__load__modulus.is_value()
  && field_ps__wait__cong.is_value()
  && field_queue__drain__timeout.is_value()
  && field_exp__load__ind.is_value()
  && field_exp__overload.is_value()
  && field_use__tmsi.is_value();
}
void PagingTestCfg::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ combined_ccch := ");
field_combined__ccch.log();
TTCN_Logger::log_event_str(", bs_ag_blks_res := ");
field_bs__ag__blks__res.log();
TTCN_Logger::log_event_str(", load_factor := ");
field_load__factor.log();
TTCN_Logger::log_event_str(", ps_load_modulus := ");
field_ps__load__modulus.log();
TTCN_Logger::log_event_str(", ps_wait_cong := ");
field_ps__wait__cong.log();
TTCN_Logger::log_event_str(", queue_drain_timeout := ");
field_queue__drain__timeout.log();
TTCN_Logger::log_event_str(", exp_load_ind := ");
field_exp__load__ind.log();
TTCN_Logger::log_event_str(", exp_overload := ");
field_exp__overload.log();
TTCN_Logger::log_event_str(", use_tmsi := ");
field_use__tmsi.log();
TTCN_Logger::log_event_str(" }");
}

void PagingTestCfg::set_implicit_omit()
{
if (combined__ccch().is_bound()) combined__ccch().set_implicit_omit();
if (bs__ag__blks__res().is_bound()) bs__ag__blks__res().set_implicit_omit();
if (load__factor().is_bound()) load__factor().set_implicit_omit();
if (ps__load__modulus().is_bound()) ps__load__modulus().set_implicit_omit();
if (ps__wait__cong().is_bound()) ps__wait__cong().set_implicit_omit();
if (queue__drain__timeout().is_bound()) queue__drain__timeout().set_implicit_omit();
if (exp__load__ind().is_bound()) exp__load__ind().set_implicit_omit();
if (exp__overload().is_bound()) exp__overload().set_implicit_omit();
if (use__tmsi().is_bound()) use__tmsi().set_implicit_omit();
}

void PagingTestCfg::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (9<param.get_size()) {
      param.error("record value of type @BTS_Tests.PagingTestCfg has 9 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) combined__ccch().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) bs__ag__blks__res().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) load__factor().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) ps__load__modulus().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) ps__wait__cong().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) queue__drain__timeout().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) exp__load__ind().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) exp__overload().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) use__tmsi().set_param(*param.get_elem(8));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "combined_ccch")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          combined__ccch().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bs_ag_blks_res")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bs__ag__blks__res().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "load_factor")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          load__factor().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ps_load_modulus")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ps__load__modulus().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ps_wait_cong")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ps__wait__cong().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "queue_drain_timeout")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          queue__drain__timeout().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "exp_load_ind")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          exp__load__ind().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "exp_overload")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          exp__overload().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "use_tmsi")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          use__tmsi().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BTS_Tests.PagingTestCfg: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BTS_Tests.PagingTestCfg");
  }
}

void PagingTestCfg::encode_text(Text_Buf& text_buf) const
{
field_combined__ccch.encode_text(text_buf);
field_bs__ag__blks__res.encode_text(text_buf);
field_load__factor.encode_text(text_buf);
field_ps__load__modulus.encode_text(text_buf);
field_ps__wait__cong.encode_text(text_buf);
field_queue__drain__timeout.encode_text(text_buf);
field_exp__load__ind.encode_text(text_buf);
field_exp__overload.encode_text(text_buf);
field_use__tmsi.encode_text(text_buf);
}

void PagingTestCfg::decode_text(Text_Buf& text_buf)
{
field_combined__ccch.decode_text(text_buf);
field_bs__ag__blks__res.decode_text(text_buf);
field_load__factor.decode_text(text_buf);
field_ps__load__modulus.decode_text(text_buf);
field_ps__wait__cong.decode_text(text_buf);
field_queue__drain__timeout.decode_text(text_buf);
field_exp__load__ind.decode_text(text_buf);
field_exp__overload.decode_text(text_buf);
field_use__tmsi.decode_text(text_buf);
}

struct PagingTestCfg_template::single_value_struct {
BOOLEAN_template field_combined__ccch;
INTEGER_template field_bs__ag__blks__res;
FLOAT_template field_load__factor;
INTEGER_template field_ps__load__modulus;
BOOLEAN_template field_ps__wait__cong;
FLOAT_template field_queue__drain__timeout;
BOOLEAN_template field_exp__load__ind;
BOOLEAN_template field_exp__overload;
BOOLEAN_template field_use__tmsi;
};

void PagingTestCfg_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_combined__ccch = ANY_VALUE;
single_value->field_bs__ag__blks__res = ANY_VALUE;
single_value->field_load__factor = ANY_VALUE;
single_value->field_ps__load__modulus = ANY_VALUE;
single_value->field_ps__wait__cong = ANY_VALUE;
single_value->field_queue__drain__timeout = ANY_VALUE;
single_value->field_exp__load__ind = ANY_VALUE;
single_value->field_exp__overload = ANY_VALUE;
single_value->field_use__tmsi = ANY_VALUE;
}
}
}

void PagingTestCfg_template::copy_value(const PagingTestCfg& other_value)
{
single_value = new single_value_struct;
if (other_value.combined__ccch().is_bound()) {
  single_value->field_combined__ccch = other_value.combined__ccch();
} else {
  single_value->field_combined__ccch.clean_up();
}
if (other_value.bs__ag__blks__res().is_bound()) {
  single_value->field_bs__ag__blks__res = other_value.bs__ag__blks__res();
} else {
  single_value->field_bs__ag__blks__res.clean_up();
}
if (other_value.load__factor().is_bound()) {
  single_value->field_load__factor = other_value.load__factor();
} else {
  single_value->field_load__factor.clean_up();
}
if (other_value.ps__load__modulus().is_bound()) {
  single_value->field_ps__load__modulus = other_value.ps__load__modulus();
} else {
  single_value->field_ps__load__modulus.clean_up();
}
if (other_value.ps__wait__cong().is_bound()) {
  single_value->field_ps__wait__cong = other_value.ps__wait__cong();
} else {
  single_value->field_ps__wait__cong.clean_up();
}
if (other_value.queue__drain__timeout().is_bound()) {
  single_value->field_queue__drain__timeout = other_value.queue__drain__timeout();
} else {
  single_value->field_queue__drain__timeout.clean_up();
}
if (other_value.exp__load__ind().is_bound()) {
  single_value->field_exp__load__ind = other_value.exp__load__ind();
} else {
  single_value->field_exp__load__ind.clean_up();
}
if (other_value.exp__overload().is_bound()) {
  single_value->field_exp__overload = other_value.exp__overload();
} else {
  single_value->field_exp__overload.clean_up();
}
if (other_value.use__tmsi().is_bound()) {
  single_value->field_use__tmsi = other_value.use__tmsi();
} else {
  single_value->field_use__tmsi.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PagingTestCfg_template::copy_template(const PagingTestCfg_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.combined__ccch().get_selection()) {
single_value->field_combined__ccch = other_value.combined__ccch();
} else {
single_value->field_combined__ccch.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.bs__ag__blks__res().get_selection()) {
single_value->field_bs__ag__blks__res = other_value.bs__ag__blks__res();
} else {
single_value->field_bs__ag__blks__res.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.load__factor().get_selection()) {
single_value->field_load__factor = other_value.load__factor();
} else {
single_value->field_load__factor.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ps__load__modulus().get_selection()) {
single_value->field_ps__load__modulus = other_value.ps__load__modulus();
} else {
single_value->field_ps__load__modulus.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.ps__wait__cong().get_selection()) {
single_value->field_ps__wait__cong = other_value.ps__wait__cong();
} else {
single_value->field_ps__wait__cong.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.queue__drain__timeout().get_selection()) {
single_value->field_queue__drain__timeout = other_value.queue__drain__timeout();
} else {
single_value->field_queue__drain__timeout.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.exp__load__ind().get_selection()) {
single_value->field_exp__load__ind = other_value.exp__load__ind();
} else {
single_value->field_exp__load__ind.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.exp__overload().get_selection()) {
single_value->field_exp__overload = other_value.exp__overload();
} else {
single_value->field_exp__overload.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.use__tmsi().get_selection()) {
single_value->field_use__tmsi = other_value.use__tmsi();
} else {
single_value->field_use__tmsi.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PagingTestCfg_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PagingTestCfg_template(*other_value.implication_.precondition);
implication_.implied_template = new PagingTestCfg_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BTS_Tests.PagingTestCfg.");
break;
}
set_selection(other_value);
}

PagingTestCfg_template::PagingTestCfg_template()
{
}

PagingTestCfg_template::PagingTestCfg_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PagingTestCfg_template::PagingTestCfg_template(const PagingTestCfg& other_value)
{
copy_value(other_value);
}

PagingTestCfg_template::PagingTestCfg_template(const OPTIONAL<PagingTestCfg>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PagingTestCfg&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BTS_Tests.PagingTestCfg from an unbound optional field.");
}
}

PagingTestCfg_template::PagingTestCfg_template(PagingTestCfg_template* p_precondition, PagingTestCfg_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PagingTestCfg_template::PagingTestCfg_template(Dynamic_Match_Interface<PagingTestCfg>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PagingTestCfg>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PagingTestCfg_template::PagingTestCfg_template(const PagingTestCfg_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PagingTestCfg_template::~PagingTestCfg_template()
{
clean_up();
}

PagingTestCfg_template& PagingTestCfg_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PagingTestCfg_template& PagingTestCfg_template::operator=(const PagingTestCfg& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PagingTestCfg_template& PagingTestCfg_template::operator=(const OPTIONAL<PagingTestCfg>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PagingTestCfg&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @BTS_Tests.PagingTestCfg.");
}
return *this;
}

PagingTestCfg_template& PagingTestCfg_template::operator=(const PagingTestCfg_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PagingTestCfg_template::match(const PagingTestCfg& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.combined__ccch().is_bound()) return FALSE;
if(!single_value->field_combined__ccch.match(other_value.combined__ccch(), legacy))return FALSE;
if(!other_value.bs__ag__blks__res().is_bound()) return FALSE;
if(!single_value->field_bs__ag__blks__res.match(other_value.bs__ag__blks__res(), legacy))return FALSE;
if(!other_value.load__factor().is_bound()) return FALSE;
if(!single_value->field_load__factor.match(other_value.load__factor(), legacy))return FALSE;
if(!other_value.ps__load__modulus().is_bound()) return FALSE;
if(!single_value->field_ps__load__modulus.match(other_value.ps__load__modulus(), legacy))return FALSE;
if(!other_value.ps__wait__cong().is_bound()) return FALSE;
if(!single_value->field_ps__wait__cong.match(other_value.ps__wait__cong(), legacy))return FALSE;
if(!other_value.queue__drain__timeout().is_bound()) return FALSE;
if(!single_value->field_queue__drain__timeout.match(other_value.queue__drain__timeout(), legacy))return FALSE;
if(!other_value.exp__load__ind().is_bound()) return FALSE;
if(!single_value->field_exp__load__ind.match(other_value.exp__load__ind(), legacy))return FALSE;
if(!other_value.exp__overload().is_bound()) return FALSE;
if(!single_value->field_exp__overload.match(other_value.exp__overload(), legacy))return FALSE;
if(!other_value.use__tmsi().is_bound()) return FALSE;
if(!single_value->field_use__tmsi.match(other_value.use__tmsi(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BTS_Tests.PagingTestCfg.");
}
return FALSE;
}

boolean PagingTestCfg_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_combined__ccch.is_bound()
 || single_value->field_bs__ag__blks__res.is_bound()
 || single_value->field_load__factor.is_bound()
 || single_value->field_ps__load__modulus.is_bound()
 || single_value->field_ps__wait__cong.is_bound()
 || single_value->field_queue__drain__timeout.is_bound()
 || single_value->field_exp__load__ind.is_bound()
 || single_value->field_exp__overload.is_bound()
 || single_value->field_use__tmsi.is_bound();
}

boolean PagingTestCfg_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_combined__ccch.is_value()
 && single_value->field_bs__ag__blks__res.is_value()
 && single_value->field_load__factor.is_value()
 && single_value->field_ps__load__modulus.is_value()
 && single_value->field_ps__wait__cong.is_value()
 && single_value->field_queue__drain__timeout.is_value()
 && single_value->field_exp__load__ind.is_value()
 && single_value->field_exp__overload.is_value()
 && single_value->field_use__tmsi.is_value();
}

void PagingTestCfg_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

PagingTestCfg PagingTestCfg_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BTS_Tests.PagingTestCfg.");
PagingTestCfg ret_val;
if (single_value->field_combined__ccch.is_bound()) {
ret_val.combined__ccch() = single_value->field_combined__ccch.valueof();
}
if (single_value->field_bs__ag__blks__res.is_bound()) {
ret_val.bs__ag__blks__res() = single_value->field_bs__ag__blks__res.valueof();
}
if (single_value->field_load__factor.is_bound()) {
ret_val.load__factor() = single_value->field_load__factor.valueof();
}
if (single_value->field_ps__load__modulus.is_bound()) {
ret_val.ps__load__modulus() = single_value->field_ps__load__modulus.valueof();
}
if (single_value->field_ps__wait__cong.is_bound()) {
ret_val.ps__wait__cong() = single_value->field_ps__wait__cong.valueof();
}
if (single_value->field_queue__drain__timeout.is_bound()) {
ret_val.queue__drain__timeout() = single_value->field_queue__drain__timeout.valueof();
}
if (single_value->field_exp__load__ind.is_bound()) {
ret_val.exp__load__ind() = single_value->field_exp__load__ind.valueof();
}
if (single_value->field_exp__overload.is_bound()) {
ret_val.exp__overload() = single_value->field_exp__overload.valueof();
}
if (single_value->field_use__tmsi.is_bound()) {
ret_val.use__tmsi() = single_value->field_use__tmsi.valueof();
}
return ret_val;
}

void PagingTestCfg_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @BTS_Tests.PagingTestCfg.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PagingTestCfg_template[list_length];
}

PagingTestCfg_template& PagingTestCfg_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @BTS_Tests.PagingTestCfg.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BTS_Tests.PagingTestCfg.");
return value_list.list_value[list_index];
}

BOOLEAN_template& PagingTestCfg_template::combined__ccch()
{
set_specific();
return single_value->field_combined__ccch;
}

const BOOLEAN_template& PagingTestCfg_template::combined__ccch() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field combined_ccch of a non-specific template of type @BTS_Tests.PagingTestCfg.");
return single_value->field_combined__ccch;
}

INTEGER_template& PagingTestCfg_template::bs__ag__blks__res()
{
set_specific();
return single_value->field_bs__ag__blks__res;
}

const INTEGER_template& PagingTestCfg_template::bs__ag__blks__res() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field bs_ag_blks_res of a non-specific template of type @BTS_Tests.PagingTestCfg.");
return single_value->field_bs__ag__blks__res;
}

FLOAT_template& PagingTestCfg_template::load__factor()
{
set_specific();
return single_value->field_load__factor;
}

const FLOAT_template& PagingTestCfg_template::load__factor() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field load_factor of a non-specific template of type @BTS_Tests.PagingTestCfg.");
return single_value->field_load__factor;
}

INTEGER_template& PagingTestCfg_template::ps__load__modulus()
{
set_specific();
return single_value->field_ps__load__modulus;
}

const INTEGER_template& PagingTestCfg_template::ps__load__modulus() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ps_load_modulus of a non-specific template of type @BTS_Tests.PagingTestCfg.");
return single_value->field_ps__load__modulus;
}

BOOLEAN_template& PagingTestCfg_template::ps__wait__cong()
{
set_specific();
return single_value->field_ps__wait__cong;
}

const BOOLEAN_template& PagingTestCfg_template::ps__wait__cong() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field ps_wait_cong of a non-specific template of type @BTS_Tests.PagingTestCfg.");
return single_value->field_ps__wait__cong;
}

FLOAT_template& PagingTestCfg_template::queue__drain__timeout()
{
set_specific();
return single_value->field_queue__drain__timeout;
}

const FLOAT_template& PagingTestCfg_template::queue__drain__timeout() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field queue_drain_timeout of a non-specific template of type @BTS_Tests.PagingTestCfg.");
return single_value->field_queue__drain__timeout;
}

BOOLEAN_template& PagingTestCfg_template::exp__load__ind()
{
set_specific();
return single_value->field_exp__load__ind;
}

const BOOLEAN_template& PagingTestCfg_template::exp__load__ind() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field exp_load_ind of a non-specific template of type @BTS_Tests.PagingTestCfg.");
return single_value->field_exp__load__ind;
}

BOOLEAN_template& PagingTestCfg_template::exp__overload()
{
set_specific();
return single_value->field_exp__overload;
}

const BOOLEAN_template& PagingTestCfg_template::exp__overload() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field exp_overload of a non-specific template of type @BTS_Tests.PagingTestCfg.");
return single_value->field_exp__overload;
}

BOOLEAN_template& PagingTestCfg_template::use__tmsi()
{
set_specific();
return single_value->field_use__tmsi;
}

const BOOLEAN_template& PagingTestCfg_template::use__tmsi() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field use_tmsi of a non-specific template of type @BTS_Tests.PagingTestCfg.");
return single_value->field_use__tmsi;
}

int PagingTestCfg_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.PagingTestCfg which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 9;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @BTS_Tests.PagingTestCfg containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.PagingTestCfg containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.PagingTestCfg containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.PagingTestCfg containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.PagingTestCfg containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.PagingTestCfg containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.PagingTestCfg containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.PagingTestCfg containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BTS_Tests.PagingTestCfg.");
  }
  return 0;
}

void PagingTestCfg_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ combined_ccch := ");
single_value->field_combined__ccch.log();
TTCN_Logger::log_event_str(", bs_ag_blks_res := ");
single_value->field_bs__ag__blks__res.log();
TTCN_Logger::log_event_str(", load_factor := ");
single_value->field_load__factor.log();
TTCN_Logger::log_event_str(", ps_load_modulus := ");
single_value->field_ps__load__modulus.log();
TTCN_Logger::log_event_str(", ps_wait_cong := ");
single_value->field_ps__wait__cong.log();
TTCN_Logger::log_event_str(", queue_drain_timeout := ");
single_value->field_queue__drain__timeout.log();
TTCN_Logger::log_event_str(", exp_load_ind := ");
single_value->field_exp__load__ind.log();
TTCN_Logger::log_event_str(", exp_overload := ");
single_value->field_exp__overload.log();
TTCN_Logger::log_event_str(", use_tmsi := ");
single_value->field_use__tmsi.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PagingTestCfg_template::log_match(const PagingTestCfg& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_combined__ccch.match(match_value.combined__ccch(), legacy)){
TTCN_Logger::log_logmatch_info(".combined_ccch");
single_value->field_combined__ccch.log_match(match_value.combined__ccch(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_bs__ag__blks__res.match(match_value.bs__ag__blks__res(), legacy)){
TTCN_Logger::log_logmatch_info(".bs_ag_blks_res");
single_value->field_bs__ag__blks__res.log_match(match_value.bs__ag__blks__res(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_load__factor.match(match_value.load__factor(), legacy)){
TTCN_Logger::log_logmatch_info(".load_factor");
single_value->field_load__factor.log_match(match_value.load__factor(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ps__load__modulus.match(match_value.ps__load__modulus(), legacy)){
TTCN_Logger::log_logmatch_info(".ps_load_modulus");
single_value->field_ps__load__modulus.log_match(match_value.ps__load__modulus(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_ps__wait__cong.match(match_value.ps__wait__cong(), legacy)){
TTCN_Logger::log_logmatch_info(".ps_wait_cong");
single_value->field_ps__wait__cong.log_match(match_value.ps__wait__cong(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_queue__drain__timeout.match(match_value.queue__drain__timeout(), legacy)){
TTCN_Logger::log_logmatch_info(".queue_drain_timeout");
single_value->field_queue__drain__timeout.log_match(match_value.queue__drain__timeout(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_exp__load__ind.match(match_value.exp__load__ind(), legacy)){
TTCN_Logger::log_logmatch_info(".exp_load_ind");
single_value->field_exp__load__ind.log_match(match_value.exp__load__ind(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_exp__overload.match(match_value.exp__overload(), legacy)){
TTCN_Logger::log_logmatch_info(".exp_overload");
single_value->field_exp__overload.log_match(match_value.exp__overload(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_use__tmsi.match(match_value.use__tmsi(), legacy)){
TTCN_Logger::log_logmatch_info(".use_tmsi");
single_value->field_use__tmsi.log_match(match_value.use__tmsi(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ combined_ccch := ");
single_value->field_combined__ccch.log_match(match_value.combined__ccch(), legacy);
TTCN_Logger::log_event_str(", bs_ag_blks_res := ");
single_value->field_bs__ag__blks__res.log_match(match_value.bs__ag__blks__res(), legacy);
TTCN_Logger::log_event_str(", load_factor := ");
single_value->field_load__factor.log_match(match_value.load__factor(), legacy);
TTCN_Logger::log_event_str(", ps_load_modulus := ");
single_value->field_ps__load__modulus.log_match(match_value.ps__load__modulus(), legacy);
TTCN_Logger::log_event_str(", ps_wait_cong := ");
single_value->field_ps__wait__cong.log_match(match_value.ps__wait__cong(), legacy);
TTCN_Logger::log_event_str(", queue_drain_timeout := ");
single_value->field_queue__drain__timeout.log_match(match_value.queue__drain__timeout(), legacy);
TTCN_Logger::log_event_str(", exp_load_ind := ");
single_value->field_exp__load__ind.log_match(match_value.exp__load__ind(), legacy);
TTCN_Logger::log_event_str(", exp_overload := ");
single_value->field_exp__overload.log_match(match_value.exp__overload(), legacy);
TTCN_Logger::log_event_str(", use_tmsi := ");
single_value->field_use__tmsi.log_match(match_value.use__tmsi(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PagingTestCfg_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (combined__ccch().is_bound()) combined__ccch().set_implicit_omit();
if (bs__ag__blks__res().is_bound()) bs__ag__blks__res().set_implicit_omit();
if (load__factor().is_bound()) load__factor().set_implicit_omit();
if (ps__load__modulus().is_bound()) ps__load__modulus().set_implicit_omit();
if (ps__wait__cong().is_bound()) ps__wait__cong().set_implicit_omit();
if (queue__drain__timeout().is_bound()) queue__drain__timeout().set_implicit_omit();
if (exp__load__ind().is_bound()) exp__load__ind().set_implicit_omit();
if (exp__overload().is_bound()) exp__overload().set_implicit_omit();
if (use__tmsi().is_bound()) use__tmsi().set_implicit_omit();
}

void PagingTestCfg_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_combined__ccch.encode_text(text_buf);
single_value->field_bs__ag__blks__res.encode_text(text_buf);
single_value->field_load__factor.encode_text(text_buf);
single_value->field_ps__load__modulus.encode_text(text_buf);
single_value->field_ps__wait__cong.encode_text(text_buf);
single_value->field_queue__drain__timeout.encode_text(text_buf);
single_value->field_exp__load__ind.encode_text(text_buf);
single_value->field_exp__overload.encode_text(text_buf);
single_value->field_use__tmsi.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BTS_Tests.PagingTestCfg.");
}
}

void PagingTestCfg_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_combined__ccch.decode_text(text_buf);
single_value->field_bs__ag__blks__res.decode_text(text_buf);
single_value->field_load__factor.decode_text(text_buf);
single_value->field_ps__load__modulus.decode_text(text_buf);
single_value->field_ps__wait__cong.decode_text(text_buf);
single_value->field_queue__drain__timeout.decode_text(text_buf);
single_value->field_exp__load__ind.decode_text(text_buf);
single_value->field_exp__overload.decode_text(text_buf);
single_value->field_use__tmsi.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PagingTestCfg_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @BTS_Tests.PagingTestCfg.");
}
}

void PagingTestCfg_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PagingTestCfg_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (9<param.get_size()) {
      param.error("record template of type @BTS_Tests.PagingTestCfg has 9 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) combined__ccch().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) bs__ag__blks__res().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) load__factor().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) ps__load__modulus().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) ps__wait__cong().set_param(*param.get_elem(4));
    if (param.get_size()>5 && param.get_elem(5)->get_type()!=Module_Param::MP_NotUsed) queue__drain__timeout().set_param(*param.get_elem(5));
    if (param.get_size()>6 && param.get_elem(6)->get_type()!=Module_Param::MP_NotUsed) exp__load__ind().set_param(*param.get_elem(6));
    if (param.get_size()>7 && param.get_elem(7)->get_type()!=Module_Param::MP_NotUsed) exp__overload().set_param(*param.get_elem(7));
    if (param.get_size()>8 && param.get_elem(8)->get_type()!=Module_Param::MP_NotUsed) use__tmsi().set_param(*param.get_elem(8));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "combined_ccch")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          combined__ccch().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "bs_ag_blks_res")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          bs__ag__blks__res().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "load_factor")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          load__factor().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ps_load_modulus")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ps__load__modulus().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "ps_wait_cong")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          ps__wait__cong().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "queue_drain_timeout")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          queue__drain__timeout().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "exp_load_ind")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          exp__load__ind().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "exp_overload")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          exp__overload().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "use_tmsi")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          use__tmsi().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BTS_Tests.PagingTestCfg: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PagingTestCfg_template* precondition = new PagingTestCfg_template;
    precondition->set_param(*param.get_elem(0));
    PagingTestCfg_template* implied_template = new PagingTestCfg_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PagingTestCfg_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BTS_Tests.PagingTestCfg");
  }
  is_ifpresent = param.get_ifpresent();
}

void PagingTestCfg_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_combined__ccch.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.PagingTestCfg");
single_value->field_bs__ag__blks__res.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.PagingTestCfg");
single_value->field_load__factor.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.PagingTestCfg");
single_value->field_ps__load__modulus.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.PagingTestCfg");
single_value->field_ps__wait__cong.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.PagingTestCfg");
single_value->field_queue__drain__timeout.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.PagingTestCfg");
single_value->field_exp__load__ind.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.PagingTestCfg");
single_value->field_exp__overload.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.PagingTestCfg");
single_value->field_use__tmsi.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.PagingTestCfg");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@BTS_Tests.PagingTestCfg");
}

boolean PagingTestCfg_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PagingTestCfg_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

PagingTestState::PagingTestState()
{
}

PagingTestState::PagingTestState(const INTEGER& par_num__paging__sent,
    const INTEGER& par_num__paging__rcv__msgs,
    const INTEGER& par_num__paging__rcv__ids,
    const INTEGER& par_num__overload,
    const BOOLEAN& par_cong__detected)
  :   field_num__paging__sent(par_num__paging__sent),
  field_num__paging__rcv__msgs(par_num__paging__rcv__msgs),
  field_num__paging__rcv__ids(par_num__paging__rcv__ids),
  field_num__overload(par_num__overload),
  field_cong__detected(par_cong__detected)
{
}

PagingTestState::PagingTestState(const PagingTestState& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BTS_Tests.PagingTestState.");
if (other_value.num__paging__sent().is_bound()) field_num__paging__sent = other_value.num__paging__sent();
else field_num__paging__sent.clean_up();
if (other_value.num__paging__rcv__msgs().is_bound()) field_num__paging__rcv__msgs = other_value.num__paging__rcv__msgs();
else field_num__paging__rcv__msgs.clean_up();
if (other_value.num__paging__rcv__ids().is_bound()) field_num__paging__rcv__ids = other_value.num__paging__rcv__ids();
else field_num__paging__rcv__ids.clean_up();
if (other_value.num__overload().is_bound()) field_num__overload = other_value.num__overload();
else field_num__overload.clean_up();
if (other_value.cong__detected().is_bound()) field_cong__detected = other_value.cong__detected();
else field_cong__detected.clean_up();
}

void PagingTestState::clean_up()
{
field_num__paging__sent.clean_up();
field_num__paging__rcv__msgs.clean_up();
field_num__paging__rcv__ids.clean_up();
field_num__overload.clean_up();
field_cong__detected.clean_up();
}

const TTCN_Typedescriptor_t* PagingTestState::get_descriptor() const { return &PagingTestState_descr_; }
PagingTestState& PagingTestState::operator=(const PagingTestState& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BTS_Tests.PagingTestState.");
  if (other_value.num__paging__sent().is_bound()) field_num__paging__sent = other_value.num__paging__sent();
  else field_num__paging__sent.clean_up();
  if (other_value.num__paging__rcv__msgs().is_bound()) field_num__paging__rcv__msgs = other_value.num__paging__rcv__msgs();
  else field_num__paging__rcv__msgs.clean_up();
  if (other_value.num__paging__rcv__ids().is_bound()) field_num__paging__rcv__ids = other_value.num__paging__rcv__ids();
  else field_num__paging__rcv__ids.clean_up();
  if (other_value.num__overload().is_bound()) field_num__overload = other_value.num__overload();
  else field_num__overload.clean_up();
  if (other_value.cong__detected().is_bound()) field_cong__detected = other_value.cong__detected();
  else field_cong__detected.clean_up();
}
return *this;
}

boolean PagingTestState::operator==(const PagingTestState& other_value) const
{
return field_num__paging__sent==other_value.field_num__paging__sent
  && field_num__paging__rcv__msgs==other_value.field_num__paging__rcv__msgs
  && field_num__paging__rcv__ids==other_value.field_num__paging__rcv__ids
  && field_num__overload==other_value.field_num__overload
  && field_cong__detected==other_value.field_cong__detected;
}

boolean PagingTestState::is_bound() const
{
return (field_num__paging__sent.is_bound())
  || (field_num__paging__rcv__msgs.is_bound())
  || (field_num__paging__rcv__ids.is_bound())
  || (field_num__overload.is_bound())
  || (field_cong__detected.is_bound());
}
boolean PagingTestState::is_value() const
{
return field_num__paging__sent.is_value()
  && field_num__paging__rcv__msgs.is_value()
  && field_num__paging__rcv__ids.is_value()
  && field_num__overload.is_value()
  && field_cong__detected.is_value();
}
void PagingTestState::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ num_paging_sent := ");
field_num__paging__sent.log();
TTCN_Logger::log_event_str(", num_paging_rcv_msgs := ");
field_num__paging__rcv__msgs.log();
TTCN_Logger::log_event_str(", num_paging_rcv_ids := ");
field_num__paging__rcv__ids.log();
TTCN_Logger::log_event_str(", num_overload := ");
field_num__overload.log();
TTCN_Logger::log_event_str(", cong_detected := ");
field_cong__detected.log();
TTCN_Logger::log_event_str(" }");
}

void PagingTestState::set_implicit_omit()
{
if (num__paging__sent().is_bound()) num__paging__sent().set_implicit_omit();
if (num__paging__rcv__msgs().is_bound()) num__paging__rcv__msgs().set_implicit_omit();
if (num__paging__rcv__ids().is_bound()) num__paging__rcv__ids().set_implicit_omit();
if (num__overload().is_bound()) num__overload().set_implicit_omit();
if (cong__detected().is_bound()) cong__detected().set_implicit_omit();
}

void PagingTestState::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (5<param.get_size()) {
      param.error("record value of type @BTS_Tests.PagingTestState has 5 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) num__paging__sent().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) num__paging__rcv__msgs().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) num__paging__rcv__ids().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) num__overload().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) cong__detected().set_param(*param.get_elem(4));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "num_paging_sent")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          num__paging__sent().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "num_paging_rcv_msgs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          num__paging__rcv__msgs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "num_paging_rcv_ids")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          num__paging__rcv__ids().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "num_overload")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          num__overload().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cong_detected")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cong__detected().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BTS_Tests.PagingTestState: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BTS_Tests.PagingTestState");
  }
}

void PagingTestState::encode_text(Text_Buf& text_buf) const
{
field_num__paging__sent.encode_text(text_buf);
field_num__paging__rcv__msgs.encode_text(text_buf);
field_num__paging__rcv__ids.encode_text(text_buf);
field_num__overload.encode_text(text_buf);
field_cong__detected.encode_text(text_buf);
}

void PagingTestState::decode_text(Text_Buf& text_buf)
{
field_num__paging__sent.decode_text(text_buf);
field_num__paging__rcv__msgs.decode_text(text_buf);
field_num__paging__rcv__ids.decode_text(text_buf);
field_num__overload.decode_text(text_buf);
field_cong__detected.decode_text(text_buf);
}

struct PagingTestState_template::single_value_struct {
INTEGER_template field_num__paging__sent;
INTEGER_template field_num__paging__rcv__msgs;
INTEGER_template field_num__paging__rcv__ids;
INTEGER_template field_num__overload;
BOOLEAN_template field_cong__detected;
};

void PagingTestState_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_num__paging__sent = ANY_VALUE;
single_value->field_num__paging__rcv__msgs = ANY_VALUE;
single_value->field_num__paging__rcv__ids = ANY_VALUE;
single_value->field_num__overload = ANY_VALUE;
single_value->field_cong__detected = ANY_VALUE;
}
}
}

void PagingTestState_template::copy_value(const PagingTestState& other_value)
{
single_value = new single_value_struct;
if (other_value.num__paging__sent().is_bound()) {
  single_value->field_num__paging__sent = other_value.num__paging__sent();
} else {
  single_value->field_num__paging__sent.clean_up();
}
if (other_value.num__paging__rcv__msgs().is_bound()) {
  single_value->field_num__paging__rcv__msgs = other_value.num__paging__rcv__msgs();
} else {
  single_value->field_num__paging__rcv__msgs.clean_up();
}
if (other_value.num__paging__rcv__ids().is_bound()) {
  single_value->field_num__paging__rcv__ids = other_value.num__paging__rcv__ids();
} else {
  single_value->field_num__paging__rcv__ids.clean_up();
}
if (other_value.num__overload().is_bound()) {
  single_value->field_num__overload = other_value.num__overload();
} else {
  single_value->field_num__overload.clean_up();
}
if (other_value.cong__detected().is_bound()) {
  single_value->field_cong__detected = other_value.cong__detected();
} else {
  single_value->field_cong__detected.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void PagingTestState_template::copy_template(const PagingTestState_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.num__paging__sent().get_selection()) {
single_value->field_num__paging__sent = other_value.num__paging__sent();
} else {
single_value->field_num__paging__sent.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.num__paging__rcv__msgs().get_selection()) {
single_value->field_num__paging__rcv__msgs = other_value.num__paging__rcv__msgs();
} else {
single_value->field_num__paging__rcv__msgs.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.num__paging__rcv__ids().get_selection()) {
single_value->field_num__paging__rcv__ids = other_value.num__paging__rcv__ids();
} else {
single_value->field_num__paging__rcv__ids.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.num__overload().get_selection()) {
single_value->field_num__overload = other_value.num__overload();
} else {
single_value->field_num__overload.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.cong__detected().get_selection()) {
single_value->field_cong__detected = other_value.cong__detected();
} else {
single_value->field_cong__detected.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new PagingTestState_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new PagingTestState_template(*other_value.implication_.precondition);
implication_.implied_template = new PagingTestState_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BTS_Tests.PagingTestState.");
break;
}
set_selection(other_value);
}

PagingTestState_template::PagingTestState_template()
{
}

PagingTestState_template::PagingTestState_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

PagingTestState_template::PagingTestState_template(const PagingTestState& other_value)
{
copy_value(other_value);
}

PagingTestState_template::PagingTestState_template(const OPTIONAL<PagingTestState>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PagingTestState&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BTS_Tests.PagingTestState from an unbound optional field.");
}
}

PagingTestState_template::PagingTestState_template(PagingTestState_template* p_precondition, PagingTestState_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

PagingTestState_template::PagingTestState_template(Dynamic_Match_Interface<PagingTestState>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<PagingTestState>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

PagingTestState_template::PagingTestState_template(const PagingTestState_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

PagingTestState_template::~PagingTestState_template()
{
clean_up();
}

PagingTestState_template& PagingTestState_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

PagingTestState_template& PagingTestState_template::operator=(const PagingTestState& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

PagingTestState_template& PagingTestState_template::operator=(const OPTIONAL<PagingTestState>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const PagingTestState&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @BTS_Tests.PagingTestState.");
}
return *this;
}

PagingTestState_template& PagingTestState_template::operator=(const PagingTestState_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean PagingTestState_template::match(const PagingTestState& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.num__paging__sent().is_bound()) return FALSE;
if(!single_value->field_num__paging__sent.match(other_value.num__paging__sent(), legacy))return FALSE;
if(!other_value.num__paging__rcv__msgs().is_bound()) return FALSE;
if(!single_value->field_num__paging__rcv__msgs.match(other_value.num__paging__rcv__msgs(), legacy))return FALSE;
if(!other_value.num__paging__rcv__ids().is_bound()) return FALSE;
if(!single_value->field_num__paging__rcv__ids.match(other_value.num__paging__rcv__ids(), legacy))return FALSE;
if(!other_value.num__overload().is_bound()) return FALSE;
if(!single_value->field_num__overload.match(other_value.num__overload(), legacy))return FALSE;
if(!other_value.cong__detected().is_bound()) return FALSE;
if(!single_value->field_cong__detected.match(other_value.cong__detected(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BTS_Tests.PagingTestState.");
}
return FALSE;
}

boolean PagingTestState_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_num__paging__sent.is_bound()
 || single_value->field_num__paging__rcv__msgs.is_bound()
 || single_value->field_num__paging__rcv__ids.is_bound()
 || single_value->field_num__overload.is_bound()
 || single_value->field_cong__detected.is_bound();
}

boolean PagingTestState_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_num__paging__sent.is_value()
 && single_value->field_num__paging__rcv__msgs.is_value()
 && single_value->field_num__paging__rcv__ids.is_value()
 && single_value->field_num__overload.is_value()
 && single_value->field_cong__detected.is_value();
}

void PagingTestState_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

PagingTestState PagingTestState_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BTS_Tests.PagingTestState.");
PagingTestState ret_val;
if (single_value->field_num__paging__sent.is_bound()) {
ret_val.num__paging__sent() = single_value->field_num__paging__sent.valueof();
}
if (single_value->field_num__paging__rcv__msgs.is_bound()) {
ret_val.num__paging__rcv__msgs() = single_value->field_num__paging__rcv__msgs.valueof();
}
if (single_value->field_num__paging__rcv__ids.is_bound()) {
ret_val.num__paging__rcv__ids() = single_value->field_num__paging__rcv__ids.valueof();
}
if (single_value->field_num__overload.is_bound()) {
ret_val.num__overload() = single_value->field_num__overload.valueof();
}
if (single_value->field_cong__detected.is_bound()) {
ret_val.cong__detected() = single_value->field_cong__detected.valueof();
}
return ret_val;
}

void PagingTestState_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @BTS_Tests.PagingTestState.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new PagingTestState_template[list_length];
}

PagingTestState_template& PagingTestState_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @BTS_Tests.PagingTestState.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BTS_Tests.PagingTestState.");
return value_list.list_value[list_index];
}

INTEGER_template& PagingTestState_template::num__paging__sent()
{
set_specific();
return single_value->field_num__paging__sent;
}

const INTEGER_template& PagingTestState_template::num__paging__sent() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field num_paging_sent of a non-specific template of type @BTS_Tests.PagingTestState.");
return single_value->field_num__paging__sent;
}

INTEGER_template& PagingTestState_template::num__paging__rcv__msgs()
{
set_specific();
return single_value->field_num__paging__rcv__msgs;
}

const INTEGER_template& PagingTestState_template::num__paging__rcv__msgs() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field num_paging_rcv_msgs of a non-specific template of type @BTS_Tests.PagingTestState.");
return single_value->field_num__paging__rcv__msgs;
}

INTEGER_template& PagingTestState_template::num__paging__rcv__ids()
{
set_specific();
return single_value->field_num__paging__rcv__ids;
}

const INTEGER_template& PagingTestState_template::num__paging__rcv__ids() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field num_paging_rcv_ids of a non-specific template of type @BTS_Tests.PagingTestState.");
return single_value->field_num__paging__rcv__ids;
}

INTEGER_template& PagingTestState_template::num__overload()
{
set_specific();
return single_value->field_num__overload;
}

const INTEGER_template& PagingTestState_template::num__overload() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field num_overload of a non-specific template of type @BTS_Tests.PagingTestState.");
return single_value->field_num__overload;
}

BOOLEAN_template& PagingTestState_template::cong__detected()
{
set_specific();
return single_value->field_cong__detected;
}

const BOOLEAN_template& PagingTestState_template::cong__detected() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field cong_detected of a non-specific template of type @BTS_Tests.PagingTestState.");
return single_value->field_cong__detected;
}

int PagingTestState_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.PagingTestState which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 5;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @BTS_Tests.PagingTestState containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.PagingTestState containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.PagingTestState containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.PagingTestState containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.PagingTestState containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.PagingTestState containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.PagingTestState containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.PagingTestState containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BTS_Tests.PagingTestState.");
  }
  return 0;
}

void PagingTestState_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ num_paging_sent := ");
single_value->field_num__paging__sent.log();
TTCN_Logger::log_event_str(", num_paging_rcv_msgs := ");
single_value->field_num__paging__rcv__msgs.log();
TTCN_Logger::log_event_str(", num_paging_rcv_ids := ");
single_value->field_num__paging__rcv__ids.log();
TTCN_Logger::log_event_str(", num_overload := ");
single_value->field_num__overload.log();
TTCN_Logger::log_event_str(", cong_detected := ");
single_value->field_cong__detected.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void PagingTestState_template::log_match(const PagingTestState& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_num__paging__sent.match(match_value.num__paging__sent(), legacy)){
TTCN_Logger::log_logmatch_info(".num_paging_sent");
single_value->field_num__paging__sent.log_match(match_value.num__paging__sent(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_num__paging__rcv__msgs.match(match_value.num__paging__rcv__msgs(), legacy)){
TTCN_Logger::log_logmatch_info(".num_paging_rcv_msgs");
single_value->field_num__paging__rcv__msgs.log_match(match_value.num__paging__rcv__msgs(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_num__paging__rcv__ids.match(match_value.num__paging__rcv__ids(), legacy)){
TTCN_Logger::log_logmatch_info(".num_paging_rcv_ids");
single_value->field_num__paging__rcv__ids.log_match(match_value.num__paging__rcv__ids(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_num__overload.match(match_value.num__overload(), legacy)){
TTCN_Logger::log_logmatch_info(".num_overload");
single_value->field_num__overload.log_match(match_value.num__overload(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_cong__detected.match(match_value.cong__detected(), legacy)){
TTCN_Logger::log_logmatch_info(".cong_detected");
single_value->field_cong__detected.log_match(match_value.cong__detected(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ num_paging_sent := ");
single_value->field_num__paging__sent.log_match(match_value.num__paging__sent(), legacy);
TTCN_Logger::log_event_str(", num_paging_rcv_msgs := ");
single_value->field_num__paging__rcv__msgs.log_match(match_value.num__paging__rcv__msgs(), legacy);
TTCN_Logger::log_event_str(", num_paging_rcv_ids := ");
single_value->field_num__paging__rcv__ids.log_match(match_value.num__paging__rcv__ids(), legacy);
TTCN_Logger::log_event_str(", num_overload := ");
single_value->field_num__overload.log_match(match_value.num__overload(), legacy);
TTCN_Logger::log_event_str(", cong_detected := ");
single_value->field_cong__detected.log_match(match_value.cong__detected(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void PagingTestState_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (num__paging__sent().is_bound()) num__paging__sent().set_implicit_omit();
if (num__paging__rcv__msgs().is_bound()) num__paging__rcv__msgs().set_implicit_omit();
if (num__paging__rcv__ids().is_bound()) num__paging__rcv__ids().set_implicit_omit();
if (num__overload().is_bound()) num__overload().set_implicit_omit();
if (cong__detected().is_bound()) cong__detected().set_implicit_omit();
}

void PagingTestState_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_num__paging__sent.encode_text(text_buf);
single_value->field_num__paging__rcv__msgs.encode_text(text_buf);
single_value->field_num__paging__rcv__ids.encode_text(text_buf);
single_value->field_num__overload.encode_text(text_buf);
single_value->field_cong__detected.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BTS_Tests.PagingTestState.");
}
}

void PagingTestState_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_num__paging__sent.decode_text(text_buf);
single_value->field_num__paging__rcv__msgs.decode_text(text_buf);
single_value->field_num__paging__rcv__ids.decode_text(text_buf);
single_value->field_num__overload.decode_text(text_buf);
single_value->field_cong__detected.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new PagingTestState_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @BTS_Tests.PagingTestState.");
}
}

void PagingTestState_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    PagingTestState_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (5<param.get_size()) {
      param.error("record template of type @BTS_Tests.PagingTestState has 5 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) num__paging__sent().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) num__paging__rcv__msgs().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) num__paging__rcv__ids().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) num__overload().set_param(*param.get_elem(3));
    if (param.get_size()>4 && param.get_elem(4)->get_type()!=Module_Param::MP_NotUsed) cong__detected().set_param(*param.get_elem(4));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "num_paging_sent")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          num__paging__sent().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "num_paging_rcv_msgs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          num__paging__rcv__msgs().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "num_paging_rcv_ids")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          num__paging__rcv__ids().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "num_overload")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          num__overload().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "cong_detected")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          cong__detected().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BTS_Tests.PagingTestState: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    PagingTestState_template* precondition = new PagingTestState_template;
    precondition->set_param(*param.get_elem(0));
    PagingTestState_template* implied_template = new PagingTestState_template;
    implied_template->set_param(*param.get_elem(1));
    *this = PagingTestState_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BTS_Tests.PagingTestState");
  }
  is_ifpresent = param.get_ifpresent();
}

void PagingTestState_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_num__paging__sent.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.PagingTestState");
single_value->field_num__paging__rcv__msgs.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.PagingTestState");
single_value->field_num__paging__rcv__ids.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.PagingTestState");
single_value->field_num__overload.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.PagingTestState");
single_value->field_cong__detected.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.PagingTestState");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@BTS_Tests.PagingTestState");
}

boolean PagingTestState_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean PagingTestState_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

SystemInformationFn::SystemInformationFn()
{
}

SystemInformationFn::SystemInformationFn(const INTEGER& par_frame__number,
    const GSM__SystemInformation::SystemInformation& par_si)
  :   field_frame__number(par_frame__number),
  field_si(par_si)
{
}

SystemInformationFn::SystemInformationFn(const SystemInformationFn& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BTS_Tests.SystemInformationFn.");
if (other_value.frame__number().is_bound()) field_frame__number = other_value.frame__number();
else field_frame__number.clean_up();
if (other_value.si().is_bound()) field_si = other_value.si();
else field_si.clean_up();
}

void SystemInformationFn::clean_up()
{
field_frame__number.clean_up();
field_si.clean_up();
}

const TTCN_Typedescriptor_t* SystemInformationFn::get_descriptor() const { return &SystemInformationFn_descr_; }
SystemInformationFn& SystemInformationFn::operator=(const SystemInformationFn& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BTS_Tests.SystemInformationFn.");
  if (other_value.frame__number().is_bound()) field_frame__number = other_value.frame__number();
  else field_frame__number.clean_up();
  if (other_value.si().is_bound()) field_si = other_value.si();
  else field_si.clean_up();
}
return *this;
}

boolean SystemInformationFn::operator==(const SystemInformationFn& other_value) const
{
return field_frame__number==other_value.field_frame__number
  && field_si==other_value.field_si;
}

boolean SystemInformationFn::is_bound() const
{
return (field_frame__number.is_bound())
  || (field_si.is_bound());
}
boolean SystemInformationFn::is_value() const
{
return field_frame__number.is_value()
  && field_si.is_value();
}
void SystemInformationFn::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ frame_number := ");
field_frame__number.log();
TTCN_Logger::log_event_str(", si := ");
field_si.log();
TTCN_Logger::log_event_str(" }");
}

void SystemInformationFn::set_implicit_omit()
{
if (frame__number().is_bound()) frame__number().set_implicit_omit();
if (si().is_bound()) si().set_implicit_omit();
}

void SystemInformationFn::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record value of type @BTS_Tests.SystemInformationFn has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) frame__number().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) si().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "frame_number")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          frame__number().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "si")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          si().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BTS_Tests.SystemInformationFn: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BTS_Tests.SystemInformationFn");
  }
}

void SystemInformationFn::encode_text(Text_Buf& text_buf) const
{
field_frame__number.encode_text(text_buf);
field_si.encode_text(text_buf);
}

void SystemInformationFn::decode_text(Text_Buf& text_buf)
{
field_frame__number.decode_text(text_buf);
field_si.decode_text(text_buf);
}

struct SystemInformationFn_template::single_value_struct {
INTEGER_template field_frame__number;
GSM__SystemInformation::SystemInformation_template field_si;
};

void SystemInformationFn_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_frame__number = ANY_VALUE;
single_value->field_si = ANY_VALUE;
}
}
}

void SystemInformationFn_template::copy_value(const SystemInformationFn& other_value)
{
single_value = new single_value_struct;
if (other_value.frame__number().is_bound()) {
  single_value->field_frame__number = other_value.frame__number();
} else {
  single_value->field_frame__number.clean_up();
}
if (other_value.si().is_bound()) {
  single_value->field_si = other_value.si();
} else {
  single_value->field_si.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void SystemInformationFn_template::copy_template(const SystemInformationFn_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.frame__number().get_selection()) {
single_value->field_frame__number = other_value.frame__number();
} else {
single_value->field_frame__number.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.si().get_selection()) {
single_value->field_si = other_value.si();
} else {
single_value->field_si.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new SystemInformationFn_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new SystemInformationFn_template(*other_value.implication_.precondition);
implication_.implied_template = new SystemInformationFn_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BTS_Tests.SystemInformationFn.");
break;
}
set_selection(other_value);
}

SystemInformationFn_template::SystemInformationFn_template()
{
}

SystemInformationFn_template::SystemInformationFn_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

SystemInformationFn_template::SystemInformationFn_template(const SystemInformationFn& other_value)
{
copy_value(other_value);
}

SystemInformationFn_template::SystemInformationFn_template(const OPTIONAL<SystemInformationFn>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const SystemInformationFn&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BTS_Tests.SystemInformationFn from an unbound optional field.");
}
}

SystemInformationFn_template::SystemInformationFn_template(SystemInformationFn_template* p_precondition, SystemInformationFn_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

SystemInformationFn_template::SystemInformationFn_template(Dynamic_Match_Interface<SystemInformationFn>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<SystemInformationFn>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

SystemInformationFn_template::SystemInformationFn_template(const SystemInformationFn_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

SystemInformationFn_template::~SystemInformationFn_template()
{
clean_up();
}

SystemInformationFn_template& SystemInformationFn_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

SystemInformationFn_template& SystemInformationFn_template::operator=(const SystemInformationFn& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

SystemInformationFn_template& SystemInformationFn_template::operator=(const OPTIONAL<SystemInformationFn>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const SystemInformationFn&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @BTS_Tests.SystemInformationFn.");
}
return *this;
}

SystemInformationFn_template& SystemInformationFn_template::operator=(const SystemInformationFn_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean SystemInformationFn_template::match(const SystemInformationFn& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.frame__number().is_bound()) return FALSE;
if(!single_value->field_frame__number.match(other_value.frame__number(), legacy))return FALSE;
if(!other_value.si().is_bound()) return FALSE;
if(!single_value->field_si.match(other_value.si(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BTS_Tests.SystemInformationFn.");
}
return FALSE;
}

boolean SystemInformationFn_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_frame__number.is_bound()
 || single_value->field_si.is_bound();
}

boolean SystemInformationFn_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_frame__number.is_value()
 && single_value->field_si.is_value();
}

void SystemInformationFn_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

SystemInformationFn SystemInformationFn_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BTS_Tests.SystemInformationFn.");
SystemInformationFn ret_val;
if (single_value->field_frame__number.is_bound()) {
ret_val.frame__number() = single_value->field_frame__number.valueof();
}
if (single_value->field_si.is_bound()) {
ret_val.si() = single_value->field_si.valueof();
}
return ret_val;
}

void SystemInformationFn_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @BTS_Tests.SystemInformationFn.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new SystemInformationFn_template[list_length];
}

SystemInformationFn_template& SystemInformationFn_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @BTS_Tests.SystemInformationFn.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BTS_Tests.SystemInformationFn.");
return value_list.list_value[list_index];
}

INTEGER_template& SystemInformationFn_template::frame__number()
{
set_specific();
return single_value->field_frame__number;
}

const INTEGER_template& SystemInformationFn_template::frame__number() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field frame_number of a non-specific template of type @BTS_Tests.SystemInformationFn.");
return single_value->field_frame__number;
}

GSM__SystemInformation::SystemInformation_template& SystemInformationFn_template::si()
{
set_specific();
return single_value->field_si;
}

const GSM__SystemInformation::SystemInformation_template& SystemInformationFn_template::si() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field si of a non-specific template of type @BTS_Tests.SystemInformationFn.");
return single_value->field_si;
}

int SystemInformationFn_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.SystemInformationFn which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 2;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @BTS_Tests.SystemInformationFn containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.SystemInformationFn containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.SystemInformationFn containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.SystemInformationFn containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.SystemInformationFn containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.SystemInformationFn containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.SystemInformationFn containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.SystemInformationFn containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BTS_Tests.SystemInformationFn.");
  }
  return 0;
}

void SystemInformationFn_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ frame_number := ");
single_value->field_frame__number.log();
TTCN_Logger::log_event_str(", si := ");
single_value->field_si.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void SystemInformationFn_template::log_match(const SystemInformationFn& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_frame__number.match(match_value.frame__number(), legacy)){
TTCN_Logger::log_logmatch_info(".frame_number");
single_value->field_frame__number.log_match(match_value.frame__number(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_si.match(match_value.si(), legacy)){
TTCN_Logger::log_logmatch_info(".si");
single_value->field_si.log_match(match_value.si(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ frame_number := ");
single_value->field_frame__number.log_match(match_value.frame__number(), legacy);
TTCN_Logger::log_event_str(", si := ");
single_value->field_si.log_match(match_value.si(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void SystemInformationFn_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (frame__number().is_bound()) frame__number().set_implicit_omit();
if (si().is_bound()) si().set_implicit_omit();
}

void SystemInformationFn_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_frame__number.encode_text(text_buf);
single_value->field_si.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BTS_Tests.SystemInformationFn.");
}
}

void SystemInformationFn_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_frame__number.decode_text(text_buf);
single_value->field_si.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new SystemInformationFn_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @BTS_Tests.SystemInformationFn.");
}
}

void SystemInformationFn_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    SystemInformationFn_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record template of type @BTS_Tests.SystemInformationFn has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) frame__number().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) si().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "frame_number")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          frame__number().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "si")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          si().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BTS_Tests.SystemInformationFn: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    SystemInformationFn_template* precondition = new SystemInformationFn_template;
    precondition->set_param(*param.get_elem(0));
    SystemInformationFn_template* implied_template = new SystemInformationFn_template;
    implied_template->set_param(*param.get_elem(1));
    *this = SystemInformationFn_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BTS_Tests.SystemInformationFn");
  }
  is_ifpresent = param.get_ifpresent();
}

void SystemInformationFn_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_frame__number.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.SystemInformationFn");
single_value->field_si.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.SystemInformationFn");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@BTS_Tests.SystemInformationFn");
}

boolean SystemInformationFn_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean SystemInformationFn_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}


const SystemInformationFn SystemInformationVector::UNBOUND_ELEM;
SystemInformationVector::SystemInformationVector()
{
val_ptr = NULL;
}

SystemInformationVector::SystemInformationVector(null_type)
{
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
}

SystemInformationVector::SystemInformationVector(const SystemInformationVector& other_value)
{
if (!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BTS_Tests.SystemInformationVector.");
val_ptr = other_value.val_ptr;
val_ptr->ref_count++;
}

SystemInformationVector::~SystemInformationVector()
{
clean_up();
if (val_ptr != NULL) val_ptr = NULL;
}

void SystemInformationVector::clean_up()
{
if (val_ptr != NULL) {
if (val_ptr->ref_count > 1) {
val_ptr->ref_count--;
val_ptr = NULL;
}
else if (val_ptr->ref_count == 1) {
for (int elem_count = 0; elem_count < val_ptr->n_elements;
elem_count++)
if (val_ptr->value_elements[elem_count] != NULL)
delete val_ptr->value_elements[elem_count];
free_pointers((void**)val_ptr->value_elements);
delete val_ptr;
val_ptr = NULL;
}
else
TTCN_error("Internal error: Invalid reference counter in a record of/set of value.");
}
}

SystemInformationVector& SystemInformationVector::operator=(null_type)
{
clean_up();
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
return *this;
}

SystemInformationVector& SystemInformationVector::operator=(const SystemInformationVector& other_value)
{
if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @BTS_Tests.SystemInformationVector.");
if (this != &other_value) {
clean_up();
val_ptr = other_value.val_ptr;
val_ptr->ref_count++;
}
return *this;
}

boolean SystemInformationVector::operator==(null_type) const
{
if (val_ptr == NULL)
TTCN_error("The left operand of comparison is an unbound value of type @BTS_Tests.SystemInformationVector.");
return val_ptr->n_elements == 0 ;
}

boolean SystemInformationVector::operator==(const SystemInformationVector& other_value) const
{
if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @BTS_Tests.SystemInformationVector.");
if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @BTS_Tests.SystemInformationVector.");
if (val_ptr == other_value.val_ptr) return TRUE;
if (val_ptr->n_elements != (other_value.val_ptr)->n_elements)
return FALSE;
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++){
if (val_ptr->value_elements[elem_count] != NULL){
if ((other_value.val_ptr)->value_elements[elem_count] != NULL){
  if (*val_ptr->value_elements[elem_count] != *(other_value.val_ptr)->value_elements[elem_count]) return FALSE;
} else return FALSE;
} else {
if ((other_value.val_ptr)->value_elements[elem_count] != NULL) return FALSE;
}
}
return TRUE;
}

SystemInformationFn& SystemInformationVector::operator[](int index_value)
{
if (index_value < 0) TTCN_error("Accessing an element of type @BTS_Tests.SystemInformationVector using a negative index: %d.", index_value);
if (val_ptr == NULL) {
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
} else if (val_ptr->ref_count > 1) {
struct recordof_setof_struct *new_val_ptr = new recordof_setof_struct;
new_val_ptr->ref_count = 1;
new_val_ptr->n_elements = (index_value >= val_ptr->n_elements) ? index_value + 1 : val_ptr->n_elements;
new_val_ptr->value_elements = (SystemInformationFn**)allocate_pointers(new_val_ptr->n_elements);
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++){
if (val_ptr->value_elements[elem_count] != NULL){
new_val_ptr->value_elements[elem_count] = new SystemInformationFn(*(val_ptr->value_elements[elem_count]));
}
}
clean_up();
val_ptr = new_val_ptr;
}
if (index_value >= val_ptr->n_elements) set_size(index_value + 1);
if (val_ptr->value_elements[index_value] == NULL) {
val_ptr->value_elements[index_value] = new SystemInformationFn;
}
return *val_ptr->value_elements[index_value];
}

SystemInformationFn& SystemInformationVector::operator[](const INTEGER& index_value)
{
index_value.must_bound("Using an unbound integer value for indexing a value of type @BTS_Tests.SystemInformationVector.");
return (*this)[(int)index_value];
}

const SystemInformationFn& SystemInformationVector::operator[](int index_value) const
{
if (val_ptr == NULL)
TTCN_error("Accessing an element in an unbound value of type @BTS_Tests.SystemInformationVector.");
if (index_value < 0) TTCN_error("Accessing an element of type @BTS_Tests.SystemInformationVector using a negative index: %d.", index_value);
if (index_value >= val_ptr->n_elements) TTCN_error("Index overflow in a value of type @BTS_Tests.SystemInformationVector: The index is %d, but the value has only %d elements.", index_value, val_ptr->n_elements);
return (val_ptr->value_elements[index_value] == NULL) ?
UNBOUND_ELEM : *val_ptr->value_elements[index_value];
}

const SystemInformationFn& SystemInformationVector::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a value of type @BTS_Tests.SystemInformationVector.");
return (*this)[(int)index_value];
}

SystemInformationVector SystemInformationVector::operator<<=(int rotate_count) const
{
return *this >>= (-rotate_count);
}

SystemInformationVector SystemInformationVector::operator<<=(const INTEGER& rotate_count) const
{
rotate_count.must_bound("Unbound integer operand of rotate left operator.");
return *this >>= (int)(-rotate_count);
}

SystemInformationVector SystemInformationVector::operator>>=(const INTEGER& rotate_count) const
{
rotate_count.must_bound("Unbound integer operand of rotate right operator.");
return *this >>= (int)rotate_count;
}

SystemInformationVector SystemInformationVector::operator>>=(int rotate_count) const
{
if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @BTS_Tests.SystemInformationVector.");
if (val_ptr->n_elements == 0) return *this;
int rc;
if (rotate_count>=0) rc = rotate_count % val_ptr->n_elements;
else rc = val_ptr->n_elements - ((-rotate_count) % val_ptr->n_elements);
if (rc == 0) return *this;
SystemInformationVector ret_val;
ret_val.set_size(val_ptr->n_elements);
for (int i=0; i<val_ptr->n_elements; i++) {
if (val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[(i+rc)%val_ptr->n_elements] =new SystemInformationFn(*val_ptr->value_elements[i]);
}
}
return ret_val;
}

SystemInformationVector SystemInformationVector::operator+(const SystemInformationVector& other_value) const
{
if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @BTS_Tests.SystemInformationVector concatenation.");
if (val_ptr->n_elements == 0) return other_value;
if (other_value.val_ptr->n_elements == 0) return *this;
SystemInformationVector ret_val;
ret_val.set_size(val_ptr->n_elements+other_value.val_ptr->n_elements);
for (int i=0; i<val_ptr->n_elements; i++) {
if (val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i] = new SystemInformationFn(*val_ptr->value_elements[i]);
}
}
for (int i=0; i<other_value.val_ptr->n_elements; i++) {
if (other_value.val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i+val_ptr->n_elements] = new SystemInformationFn(*other_value.val_ptr->value_elements[i]);
}
}
return ret_val;
}

SystemInformationVector SystemInformationVector::substr(int index, int returncount) const
{
if (val_ptr == NULL) TTCN_error("The first argument of substr() is an unbound value of type @BTS_Tests.SystemInformationVector.");
check_substr_arguments(val_ptr->n_elements, index, returncount, "@BTS_Tests.SystemInformationVector","element");
SystemInformationVector ret_val;
ret_val.set_size(returncount);
for (int i=0; i<returncount; i++) {
if (val_ptr->value_elements[i+index] != NULL) {
ret_val.val_ptr->value_elements[i] = new SystemInformationFn(*val_ptr->value_elements[i+index]);
}
}
return ret_val;
}

SystemInformationVector SystemInformationVector::replace(int index, int len, const SystemInformationVector& repl) const
{
if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @BTS_Tests.SystemInformationVector.");
if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @BTS_Tests.SystemInformationVector.");
check_replace_arguments(val_ptr->n_elements, index, len, "@BTS_Tests.SystemInformationVector","element");
SystemInformationVector ret_val;
ret_val.set_size(val_ptr->n_elements + repl.val_ptr->n_elements - len);
for (int i = 0; i < index; i++) {
if (val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i] = new SystemInformationFn(*val_ptr->value_elements[i]);
}
}
for (int i = 0; i < repl.val_ptr->n_elements; i++) {
if (repl.val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i+index] = new SystemInformationFn(*repl.val_ptr->value_elements[i]);
}
}
for (int i = 0; i < val_ptr->n_elements - index - len; i++) {
if (val_ptr->value_elements[index+i+len] != NULL) {
ret_val.val_ptr->value_elements[index+i+repl.val_ptr->n_elements] = new SystemInformationFn(*val_ptr->value_elements[index+i+len]);
}
}
return ret_val;
}

SystemInformationVector SystemInformationVector::replace(int index, int len, const SystemInformationVector_template& repl) const
{
if (!repl.is_value()) TTCN_error("The fourth argument of function replace() is a template with non-specific value.");
return replace(index, len, repl.valueof());
}

void SystemInformationVector::set_size(int new_size)
{
if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @BTS_Tests.SystemInformationVector.");
if (val_ptr == NULL) {
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
} else if (val_ptr->ref_count > 1) {
struct recordof_setof_struct *new_val_ptr = new recordof_setof_struct;
new_val_ptr->ref_count = 1;
new_val_ptr->n_elements = (new_size < val_ptr->n_elements) ? new_size : val_ptr->n_elements;
new_val_ptr->value_elements = (SystemInformationFn**)allocate_pointers(new_val_ptr->n_elements);
for (int elem_count = 0; elem_count < new_val_ptr->n_elements; elem_count++) {
if (val_ptr->value_elements[elem_count] != NULL){
new_val_ptr->value_elements[elem_count] = new SystemInformationFn(*(val_ptr->value_elements[elem_count]));
}
}
clean_up();
val_ptr = new_val_ptr;
}
if (new_size > val_ptr->n_elements) {
val_ptr->value_elements = (SystemInformationFn**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size);
#ifdef TITAN_MEMORY_DEBUG_SET_RECORD_OF
if((val_ptr->n_elements/1000)!=(new_size/1000)) TTCN_warning("New size of type @BTS_Tests.SystemInformationVector: %d",new_size);
#endif
val_ptr->n_elements = new_size;
} else if (new_size < val_ptr->n_elements) {
for (int elem_count = new_size; elem_count < val_ptr->n_elements; elem_count++)
if (val_ptr->value_elements[elem_count] != NULL)delete val_ptr->value_elements[elem_count];
val_ptr->value_elements = (SystemInformationFn**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size);
val_ptr->n_elements = new_size;
}
}

boolean SystemInformationVector::is_value() const
{
if (val_ptr == NULL) return FALSE;
for(int i = 0; i < val_ptr->n_elements; ++i) {
if (val_ptr->value_elements[i] == NULL || !val_ptr->value_elements[i]->is_value()) return FALSE;
}
return TRUE;
}

int SystemInformationVector::size_of() const
{
if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @BTS_Tests.SystemInformationVector.");
return val_ptr->n_elements;
}

int SystemInformationVector::lengthof() const
{
if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @BTS_Tests.SystemInformationVector.");
for (int my_length=val_ptr->n_elements; my_length>0; my_length--) if (val_ptr->value_elements[my_length-1] != NULL) return my_length;
return 0;
}

void SystemInformationVector::log() const
{
if (val_ptr == NULL) {;
TTCN_Logger::log_event_unbound();
return;
}
switch (val_ptr->n_elements) {
case 0:
TTCN_Logger::log_event_str("{ }");
break;
default:
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
(*this)[elem_count].log();
}
TTCN_Logger::log_event_str(" }");
}
}

void SystemInformationVector::set_implicit_omit()
{
if (val_ptr == NULL) return;
for (int i = 0; i < val_ptr->n_elements; i++) {
if (val_ptr->value_elements[i] != NULL) val_ptr->value_elements[i]->set_implicit_omit();
}
}

void SystemInformationVector::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE|Module_Param::BC_LIST, "record of value");
  switch (param.get_operation_type()) {
  case Module_Param::OT_ASSIGN:
    if (param.get_type()==Module_Param::MP_Value_List && param.get_size()==0) {
      *this = NULL_VALUE;
      return;
    }
    switch (param.get_type()) {
    case Module_Param::MP_Value_List:
      set_size(param.get_size());
      for (size_t i=0; i<param.get_size(); ++i) {
        Module_Param* const curr = param.get_elem(i);
        if (curr->get_type()!=Module_Param::MP_NotUsed) {
          (*this)[i].set_param(*curr);
          if (!(*this)[i].is_bound()) {
            delete val_ptr->value_elements[i];
            val_ptr->value_elements[i] = NULL;
          }
        }
      }
      break;
    case Module_Param::MP_Indexed_List:
      for (size_t i=0; i<param.get_size(); ++i) {
        Module_Param* const curr = param.get_elem(i);
        (*this)[curr->get_id()->get_index()].set_param(*curr);
        if (!(*this)[curr->get_id()->get_index()].is_bound()) {
          delete val_ptr->value_elements[curr->get_id()->get_index()];
          val_ptr->value_elements[curr->get_id()->get_index()] = NULL;
        }
      }
      break;
    default:
      param.type_error("record of value", "@BTS_Tests.SystemInformationVector");
    }
    break;
  case Module_Param::OT_CONCAT:
    switch (param.get_type()) {
    case Module_Param::MP_Value_List: {
      if (!is_bound()) *this = NULL_VALUE;
      int start_idx = lengthof();
      for (size_t i=0; i<param.get_size(); ++i) {
        Module_Param* const curr = param.get_elem(i);
        if ((curr->get_type()!=Module_Param::MP_NotUsed)) {
          (*this)[start_idx+(int)i].set_param(*curr);
        }
      }
    } break;
    case Module_Param::MP_Indexed_List:
      param.error("Cannot concatenate an indexed value list");
      break;
    default:
      param.type_error("record of value", "@BTS_Tests.SystemInformationVector");
    }
    break;
  default:
    TTCN_error("Internal error: Unknown operation type.");
  }
}

void SystemInformationVector::encode_text(Text_Buf& text_buf) const
{
if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @BTS_Tests.SystemInformationVector.");
text_buf.push_int(val_ptr->n_elements);
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++)
(*this)[elem_count].encode_text(text_buf);
}

void SystemInformationVector::decode_text(Text_Buf& text_buf)
{
clean_up();
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = text_buf.pull_int().get_val();
if (val_ptr->n_elements < 0) TTCN_error("Text decoder: Negative size was received for a value of type @BTS_Tests.SystemInformationVector.");
val_ptr->value_elements = (SystemInformationFn**)allocate_pointers(val_ptr->n_elements);
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) {
val_ptr->value_elements[elem_count] = new SystemInformationFn;
val_ptr->value_elements[elem_count]->decode_text(text_buf);
}
}

void SystemInformationVector_template::copy_value(const SystemInformationVector& other_value)
{
if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @BTS_Tests.SystemInformationVector with an unbound value.");
single_value.n_elements = other_value.size_of();
single_value.value_elements = (SystemInformationFn_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (other_value[elem_count].is_bound()) {
single_value.value_elements[elem_count] = new SystemInformationFn_template(other_value[elem_count]);
} else {
single_value.value_elements[elem_count] = new SystemInformationFn_template;
}
}
set_selection(SPECIFIC_VALUE);
}

void SystemInformationVector_template::copy_template(const SystemInformationVector_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value.n_elements = other_value.single_value.n_elements;
single_value.value_elements = (SystemInformationFn_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (UNINITIALIZED_TEMPLATE != other_value.single_value.value_elements[elem_count]->get_selection()) {
single_value.value_elements[elem_count] = new SystemInformationFn_template(*other_value.single_value.value_elements[elem_count]);
} else {
single_value.value_elements[elem_count] = new SystemInformationFn_template;
}
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new SystemInformationVector_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new SystemInformationVector_template(*other_value.implication_.precondition);
implication_.implied_template = new SystemInformationVector_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BTS_Tests.SystemInformationVector.");
break;
}
set_selection(other_value);
}

boolean SystemInformationVector_template::match_function_specific(const Base_Type *value_ptr, int value_index, const Restricted_Length_Template *template_ptr, int template_index, boolean legacy)
{
if (value_index >= 0) return ((const SystemInformationVector_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const SystemInformationVector*)value_ptr)[value_index], legacy);
else return ((const SystemInformationVector_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit();
}

SystemInformationVector_template::SystemInformationVector_template()
{
}

SystemInformationVector_template::SystemInformationVector_template(template_sel other_value)
 : Base_Record_Of_Template(other_value)
{
check_single_selection(other_value);
}

SystemInformationVector_template::SystemInformationVector_template(null_type)
 : Base_Record_Of_Template(SPECIFIC_VALUE)
{
single_value.n_elements = 0;
single_value.value_elements = NULL;
}

SystemInformationVector_template::SystemInformationVector_template(const SystemInformationVector& other_value)
{
copy_value(other_value);
}

SystemInformationVector_template::SystemInformationVector_template(const OPTIONAL<SystemInformationVector>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const SystemInformationVector&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BTS_Tests.SystemInformationVector from an unbound optional field.");
}
}

SystemInformationVector_template::SystemInformationVector_template(SystemInformationVector_template* p_precondition, SystemInformationVector_template* p_implied_template)
 : Base_Record_Of_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

SystemInformationVector_template::SystemInformationVector_template(Dynamic_Match_Interface<SystemInformationVector>* p_dyn_match)
 : Base_Record_Of_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<SystemInformationVector>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

SystemInformationVector_template::SystemInformationVector_template(const SystemInformationVector_template& other_value)
 : Base_Record_Of_Template()
{
copy_template(other_value);
}

SystemInformationVector_template::~SystemInformationVector_template()
{
clean_up();
}

void SystemInformationVector_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
delete single_value.value_elements[elem_count];
free_pointers((void**)single_value.value_elements);
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

SystemInformationVector_template& SystemInformationVector_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

SystemInformationVector_template& SystemInformationVector_template::operator=(null_type)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value.n_elements = 0;
single_value.value_elements = NULL;
return *this;
}

SystemInformationVector_template& SystemInformationVector_template::operator=(const SystemInformationVector& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

SystemInformationVector_template& SystemInformationVector_template::operator=(const OPTIONAL<SystemInformationVector>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const SystemInformationVector&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @BTS_Tests.SystemInformationVector.");
}
return *this;
}

SystemInformationVector_template& SystemInformationVector_template::operator=(const SystemInformationVector_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

SystemInformationFn_template& SystemInformationVector_template::operator[](int index_value)
{
if (index_value < 0) TTCN_error("Accessing an element of a template for type @BTS_Tests.SystemInformationVector using a negative index: %d.", index_value);
switch (template_selection)
{
  case SPECIFIC_VALUE:
    if(index_value < single_value.n_elements) break;
    // no break
  case OMIT_VALUE:
  case ANY_VALUE:
  case ANY_OR_OMIT:
  case UNINITIALIZED_TEMPLATE:
    set_size(index_value + 1);
    break;
  default:
    TTCN_error("Accessing an element of a non-specific template for type @BTS_Tests.SystemInformationVector.");
    break;
}
return *single_value.value_elements[index_value];
}

SystemInformationFn_template& SystemInformationVector_template::operator[](const INTEGER& index_value)
{
index_value.must_bound("Using an unbound integer value for indexing a template of type @BTS_Tests.SystemInformationVector.");
return (*this)[(int)index_value];
}

const SystemInformationFn_template& SystemInformationVector_template::operator[](int index_value) const
{
if (index_value < 0) TTCN_error("Accessing an element of a template for type @BTS_Tests.SystemInformationVector using a negative index: %d.", index_value);
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing an element of a non-specific template for type @BTS_Tests.SystemInformationVector.");
if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @BTS_Tests.SystemInformationVector: The index is %d, but the template has only %d elements.", index_value, single_value.n_elements);
return *single_value.value_elements[index_value];
}

const SystemInformationFn_template& SystemInformationVector_template::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a template of type @BTS_Tests.SystemInformationVector.");
return (*this)[(int)index_value];
}

void SystemInformationVector_template::set_size(int new_size)
{
if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a template of type @BTS_Tests.SystemInformationVector.");
template_sel old_selection = template_selection;
if (old_selection != SPECIFIC_VALUE) {
clean_up();
set_selection(SPECIFIC_VALUE);
single_value.n_elements = 0;
single_value.value_elements = NULL;
}
if (new_size > single_value.n_elements) {
single_value.value_elements = (SystemInformationFn_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
for (int elem_count = single_value.n_elements; elem_count < new_size; elem_count++)
single_value.value_elements[elem_count] = new SystemInformationFn_template(ANY_VALUE);
} else {
for (int elem_count = single_value.n_elements; elem_count < new_size; elem_count++)
single_value.value_elements[elem_count] = new SystemInformationFn_template;
}
single_value.n_elements = new_size;
} else if (new_size < single_value.n_elements) {
for (int elem_count = new_size; elem_count < single_value.n_elements; elem_count++)
delete single_value.value_elements[elem_count];
single_value.value_elements = (SystemInformationFn_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size);
single_value.n_elements = new_size;
}
}

int SystemInformationVector_template::n_elem() const
{
  switch (template_selection) {
  case SPECIFIC_VALUE:
    return single_value.n_elements;
    break;
  case VALUE_LIST:
    return value_list.n_values;
    break;
  default:
    TTCN_error("Performing n_elem");
  }
}

int SystemInformationVector_template::size_of(boolean is_size) const
{
const char* op_name = is_size ? "size" : "length";
int min_size;
boolean has_any_or_none;
if (is_ifpresent) TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.SystemInformationVector which has an ifpresent attribute.", op_name);
switch (template_selection)
{
case SPECIFIC_VALUE: {
  min_size = 0;
  has_any_or_none = FALSE;
  int elem_count = single_value.n_elements;
  if (!is_size) { while (elem_count>0 && !single_value.value_elements[elem_count-1]->is_bound()) elem_count--; }
  for (int i=0; i<elem_count; i++) {
    switch (single_value.value_elements[i]->get_selection()) {
    case OMIT_VALUE:
      TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.SystemInformationVector containing omit element.", op_name);
    case ANY_OR_OMIT:
      has_any_or_none = TRUE;
      break;
    default:
      min_size++;
      break;
    }
  }
} break;
case OMIT_VALUE:
  TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.SystemInformationVector containing omit value.", op_name);
case ANY_VALUE:
case ANY_OR_OMIT:
  min_size = 0;
  has_any_or_none = TRUE;
  break;
case VALUE_LIST:
{
  if (value_list.n_values<1)
    TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.SystemInformationVector containing an empty list.", op_name);
  int item_size = value_list.list_value[0].size_of(is_size);
  for (unsigned int i = 1; i < value_list.n_values; i++) {
    if (value_list.list_value[i].size_of(is_size)!=item_size)
      TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.SystemInformationVector containing a value list with different sizes.", op_name);
  }
  min_size = item_size;
  has_any_or_none = FALSE;
  break;
}
case COMPLEMENTED_LIST:
  TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.SystemInformationVector containing complemented list.", op_name);
default:
  TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @BTS_Tests.SystemInformationVector.", op_name);
}
return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @BTS_Tests.SystemInformationVector");
}

boolean SystemInformationVector_template::match(const SystemInformationVector& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
int value_length = other_value.size_of();
if (!match_length(value_length)) return FALSE;
switch (template_selection) {
case SPECIFIC_VALUE:
return match_record_of(&other_value, value_length, this, single_value.n_elements, match_function_specific, legacy);
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching with an uninitialized/unsupported template of type @BTS_Tests.SystemInformationVector.");
}
return FALSE;
}

boolean SystemInformationVector_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
if (!single_value.value_elements[elem_count]->is_value()) return FALSE;
return TRUE;
}

SystemInformationVector SystemInformationVector_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of type @BTS_Tests.SystemInformationVector.");
SystemInformationVector ret_val;
ret_val.set_size(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
if (single_value.value_elements[elem_count]->is_bound()) {
ret_val[elem_count] = single_value.value_elements[elem_count]->valueof();
}
return ret_val;
}

SystemInformationVector SystemInformationVector_template::substr(int index, int returncount) const
{
if (!is_value()) TTCN_error("The first argument of function substr() is a template with non-specific value.");
return valueof().substr(index, returncount);
}

SystemInformationVector SystemInformationVector_template::replace(int index, int len, const SystemInformationVector_template& repl) const
{
if (!is_value()) TTCN_error("The first argument of function replace() is a template with non-specific value.");
if (!repl.is_value()) TTCN_error("The fourth argument of function replace() is a template with non-specific value.");
return valueof().replace(index, len, repl.valueof());
}

SystemInformationVector SystemInformationVector_template::replace(int index, int len, const SystemInformationVector& repl) const
{
if (!is_value()) TTCN_error("The first argument of function replace() is a template with non-specific value.");
return valueof().replace(index, len, repl);
}

void SystemInformationVector_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = list_length;
value_list.list_value = new SystemInformationVector_template[list_length];
break;
default:
TTCN_error("Internal error: Setting an invalid type for a template of type @BTS_Tests.SystemInformationVector.");
}
set_selection(template_type);
}

SystemInformationVector_template& SystemInformationVector_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Internal error: Accessing a list element of a non-list template of type @BTS_Tests.SystemInformationVector.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @BTS_Tests.SystemInformationVector.");
return value_list.list_value[list_index];
}

void SystemInformationVector_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.n_elements > 0) {
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
if (permutation_starts_at(elem_count)) TTCN_Logger::log_event_str("permutation(");
single_value.value_elements[elem_count]->log();
if (permutation_ends_at(elem_count)) TTCN_Logger::log_char(')');
}
TTCN_Logger::log_event_str(" }");
} else TTCN_Logger::log_event_str("{ }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_restricted();
log_ifpresent();
}

void SystemInformationVector_template::log_match(const SystemInformationVector& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
}else{
if (template_selection == SPECIFIC_VALUE && single_value.n_elements > 0 && get_number_of_permutations() == 0 && single_value.n_elements == match_value.size_of()) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if(!single_value.value_elements[elem_count]->match(match_value[elem_count], legacy)){
TTCN_Logger::log_logmatch_info("[%d]", elem_count);
single_value.value_elements[elem_count]->log_match(match_value[elem_count], legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
log_match_length(single_value.n_elements);
} else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE && single_value.n_elements > 0 && get_number_of_permutations() == 0 && single_value.n_elements == match_value.size_of()) {
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
single_value.value_elements[elem_count]->log_match(match_value[elem_count], legacy);
}
TTCN_Logger::log_event_str(" }");
log_match_length(single_value.n_elements);
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void SystemInformationVector_template::encode_text(Text_Buf& text_buf) const
{
encode_text_permutation(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
single_value.value_elements[elem_count]->encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BTS_Tests.SystemInformationVector.");
}
}

void SystemInformationVector_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_permutation(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value.n_elements = text_buf.pull_int().get_val();
if (single_value.n_elements < 0) TTCN_error("Text decoder: Negative size was received for a template of type @BTS_Tests.SystemInformationVector.");
single_value.value_elements = (SystemInformationFn_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
single_value.value_elements[elem_count] = new SystemInformationFn_template;
single_value.value_elements[elem_count]->decode_text(text_buf);
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new SystemInformationVector_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of type @BTS_Tests.SystemInformationVector.");
}
}

boolean SystemInformationVector_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean SystemInformationVector_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void SystemInformationVector_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
for (int i = 0; i < single_value.n_elements; i++) {
if (single_value.value_elements[i] != NULL) single_value.value_elements[i]->set_implicit_omit();
}
}

void SystemInformationVector_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE|Module_Param::BC_LIST, "record of template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    SystemInformationVector_template temp;
    temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = temp;
    break; }
  case Module_Param::MP_Indexed_List:
    if (template_selection!=SPECIFIC_VALUE) set_size(0);
    for (size_t p_i=0; p_i<param.get_size(); ++p_i) {
      (*this)[(int)(param.get_elem(p_i)->get_id()->get_index())].set_param(*param.get_elem(p_i));
    }
    break;
  case Module_Param::MP_Value_List: {
    set_size(param.get_size());
    int curr_idx = 0;
    for (size_t p_i=0; p_i<param.get_size(); ++p_i) {
      switch (param.get_elem(p_i)->get_type()) {
      case Module_Param::MP_NotUsed:
        curr_idx++;
        break;
      case Module_Param::MP_Permutation_Template: {
        int perm_start_idx = curr_idx;
        Module_Param* param_i = param.get_elem(p_i);
        for (size_t perm_i=0; perm_i<param_i->get_size(); perm_i++) {
          (*this)[curr_idx].set_param(*(param_i->get_elem(perm_i)));
          curr_idx++;
        }
        int perm_end_idx = curr_idx - 1;
        add_permutation(perm_start_idx, perm_end_idx);
      } break;
      default:
        (*this)[curr_idx].set_param(*param.get_elem(p_i));
        curr_idx++;
      }
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    SystemInformationVector_template* precondition = new SystemInformationVector_template;
    precondition->set_param(*param.get_elem(0));
    SystemInformationVector_template* implied_template = new SystemInformationVector_template;
    implied_template->set_param(*param.get_elem(1));
    *this = SystemInformationVector_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record of template", "@BTS_Tests.SystemInformationVector");
  }
  is_ifpresent = param.get_ifpresent();
  set_length_range(param);
}

void SystemInformationVector_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
for (int i=0; i<single_value.n_elements; i++) single_value.value_elements[i]->check_restriction(t_res, t_name ? t_name : "@BTS_Tests.SystemInformationVector");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@BTS_Tests.SystemInformationVector");
}

boolean SystemInformationVector_template::get_istemplate_kind(const char* type) const {
if (!strcmp(type, "AnyElement")) {
  if (template_selection != SPECIFIC_VALUE) {
    return FALSE;
  }
  for (int i = 0; i < single_value.n_elements; i++) {
    if (single_value.value_elements[i]->get_selection() == ANY_VALUE) {
      return TRUE;
    }
  }
  return FALSE;
} else if (!strcmp(type, "AnyElementsOrNone")) {
  if (template_selection != SPECIFIC_VALUE) {
    return FALSE;
  }
  for (int i = 0; i < single_value.n_elements; i++) {
    if (single_value.value_elements[i]->get_selection() == ANY_OR_OMIT) {
      return TRUE;
    }
  }
  return FALSE;
} else if (!strcmp(type, "permutation")) {
  return number_of_permutations;
} else if (!strcmp(type, "length")) {
  return length_restriction_type != NO_LENGTH_RESTRICTION;
} else {
  return Base_Template::get_istemplate_kind(type);
}
}
as__pcuif__msg_Default::as__pcuif__msg_Default(PCUIF__Types::PCUIF__Message& msg, const PCUIF__Types::PCUIF__Message_template& tr__msg)
 : Default_Base("as_pcuif_msg"), par_msg(msg), par_tr__msg(tr__msg)
{
}

alt_status as__pcuif__msg_Default::call_altstep(boolean first_alt_run)
{
return as__pcuif__msg_instance(par_msg, par_tr__msg, first_alt_run);
}

as__l1ctl__dl__block__ind_Default::as__l1ctl__dl__block__ind_Default(L1CTL__Types::L1ctlGprsDlBlockInd& block__ind, const INTEGER_template& fn, const INTEGER_template& tn, const INTEGER_template& usf, const OCTETSTRING_template& data)
 : Default_Base("as_l1ctl_dl_block_ind"), par_block__ind(block__ind), par_fn(fn), par_tn(tn), par_usf(usf), par_data(data)
{
}

alt_status as__l1ctl__dl__block__ind_Default::call_altstep(boolean first_alt_run)
{
return as__l1ctl__dl__block__ind_instance(par_block__ind, par_fn, par_tn, par_usf, par_data, first_alt_run);
}

TdmaFnTn::TdmaFnTn()
{
}

TdmaFnTn::TdmaFnTn(const INTEGER& par_fn,
    const INTEGER& par_tn)
  :   field_fn(par_fn),
  field_tn(par_tn)
{
}

TdmaFnTn::TdmaFnTn(const TdmaFnTn& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BTS_Tests.TdmaFnTn.");
if (other_value.fn().is_bound()) field_fn = other_value.fn();
else field_fn.clean_up();
if (other_value.tn().is_bound()) field_tn = other_value.tn();
else field_tn.clean_up();
}

void TdmaFnTn::clean_up()
{
field_fn.clean_up();
field_tn.clean_up();
}

const TTCN_Typedescriptor_t* TdmaFnTn::get_descriptor() const { return &TdmaFnTn_descr_; }
TdmaFnTn& TdmaFnTn::operator=(const TdmaFnTn& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BTS_Tests.TdmaFnTn.");
  if (other_value.fn().is_bound()) field_fn = other_value.fn();
  else field_fn.clean_up();
  if (other_value.tn().is_bound()) field_tn = other_value.tn();
  else field_tn.clean_up();
}
return *this;
}

boolean TdmaFnTn::operator==(const TdmaFnTn& other_value) const
{
return field_fn==other_value.field_fn
  && field_tn==other_value.field_tn;
}

boolean TdmaFnTn::is_bound() const
{
return (field_fn.is_bound())
  || (field_tn.is_bound());
}
boolean TdmaFnTn::is_value() const
{
return field_fn.is_value()
  && field_tn.is_value();
}
void TdmaFnTn::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ fn := ");
field_fn.log();
TTCN_Logger::log_event_str(", tn := ");
field_tn.log();
TTCN_Logger::log_event_str(" }");
}

void TdmaFnTn::set_implicit_omit()
{
if (fn().is_bound()) fn().set_implicit_omit();
if (tn().is_bound()) tn().set_implicit_omit();
}

void TdmaFnTn::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE, "record value");
  switch (param.get_type()) {
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record value of type @BTS_Tests.TdmaFnTn has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) fn().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tn().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "fn")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          fn().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tn")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tn().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BTS_Tests.TdmaFnTn: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BTS_Tests.TdmaFnTn");
  }
}

void TdmaFnTn::encode_text(Text_Buf& text_buf) const
{
field_fn.encode_text(text_buf);
field_tn.encode_text(text_buf);
}

void TdmaFnTn::decode_text(Text_Buf& text_buf)
{
field_fn.decode_text(text_buf);
field_tn.decode_text(text_buf);
}

struct TdmaFnTn_template::single_value_struct {
INTEGER_template field_fn;
INTEGER_template field_tn;
};

void TdmaFnTn_template::set_specific()
{
if (template_selection != SPECIFIC_VALUE) {
template_sel old_selection = template_selection;
clean_up();
single_value = new single_value_struct;
set_selection(SPECIFIC_VALUE);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
single_value->field_fn = ANY_VALUE;
single_value->field_tn = ANY_VALUE;
}
}
}

void TdmaFnTn_template::copy_value(const TdmaFnTn& other_value)
{
single_value = new single_value_struct;
if (other_value.fn().is_bound()) {
  single_value->field_fn = other_value.fn();
} else {
  single_value->field_fn.clean_up();
}
if (other_value.tn().is_bound()) {
  single_value->field_tn = other_value.tn();
} else {
  single_value->field_tn.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void TdmaFnTn_template::copy_template(const TdmaFnTn_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.fn().get_selection()) {
single_value->field_fn = other_value.fn();
} else {
single_value->field_fn.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.tn().get_selection()) {
single_value->field_tn = other_value.tn();
} else {
single_value->field_tn.clean_up();
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new TdmaFnTn_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new TdmaFnTn_template(*other_value.implication_.precondition);
implication_.implied_template = new TdmaFnTn_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BTS_Tests.TdmaFnTn.");
break;
}
set_selection(other_value);
}

TdmaFnTn_template::TdmaFnTn_template()
{
}

TdmaFnTn_template::TdmaFnTn_template(template_sel other_value)
 : Base_Template(other_value)
{
check_single_selection(other_value);
}

TdmaFnTn_template::TdmaFnTn_template(const TdmaFnTn& other_value)
{
copy_value(other_value);
}

TdmaFnTn_template::TdmaFnTn_template(const OPTIONAL<TdmaFnTn>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const TdmaFnTn&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BTS_Tests.TdmaFnTn from an unbound optional field.");
}
}

TdmaFnTn_template::TdmaFnTn_template(TdmaFnTn_template* p_precondition, TdmaFnTn_template* p_implied_template)
 : Base_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

TdmaFnTn_template::TdmaFnTn_template(Dynamic_Match_Interface<TdmaFnTn>* p_dyn_match)
 : Base_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<TdmaFnTn>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

TdmaFnTn_template::TdmaFnTn_template(const TdmaFnTn_template& other_value)
: Base_Template()
{
copy_template(other_value);
}

TdmaFnTn_template::~TdmaFnTn_template()
{
clean_up();
}

TdmaFnTn_template& TdmaFnTn_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

TdmaFnTn_template& TdmaFnTn_template::operator=(const TdmaFnTn& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

TdmaFnTn_template& TdmaFnTn_template::operator=(const OPTIONAL<TdmaFnTn>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const TdmaFnTn&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @BTS_Tests.TdmaFnTn.");
}
return *this;
}

TdmaFnTn_template& TdmaFnTn_template::operator=(const TdmaFnTn_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

boolean TdmaFnTn_template::match(const TdmaFnTn& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
switch (template_selection) {
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case OMIT_VALUE:
return FALSE;
case SPECIFIC_VALUE:
if(!other_value.fn().is_bound()) return FALSE;
if(!single_value->field_fn.match(other_value.fn(), legacy))return FALSE;
if(!other_value.tn().is_bound()) return FALSE;
if(!single_value->field_tn.match(other_value.tn(), legacy))return FALSE;
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching an uninitialized/unsupported template of type @BTS_Tests.TdmaFnTn.");
}
return FALSE;
}

boolean TdmaFnTn_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_fn.is_bound()
 || single_value->field_tn.is_bound();
}

boolean TdmaFnTn_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_fn.is_value()
 && single_value->field_tn.is_value();
}

void TdmaFnTn_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
delete single_value;
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

TdmaFnTn TdmaFnTn_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific template of type @BTS_Tests.TdmaFnTn.");
TdmaFnTn ret_val;
if (single_value->field_fn.is_bound()) {
ret_val.fn() = single_value->field_fn.valueof();
}
if (single_value->field_tn.is_bound()) {
ret_val.tn() = single_value->field_tn.valueof();
}
return ret_val;
}

void TdmaFnTn_template::set_type(template_sel template_type, unsigned int list_length)
{
if (template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST&& template_type != CONJUNCTION_MATCH)
TTCN_error("Setting an invalid list for a template of type @BTS_Tests.TdmaFnTn.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new TdmaFnTn_template[list_length];
}

TdmaFnTn_template& TdmaFnTn_template::list_item(unsigned int list_index) const
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST&& template_selection != CONJUNCTION_MATCH)
TTCN_error("Accessing a list element of a non-list template of type @BTS_Tests.TdmaFnTn.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BTS_Tests.TdmaFnTn.");
return value_list.list_value[list_index];
}

INTEGER_template& TdmaFnTn_template::fn()
{
set_specific();
return single_value->field_fn;
}

const INTEGER_template& TdmaFnTn_template::fn() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field fn of a non-specific template of type @BTS_Tests.TdmaFnTn.");
return single_value->field_fn;
}

INTEGER_template& TdmaFnTn_template::tn()
{
set_specific();
return single_value->field_tn;
}

const INTEGER_template& TdmaFnTn_template::tn() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field tn of a non-specific template of type @BTS_Tests.TdmaFnTn.");
return single_value->field_tn;
}

int TdmaFnTn_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.TdmaFnTn which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
    return 2;
  case VALUE_LIST:
   {
     if (value_list.n_values<1)
       TTCN_error("Internal error: Performing sizeof() operation on a template of type @BTS_Tests.TdmaFnTn containing an empty list.");
      int item_size = value_list.list_value[0].size_of();
      for (unsigned int l_idx = 1; l_idx < value_list.n_values; l_idx++)
      {
        if (value_list.list_value[l_idx].size_of()!=item_size)
          TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.TdmaFnTn containing a value list with different sizes.");
      }
      return item_size;
    }
  case OMIT_VALUE:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.TdmaFnTn containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.TdmaFnTn containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.TdmaFnTn containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.TdmaFnTn containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.TdmaFnTn containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests.TdmaFnTn containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BTS_Tests.TdmaFnTn.");
  }
  return 0;
}

void TdmaFnTn_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ fn := ");
single_value->field_fn.log();
TTCN_Logger::log_event_str(", tn := ");
single_value->field_tn.log();
TTCN_Logger::log_event_str(" }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_ifpresent();
}

void TdmaFnTn_template::log_match(const TdmaFnTn& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
} else{
if (template_selection == SPECIFIC_VALUE) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
if(!single_value->field_fn.match(match_value.fn(), legacy)){
TTCN_Logger::log_logmatch_info(".fn");
single_value->field_fn.log_match(match_value.fn(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_tn.match(match_value.tn(), legacy)){
TTCN_Logger::log_logmatch_info(".tn");
single_value->field_tn.log_match(match_value.tn(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE) {
TTCN_Logger::log_event_str("{ fn := ");
single_value->field_fn.log_match(match_value.fn(), legacy);
TTCN_Logger::log_event_str(", tn := ");
single_value->field_tn.log_match(match_value.tn(), legacy);
TTCN_Logger::log_event_str(" }");
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void TdmaFnTn_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (fn().is_bound()) fn().set_implicit_omit();
if (tn().is_bound()) tn().set_implicit_omit();
}

void TdmaFnTn_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_fn.encode_text(text_buf);
single_value->field_tn.encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BTS_Tests.TdmaFnTn.");
}
}

void TdmaFnTn_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
single_value->field_fn.decode_text(text_buf);
single_value->field_tn.decode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new TdmaFnTn_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @BTS_Tests.TdmaFnTn.");
}
}

void TdmaFnTn_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE, "record template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    TdmaFnTn_template new_temp;
    new_temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      new_temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = new_temp;
    break; }
  case Module_Param::MP_Value_List:
    if (2<param.get_size()) {
      param.error("record template of type @BTS_Tests.TdmaFnTn has 2 fields but list value has %d fields", (int)param.get_size());
    }
    if (param.get_size()>0 && param.get_elem(0)->get_type()!=Module_Param::MP_NotUsed) fn().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) tn().set_param(*param.get_elem(1));
    break;
  case Module_Param::MP_Assignment_List: {
    Vector<bool> value_used(param.get_size());
    value_used.resize(param.get_size(), FALSE);
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "fn")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          fn().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      if (!strcmp(curr_param->get_id()->get_name(), "tn")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          tn().set_param(*curr_param);
        }
        value_used[val_idx]=TRUE;
      }
    }
    for (size_t val_idx=0; val_idx<param.get_size(); val_idx++) if (!value_used[val_idx]) {
      Module_Param* const curr_param = param.get_elem(val_idx);
      curr_param->error("Non existent field name in type @BTS_Tests.TdmaFnTn: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    TdmaFnTn_template* precondition = new TdmaFnTn_template;
    precondition->set_param(*param.get_elem(0));
    TdmaFnTn_template* implied_template = new TdmaFnTn_template;
    implied_template->set_param(*param.get_elem(1));
    *this = TdmaFnTn_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BTS_Tests.TdmaFnTn");
  }
  is_ifpresent = param.get_ifpresent();
}

void TdmaFnTn_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
single_value->field_fn.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.TdmaFnTn");
single_value->field_tn.check_restriction(t_res, t_name ? t_name : "@BTS_Tests.TdmaFnTn");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@BTS_Tests.TdmaFnTn");
}

boolean TdmaFnTn_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean TdmaFnTn_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int l_idx=0; l_idx<value_list.n_values; l_idx++)
if (value_list.list_value[l_idx].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

as__pcuif__check__pdch__mask_Default::as__pcuif__check__pdch__mask_Default(const INTEGER& pcu__conn__id, const BITSTRING& exp, const INTEGER& bts__nr, const INTEGER& trx__nr)
 : Default_Base("as_pcuif_check_pdch_mask"), par_pcu__conn__id(pcu__conn__id), par_exp(exp), par_bts__nr(bts__nr), par_trx__nr(trx__nr)
{
}

alt_status as__pcuif__check__pdch__mask_Default::call_altstep(boolean first_alt_run)
{
return as__pcuif__check__pdch__mask_instance(par_pcu__conn__id, par_exp, par_bts__nr, par_trx__nr, first_alt_run);
}


const RllTestCase RllTestCases::UNBOUND_ELEM;
RllTestCases::RllTestCases()
{
val_ptr = NULL;
}

RllTestCases::RllTestCases(null_type)
{
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
}

RllTestCases::RllTestCases(const RllTestCases& other_value)
{
if (!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BTS_Tests.RllTestCases.");
val_ptr = other_value.val_ptr;
val_ptr->ref_count++;
}

RllTestCases::~RllTestCases()
{
clean_up();
if (val_ptr != NULL) val_ptr = NULL;
}

void RllTestCases::clean_up()
{
if (val_ptr != NULL) {
if (val_ptr->ref_count > 1) {
val_ptr->ref_count--;
val_ptr = NULL;
}
else if (val_ptr->ref_count == 1) {
for (int elem_count = 0; elem_count < val_ptr->n_elements;
elem_count++)
if (val_ptr->value_elements[elem_count] != NULL)
delete val_ptr->value_elements[elem_count];
free_pointers((void**)val_ptr->value_elements);
delete val_ptr;
val_ptr = NULL;
}
else
TTCN_error("Internal error: Invalid reference counter in a record of/set of value.");
}
}

RllTestCases& RllTestCases::operator=(null_type)
{
clean_up();
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
return *this;
}

RllTestCases& RllTestCases::operator=(const RllTestCases& other_value)
{
if (other_value.val_ptr == NULL) TTCN_error("Assigning an unbound value of type @BTS_Tests.RllTestCases.");
if (this != &other_value) {
clean_up();
val_ptr = other_value.val_ptr;
val_ptr->ref_count++;
}
return *this;
}

boolean RllTestCases::operator==(null_type) const
{
if (val_ptr == NULL)
TTCN_error("The left operand of comparison is an unbound value of type @BTS_Tests.RllTestCases.");
return val_ptr->n_elements == 0 ;
}

boolean RllTestCases::operator==(const RllTestCases& other_value) const
{
if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @BTS_Tests.RllTestCases.");
if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @BTS_Tests.RllTestCases.");
if (val_ptr == other_value.val_ptr) return TRUE;
if (val_ptr->n_elements != (other_value.val_ptr)->n_elements)
return FALSE;
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++){
if (val_ptr->value_elements[elem_count] != NULL){
if ((other_value.val_ptr)->value_elements[elem_count] != NULL){
  if (*val_ptr->value_elements[elem_count] != *(other_value.val_ptr)->value_elements[elem_count]) return FALSE;
} else return FALSE;
} else {
if ((other_value.val_ptr)->value_elements[elem_count] != NULL) return FALSE;
}
}
return TRUE;
}

RllTestCase& RllTestCases::operator[](int index_value)
{
if (index_value < 0) TTCN_error("Accessing an element of type @BTS_Tests.RllTestCases using a negative index: %d.", index_value);
if (val_ptr == NULL) {
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
} else if (val_ptr->ref_count > 1) {
struct recordof_setof_struct *new_val_ptr = new recordof_setof_struct;
new_val_ptr->ref_count = 1;
new_val_ptr->n_elements = (index_value >= val_ptr->n_elements) ? index_value + 1 : val_ptr->n_elements;
new_val_ptr->value_elements = (RllTestCase**)allocate_pointers(new_val_ptr->n_elements);
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++){
if (val_ptr->value_elements[elem_count] != NULL){
new_val_ptr->value_elements[elem_count] = new RllTestCase(*(val_ptr->value_elements[elem_count]));
}
}
clean_up();
val_ptr = new_val_ptr;
}
if (index_value >= val_ptr->n_elements) set_size(index_value + 1);
if (val_ptr->value_elements[index_value] == NULL) {
val_ptr->value_elements[index_value] = new RllTestCase;
}
return *val_ptr->value_elements[index_value];
}

RllTestCase& RllTestCases::operator[](const INTEGER& index_value)
{
index_value.must_bound("Using an unbound integer value for indexing a value of type @BTS_Tests.RllTestCases.");
return (*this)[(int)index_value];
}

const RllTestCase& RllTestCases::operator[](int index_value) const
{
if (val_ptr == NULL)
TTCN_error("Accessing an element in an unbound value of type @BTS_Tests.RllTestCases.");
if (index_value < 0) TTCN_error("Accessing an element of type @BTS_Tests.RllTestCases using a negative index: %d.", index_value);
if (index_value >= val_ptr->n_elements) TTCN_error("Index overflow in a value of type @BTS_Tests.RllTestCases: The index is %d, but the value has only %d elements.", index_value, val_ptr->n_elements);
return (val_ptr->value_elements[index_value] == NULL) ?
UNBOUND_ELEM : *val_ptr->value_elements[index_value];
}

const RllTestCase& RllTestCases::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a value of type @BTS_Tests.RllTestCases.");
return (*this)[(int)index_value];
}

RllTestCases RllTestCases::operator<<=(int rotate_count) const
{
return *this >>= (-rotate_count);
}

RllTestCases RllTestCases::operator<<=(const INTEGER& rotate_count) const
{
rotate_count.must_bound("Unbound integer operand of rotate left operator.");
return *this >>= (int)(-rotate_count);
}

RllTestCases RllTestCases::operator>>=(const INTEGER& rotate_count) const
{
rotate_count.must_bound("Unbound integer operand of rotate right operator.");
return *this >>= (int)rotate_count;
}

RllTestCases RllTestCases::operator>>=(int rotate_count) const
{
if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @BTS_Tests.RllTestCases.");
if (val_ptr->n_elements == 0) return *this;
int rc;
if (rotate_count>=0) rc = rotate_count % val_ptr->n_elements;
else rc = val_ptr->n_elements - ((-rotate_count) % val_ptr->n_elements);
if (rc == 0) return *this;
RllTestCases ret_val;
ret_val.set_size(val_ptr->n_elements);
for (int i=0; i<val_ptr->n_elements; i++) {
if (val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[(i+rc)%val_ptr->n_elements] =new RllTestCase(*val_ptr->value_elements[i]);
}
}
return ret_val;
}

RllTestCases RllTestCases::operator+(const RllTestCases& other_value) const
{
if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @BTS_Tests.RllTestCases concatenation.");
if (val_ptr->n_elements == 0) return other_value;
if (other_value.val_ptr->n_elements == 0) return *this;
RllTestCases ret_val;
ret_val.set_size(val_ptr->n_elements+other_value.val_ptr->n_elements);
for (int i=0; i<val_ptr->n_elements; i++) {
if (val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i] = new RllTestCase(*val_ptr->value_elements[i]);
}
}
for (int i=0; i<other_value.val_ptr->n_elements; i++) {
if (other_value.val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i+val_ptr->n_elements] = new RllTestCase(*other_value.val_ptr->value_elements[i]);
}
}
return ret_val;
}

RllTestCases RllTestCases::substr(int index, int returncount) const
{
if (val_ptr == NULL) TTCN_error("The first argument of substr() is an unbound value of type @BTS_Tests.RllTestCases.");
check_substr_arguments(val_ptr->n_elements, index, returncount, "@BTS_Tests.RllTestCases","element");
RllTestCases ret_val;
ret_val.set_size(returncount);
for (int i=0; i<returncount; i++) {
if (val_ptr->value_elements[i+index] != NULL) {
ret_val.val_ptr->value_elements[i] = new RllTestCase(*val_ptr->value_elements[i+index]);
}
}
return ret_val;
}

RllTestCases RllTestCases::replace(int index, int len, const RllTestCases& repl) const
{
if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @BTS_Tests.RllTestCases.");
if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @BTS_Tests.RllTestCases.");
check_replace_arguments(val_ptr->n_elements, index, len, "@BTS_Tests.RllTestCases","element");
RllTestCases ret_val;
ret_val.set_size(val_ptr->n_elements + repl.val_ptr->n_elements - len);
for (int i = 0; i < index; i++) {
if (val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i] = new RllTestCase(*val_ptr->value_elements[i]);
}
}
for (int i = 0; i < repl.val_ptr->n_elements; i++) {
if (repl.val_ptr->value_elements[i] != NULL) {
ret_val.val_ptr->value_elements[i+index] = new RllTestCase(*repl.val_ptr->value_elements[i]);
}
}
for (int i = 0; i < val_ptr->n_elements - index - len; i++) {
if (val_ptr->value_elements[index+i+len] != NULL) {
ret_val.val_ptr->value_elements[index+i+repl.val_ptr->n_elements] = new RllTestCase(*val_ptr->value_elements[index+i+len]);
}
}
return ret_val;
}

RllTestCases RllTestCases::replace(int index, int len, const RllTestCases_template& repl) const
{
if (!repl.is_value()) TTCN_error("The fourth argument of function replace() is a template with non-specific value.");
return replace(index, len, repl.valueof());
}

void RllTestCases::set_size(int new_size)
{
if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @BTS_Tests.RllTestCases.");
if (val_ptr == NULL) {
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = 0;
val_ptr->value_elements = NULL;
} else if (val_ptr->ref_count > 1) {
struct recordof_setof_struct *new_val_ptr = new recordof_setof_struct;
new_val_ptr->ref_count = 1;
new_val_ptr->n_elements = (new_size < val_ptr->n_elements) ? new_size : val_ptr->n_elements;
new_val_ptr->value_elements = (RllTestCase**)allocate_pointers(new_val_ptr->n_elements);
for (int elem_count = 0; elem_count < new_val_ptr->n_elements; elem_count++) {
if (val_ptr->value_elements[elem_count] != NULL){
new_val_ptr->value_elements[elem_count] = new RllTestCase(*(val_ptr->value_elements[elem_count]));
}
}
clean_up();
val_ptr = new_val_ptr;
}
if (new_size > val_ptr->n_elements) {
val_ptr->value_elements = (RllTestCase**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size);
#ifdef TITAN_MEMORY_DEBUG_SET_RECORD_OF
if((val_ptr->n_elements/1000)!=(new_size/1000)) TTCN_warning("New size of type @BTS_Tests.RllTestCases: %d",new_size);
#endif
val_ptr->n_elements = new_size;
} else if (new_size < val_ptr->n_elements) {
for (int elem_count = new_size; elem_count < val_ptr->n_elements; elem_count++)
if (val_ptr->value_elements[elem_count] != NULL)delete val_ptr->value_elements[elem_count];
val_ptr->value_elements = (RllTestCase**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size);
val_ptr->n_elements = new_size;
}
}

boolean RllTestCases::is_value() const
{
if (val_ptr == NULL) return FALSE;
for(int i = 0; i < val_ptr->n_elements; ++i) {
if (val_ptr->value_elements[i] == NULL || !val_ptr->value_elements[i]->is_value()) return FALSE;
}
return TRUE;
}

int RllTestCases::size_of() const
{
if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @BTS_Tests.RllTestCases.");
return val_ptr->n_elements;
}

int RllTestCases::lengthof() const
{
if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @BTS_Tests.RllTestCases.");
for (int my_length=val_ptr->n_elements; my_length>0; my_length--) if (val_ptr->value_elements[my_length-1] != NULL) return my_length;
return 0;
}

void RllTestCases::log() const
{
if (val_ptr == NULL) {;
TTCN_Logger::log_event_unbound();
return;
}
switch (val_ptr->n_elements) {
case 0:
TTCN_Logger::log_event_str("{ }");
break;
default:
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
(*this)[elem_count].log();
}
TTCN_Logger::log_event_str(" }");
}
}

void RllTestCases::set_implicit_omit()
{
if (val_ptr == NULL) return;
for (int i = 0; i < val_ptr->n_elements; i++) {
if (val_ptr->value_elements[i] != NULL) val_ptr->value_elements[i]->set_implicit_omit();
}
}

void RllTestCases::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_VALUE|Module_Param::BC_LIST, "record of value");
  switch (param.get_operation_type()) {
  case Module_Param::OT_ASSIGN:
    if (param.get_type()==Module_Param::MP_Value_List && param.get_size()==0) {
      *this = NULL_VALUE;
      return;
    }
    switch (param.get_type()) {
    case Module_Param::MP_Value_List:
      set_size(param.get_size());
      for (size_t i=0; i<param.get_size(); ++i) {
        Module_Param* const curr = param.get_elem(i);
        if (curr->get_type()!=Module_Param::MP_NotUsed) {
          (*this)[i].set_param(*curr);
          if (!(*this)[i].is_bound()) {
            delete val_ptr->value_elements[i];
            val_ptr->value_elements[i] = NULL;
          }
        }
      }
      break;
    case Module_Param::MP_Indexed_List:
      for (size_t i=0; i<param.get_size(); ++i) {
        Module_Param* const curr = param.get_elem(i);
        (*this)[curr->get_id()->get_index()].set_param(*curr);
        if (!(*this)[curr->get_id()->get_index()].is_bound()) {
          delete val_ptr->value_elements[curr->get_id()->get_index()];
          val_ptr->value_elements[curr->get_id()->get_index()] = NULL;
        }
      }
      break;
    default:
      param.type_error("record of value", "@BTS_Tests.RllTestCases");
    }
    break;
  case Module_Param::OT_CONCAT:
    switch (param.get_type()) {
    case Module_Param::MP_Value_List: {
      if (!is_bound()) *this = NULL_VALUE;
      int start_idx = lengthof();
      for (size_t i=0; i<param.get_size(); ++i) {
        Module_Param* const curr = param.get_elem(i);
        if ((curr->get_type()!=Module_Param::MP_NotUsed)) {
          (*this)[start_idx+(int)i].set_param(*curr);
        }
      }
    } break;
    case Module_Param::MP_Indexed_List:
      param.error("Cannot concatenate an indexed value list");
      break;
    default:
      param.type_error("record of value", "@BTS_Tests.RllTestCases");
    }
    break;
  default:
    TTCN_error("Internal error: Unknown operation type.");
  }
}

void RllTestCases::encode_text(Text_Buf& text_buf) const
{
if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @BTS_Tests.RllTestCases.");
text_buf.push_int(val_ptr->n_elements);
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++)
(*this)[elem_count].encode_text(text_buf);
}

void RllTestCases::decode_text(Text_Buf& text_buf)
{
clean_up();
val_ptr = new recordof_setof_struct;
val_ptr->ref_count = 1;
val_ptr->n_elements = text_buf.pull_int().get_val();
if (val_ptr->n_elements < 0) TTCN_error("Text decoder: Negative size was received for a value of type @BTS_Tests.RllTestCases.");
val_ptr->value_elements = (RllTestCase**)allocate_pointers(val_ptr->n_elements);
for (int elem_count = 0; elem_count < val_ptr->n_elements; elem_count++) {
val_ptr->value_elements[elem_count] = new RllTestCase;
val_ptr->value_elements[elem_count]->decode_text(text_buf);
}
}

void RllTestCases_template::copy_value(const RllTestCases& other_value)
{
if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @BTS_Tests.RllTestCases with an unbound value.");
single_value.n_elements = other_value.size_of();
single_value.value_elements = (RllTestCase_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (other_value[elem_count].is_bound()) {
single_value.value_elements[elem_count] = new RllTestCase_template(other_value[elem_count]);
} else {
single_value.value_elements[elem_count] = new RllTestCase_template;
}
}
set_selection(SPECIFIC_VALUE);
}

void RllTestCases_template::copy_template(const RllTestCases_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value.n_elements = other_value.single_value.n_elements;
single_value.value_elements = (RllTestCase_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (UNINITIALIZED_TEMPLATE != other_value.single_value.value_elements[elem_count]->get_selection()) {
single_value.value_elements[elem_count] = new RllTestCase_template(*other_value.single_value.value_elements[elem_count]);
} else {
single_value.value_elements[elem_count] = new RllTestCase_template;
}
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new RllTestCases_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].copy_template(other_value.value_list.list_value[list_count]);
break;
case IMPLICATION_MATCH:
implication_.precondition = new RllTestCases_template(*other_value.implication_.precondition);
implication_.implied_template = new RllTestCases_template(*other_value.implication_.implied_template);
break;
case DYNAMIC_MATCH:
dyn_match = other_value.dyn_match;
dyn_match->ref_count++;
break;
default:
TTCN_error("Copying an uninitialized/unsupported template of type @BTS_Tests.RllTestCases.");
break;
}
set_selection(other_value);
}

boolean RllTestCases_template::match_function_specific(const Base_Type *value_ptr, int value_index, const Restricted_Length_Template *template_ptr, int template_index, boolean legacy)
{
if (value_index >= 0) return ((const RllTestCases_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const RllTestCases*)value_ptr)[value_index], legacy);
else return ((const RllTestCases_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit();
}

RllTestCases_template::RllTestCases_template()
{
}

RllTestCases_template::RllTestCases_template(template_sel other_value)
 : Base_Record_Of_Template(other_value)
{
check_single_selection(other_value);
}

RllTestCases_template::RllTestCases_template(null_type)
 : Base_Record_Of_Template(SPECIFIC_VALUE)
{
single_value.n_elements = 0;
single_value.value_elements = NULL;
}

RllTestCases_template::RllTestCases_template(const RllTestCases& other_value)
{
copy_value(other_value);
}

RllTestCases_template::RllTestCases_template(const OPTIONAL<RllTestCases>& other_value)
{
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const RllTestCases&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Creating a template of type @BTS_Tests.RllTestCases from an unbound optional field.");
}
}

RllTestCases_template::RllTestCases_template(RllTestCases_template* p_precondition, RllTestCases_template* p_implied_template)
 : Base_Record_Of_Template(IMPLICATION_MATCH)
{
implication_.precondition = p_precondition;
implication_.implied_template = p_implied_template;
}

RllTestCases_template::RllTestCases_template(Dynamic_Match_Interface<RllTestCases>* p_dyn_match)
 : Base_Record_Of_Template(DYNAMIC_MATCH)
{
dyn_match = new dynmatch_struct<RllTestCases>;
dyn_match->ptr = p_dyn_match;
dyn_match->ref_count = 1;
}

RllTestCases_template::RllTestCases_template(const RllTestCases_template& other_value)
 : Base_Record_Of_Template()
{
copy_template(other_value);
}

RllTestCases_template::~RllTestCases_template()
{
clean_up();
}

void RllTestCases_template::clean_up()
{
switch (template_selection) {
case SPECIFIC_VALUE:
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
delete single_value.value_elements[elem_count];
free_pointers((void**)single_value.value_elements);
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
delete [] value_list.list_value;
break;
case IMPLICATION_MATCH:
delete implication_.precondition;
delete implication_.implied_template;
break;
case DYNAMIC_MATCH:
dyn_match->ref_count--;
if (dyn_match->ref_count == 0) {
delete dyn_match->ptr;
delete dyn_match;
}
break;
default:
break;
}
template_selection = UNINITIALIZED_TEMPLATE;
}

RllTestCases_template& RllTestCases_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

RllTestCases_template& RllTestCases_template::operator=(null_type)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value.n_elements = 0;
single_value.value_elements = NULL;
return *this;
}

RllTestCases_template& RllTestCases_template::operator=(const RllTestCases& other_value)
{
clean_up();
copy_value(other_value);
return *this;
}

RllTestCases_template& RllTestCases_template::operator=(const OPTIONAL<RllTestCases>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const RllTestCases&)other_value);
break;
case OPTIONAL_OMIT:
set_selection(OMIT_VALUE);
break;
default:
TTCN_error("Assignment of an unbound optional field to a template of type @BTS_Tests.RllTestCases.");
}
return *this;
}

RllTestCases_template& RllTestCases_template::operator=(const RllTestCases_template& other_value)
{
if (&other_value != this) {
clean_up();
copy_template(other_value);
}
return *this;
}

RllTestCase_template& RllTestCases_template::operator[](int index_value)
{
if (index_value < 0) TTCN_error("Accessing an element of a template for type @BTS_Tests.RllTestCases using a negative index: %d.", index_value);
switch (template_selection)
{
  case SPECIFIC_VALUE:
    if(index_value < single_value.n_elements) break;
    // no break
  case OMIT_VALUE:
  case ANY_VALUE:
  case ANY_OR_OMIT:
  case UNINITIALIZED_TEMPLATE:
    set_size(index_value + 1);
    break;
  default:
    TTCN_error("Accessing an element of a non-specific template for type @BTS_Tests.RllTestCases.");
    break;
}
return *single_value.value_elements[index_value];
}

RllTestCase_template& RllTestCases_template::operator[](const INTEGER& index_value)
{
index_value.must_bound("Using an unbound integer value for indexing a template of type @BTS_Tests.RllTestCases.");
return (*this)[(int)index_value];
}

const RllTestCase_template& RllTestCases_template::operator[](int index_value) const
{
if (index_value < 0) TTCN_error("Accessing an element of a template for type @BTS_Tests.RllTestCases using a negative index: %d.", index_value);
if (template_selection != SPECIFIC_VALUE) TTCN_error("Accessing an element of a non-specific template for type @BTS_Tests.RllTestCases.");
if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @BTS_Tests.RllTestCases: The index is %d, but the template has only %d elements.", index_value, single_value.n_elements);
return *single_value.value_elements[index_value];
}

const RllTestCase_template& RllTestCases_template::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a template of type @BTS_Tests.RllTestCases.");
return (*this)[(int)index_value];
}

void RllTestCases_template::set_size(int new_size)
{
if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a template of type @BTS_Tests.RllTestCases.");
template_sel old_selection = template_selection;
if (old_selection != SPECIFIC_VALUE) {
clean_up();
set_selection(SPECIFIC_VALUE);
single_value.n_elements = 0;
single_value.value_elements = NULL;
}
if (new_size > single_value.n_elements) {
single_value.value_elements = (RllTestCase_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size);
if (old_selection == ANY_VALUE || old_selection == ANY_OR_OMIT) {
for (int elem_count = single_value.n_elements; elem_count < new_size; elem_count++)
single_value.value_elements[elem_count] = new RllTestCase_template(ANY_VALUE);
} else {
for (int elem_count = single_value.n_elements; elem_count < new_size; elem_count++)
single_value.value_elements[elem_count] = new RllTestCase_template;
}
single_value.n_elements = new_size;
} else if (new_size < single_value.n_elements) {
for (int elem_count = new_size; elem_count < single_value.n_elements; elem_count++)
delete single_value.value_elements[elem_count];
single_value.value_elements = (RllTestCase_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size);
single_value.n_elements = new_size;
}
}

int RllTestCases_template::n_elem() const
{
  switch (template_selection) {
  case SPECIFIC_VALUE:
    return single_value.n_elements;
    break;
  case VALUE_LIST:
    return value_list.n_values;
    break;
  default:
    TTCN_error("Performing n_elem");
  }
}

int RllTestCases_template::size_of(boolean is_size) const
{
const char* op_name = is_size ? "size" : "length";
int min_size;
boolean has_any_or_none;
if (is_ifpresent) TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.RllTestCases which has an ifpresent attribute.", op_name);
switch (template_selection)
{
case SPECIFIC_VALUE: {
  min_size = 0;
  has_any_or_none = FALSE;
  int elem_count = single_value.n_elements;
  if (!is_size) { while (elem_count>0 && !single_value.value_elements[elem_count-1]->is_bound()) elem_count--; }
  for (int i=0; i<elem_count; i++) {
    switch (single_value.value_elements[i]->get_selection()) {
    case OMIT_VALUE:
      TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.RllTestCases containing omit element.", op_name);
    case ANY_OR_OMIT:
      has_any_or_none = TRUE;
      break;
    default:
      min_size++;
      break;
    }
  }
} break;
case OMIT_VALUE:
  TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.RllTestCases containing omit value.", op_name);
case ANY_VALUE:
case ANY_OR_OMIT:
  min_size = 0;
  has_any_or_none = TRUE;
  break;
case VALUE_LIST:
{
  if (value_list.n_values<1)
    TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.RllTestCases containing an empty list.", op_name);
  int item_size = value_list.list_value[0].size_of(is_size);
  for (unsigned int i = 1; i < value_list.n_values; i++) {
    if (value_list.list_value[i].size_of(is_size)!=item_size)
      TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.RllTestCases containing a value list with different sizes.", op_name);
  }
  min_size = item_size;
  has_any_or_none = FALSE;
  break;
}
case COMPLEMENTED_LIST:
  TTCN_error("Performing %sof() operation on a template of type @BTS_Tests.RllTestCases containing complemented list.", op_name);
default:
  TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @BTS_Tests.RllTestCases.", op_name);
}
return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @BTS_Tests.RllTestCases");
}

boolean RllTestCases_template::match(const RllTestCases& other_value, boolean legacy) const
{
if (!other_value.is_bound()) return FALSE;
int value_length = other_value.size_of();
if (!match_length(value_length)) return FALSE;
switch (template_selection) {
case SPECIFIC_VALUE:
return match_record_of(&other_value, value_length, this, single_value.n_elements, match_function_specific, legacy);
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
if (value_list.list_value[list_count].match(other_value, legacy)) return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
case CONJUNCTION_MATCH:
for (unsigned int i = 0; i < value_list.n_values; i++) {
if (!value_list.list_value[i].match(other_value)) {
return FALSE;
}
}
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match(other_value) || implication_.implied_template->match(other_value);
case DYNAMIC_MATCH:
return dyn_match->ptr->match(other_value);
default:
TTCN_error("Matching with an uninitialized/unsupported template of type @BTS_Tests.RllTestCases.");
}
return FALSE;
}

boolean RllTestCases_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
if (!single_value.value_elements[elem_count]->is_value()) return FALSE;
return TRUE;
}

RllTestCases RllTestCases_template::valueof() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) TTCN_error("Performing a valueof or send operation on a non-specific template of type @BTS_Tests.RllTestCases.");
RllTestCases ret_val;
ret_val.set_size(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
if (single_value.value_elements[elem_count]->is_bound()) {
ret_val[elem_count] = single_value.value_elements[elem_count]->valueof();
}
return ret_val;
}

RllTestCases RllTestCases_template::substr(int index, int returncount) const
{
if (!is_value()) TTCN_error("The first argument of function substr() is a template with non-specific value.");
return valueof().substr(index, returncount);
}

RllTestCases RllTestCases_template::replace(int index, int len, const RllTestCases_template& repl) const
{
if (!is_value()) TTCN_error("The first argument of function replace() is a template with non-specific value.");
if (!repl.is_value()) TTCN_error("The fourth argument of function replace() is a template with non-specific value.");
return valueof().replace(index, len, repl.valueof());
}

RllTestCases RllTestCases_template::replace(int index, int len, const RllTestCases& repl) const
{
if (!is_value()) TTCN_error("The first argument of function replace() is a template with non-specific value.");
return valueof().replace(index, len, repl);
}

void RllTestCases_template::set_type(template_sel template_type, unsigned int list_length)
{
clean_up();
switch (template_type) {
case VALUE_LIST:
case COMPLEMENTED_LIST:
case CONJUNCTION_MATCH:
value_list.n_values = list_length;
value_list.list_value = new RllTestCases_template[list_length];
break;
default:
TTCN_error("Internal error: Setting an invalid type for a template of type @BTS_Tests.RllTestCases.");
}
set_selection(template_type);
}

RllTestCases_template& RllTestCases_template::list_item(unsigned int list_index)
{
if (template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST && template_selection != CONJUNCTION_MATCH) TTCN_error("Internal error: Accessing a list element of a non-list template of type @BTS_Tests.RllTestCases.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @BTS_Tests.RllTestCases.");
return value_list.list_value[list_index];
}

void RllTestCases_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
if (single_value.n_elements > 0) {
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
if (permutation_starts_at(elem_count)) TTCN_Logger::log_event_str("permutation(");
single_value.value_elements[elem_count]->log();
if (permutation_ends_at(elem_count)) TTCN_Logger::log_char(')');
}
TTCN_Logger::log_event_str(" }");
} else TTCN_Logger::log_event_str("{ }");
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case CONJUNCTION_MATCH:
if (template_selection == CONJUNCTION_MATCH) {
TTCN_Logger::log_event_str("conjunct");
}
case VALUE_LIST:
TTCN_Logger::log_char('(');
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++) {
if (list_count > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[list_count].log();
}
TTCN_Logger::log_char(')');
break;
case IMPLICATION_MATCH:
implication_.precondition->log();
TTCN_Logger::log_event_str(" implies ");
implication_.implied_template->log();
break;
case DYNAMIC_MATCH:
TTCN_Logger::log_event_str("@dynamic template");
break;
default:
log_generic();
}
log_restricted();
log_ifpresent();
}

void RllTestCases_template::log_match(const RllTestCases& match_value, boolean legacy) const
{
if(TTCN_Logger::VERBOSITY_COMPACT == TTCN_Logger::get_matching_verbosity()){
if(match(match_value, legacy)){
TTCN_Logger::print_logmatch_buffer();
TTCN_Logger::log_event_str(" matched");
}else{
if (template_selection == SPECIFIC_VALUE && single_value.n_elements > 0 && get_number_of_permutations() == 0 && single_value.n_elements == match_value.size_of()) {
size_t previous_size = TTCN_Logger::get_logmatch_buffer_len();
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if(!single_value.value_elements[elem_count]->match(match_value[elem_count], legacy)){
TTCN_Logger::log_logmatch_info("[%d]", elem_count);
single_value.value_elements[elem_count]->log_match(match_value[elem_count], legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
}
log_match_length(single_value.n_elements);
} else {
TTCN_Logger::print_logmatch_buffer();
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
TTCN_Logger::log_event_str(" unmatched");
}
}
return;
}
if (template_selection == SPECIFIC_VALUE && single_value.n_elements > 0 && get_number_of_permutations() == 0 && single_value.n_elements == match_value.size_of()) {
TTCN_Logger::log_event_str("{ ");
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
if (elem_count > 0) TTCN_Logger::log_event_str(", ");
single_value.value_elements[elem_count]->log_match(match_value[elem_count], legacy);
}
TTCN_Logger::log_event_str(" }");
log_match_length(single_value.n_elements);
} else {
match_value.log();
TTCN_Logger::log_event_str(" with ");
log();
if (match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}
}

void RllTestCases_template::encode_text(Text_Buf& text_buf) const
{
encode_text_permutation(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
text_buf.push_int(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++)
single_value.value_elements[elem_count]->encode_text(text_buf);
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BTS_Tests.RllTestCases.");
}
}

void RllTestCases_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_permutation(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value.n_elements = text_buf.pull_int().get_val();
if (single_value.n_elements < 0) TTCN_error("Text decoder: Negative size was received for a template of type @BTS_Tests.RllTestCases.");
single_value.value_elements = (RllTestCase_template**)allocate_pointers(single_value.n_elements);
for (int elem_count = 0; elem_count < single_value.n_elements; elem_count++) {
single_value.value_elements[elem_count] = new RllTestCase_template;
single_value.value_elements[elem_count]->decode_text(text_buf);
}
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new RllTestCases_template[value_list.n_values];
for (unsigned int list_count = 0; list_count < value_list.n_values; list_count++)
value_list.list_value[list_count].decode_text(text_buf);
break;
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received for a template of type @BTS_Tests.RllTestCases.");
}
}

boolean RllTestCases_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean RllTestCases_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case IMPLICATION_MATCH:
return !implication_.precondition->match_omit() || implication_.implied_template->match_omit();
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void RllTestCases_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
for (int i = 0; i < single_value.n_elements; i++) {
if (single_value.value_elements[i] != NULL) single_value.value_elements[i]->set_implicit_omit();
}
}

void RllTestCases_template::set_param(Module_Param& param)
{
  param.basic_check(Module_Param::BC_TEMPLATE|Module_Param::BC_LIST, "record of template");
  switch (param.get_type()) {
  case Module_Param::MP_Omit:
    *this = OMIT_VALUE;
    break;
  case Module_Param::MP_Any:
    *this = ANY_VALUE;
    break;
  case Module_Param::MP_AnyOrNone:
    *this = ANY_OR_OMIT;
    break;
  case Module_Param::MP_List_Template:
  case Module_Param::MP_ComplementList_Template:
  case Module_Param::MP_ConjunctList_Template: {
    RllTestCases_template temp;
    temp.set_type(param.get_type()==Module_Param::MP_List_Template ? VALUE_LIST : (param.get_type() == Module_Param::MP_ConjunctList_Template ? CONJUNCTION_MATCH : COMPLEMENTED_LIST), param.get_size());
    for (size_t p_i=0; p_i<param.get_size(); p_i++) {
      temp.list_item(p_i).set_param(*param.get_elem(p_i));
    }
    *this = temp;
    break; }
  case Module_Param::MP_Indexed_List:
    if (template_selection!=SPECIFIC_VALUE) set_size(0);
    for (size_t p_i=0; p_i<param.get_size(); ++p_i) {
      (*this)[(int)(param.get_elem(p_i)->get_id()->get_index())].set_param(*param.get_elem(p_i));
    }
    break;
  case Module_Param::MP_Value_List: {
    set_size(param.get_size());
    int curr_idx = 0;
    for (size_t p_i=0; p_i<param.get_size(); ++p_i) {
      switch (param.get_elem(p_i)->get_type()) {
      case Module_Param::MP_NotUsed:
        curr_idx++;
        break;
      case Module_Param::MP_Permutation_Template: {
        int perm_start_idx = curr_idx;
        Module_Param* param_i = param.get_elem(p_i);
        for (size_t perm_i=0; perm_i<param_i->get_size(); perm_i++) {
          (*this)[curr_idx].set_param(*(param_i->get_elem(perm_i)));
          curr_idx++;
        }
        int perm_end_idx = curr_idx - 1;
        add_permutation(perm_start_idx, perm_end_idx);
      } break;
      default:
        (*this)[curr_idx].set_param(*param.get_elem(p_i));
        curr_idx++;
      }
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    RllTestCases_template* precondition = new RllTestCases_template;
    precondition->set_param(*param.get_elem(0));
    RllTestCases_template* implied_template = new RllTestCases_template;
    implied_template->set_param(*param.get_elem(1));
    *this = RllTestCases_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record of template", "@BTS_Tests.RllTestCases");
  }
  is_ifpresent = param.get_ifpresent();
  set_length_range(param);
}

void RllTestCases_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_OMIT:
if (template_selection==OMIT_VALUE) return;
case TR_VALUE:
if (template_selection!=SPECIFIC_VALUE || is_ifpresent) break;
for (int i=0; i<single_value.n_elements; i++) single_value.value_elements[i]->check_restriction(t_res, t_name ? t_name : "@BTS_Tests.RllTestCases");
return;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@BTS_Tests.RllTestCases");
}

boolean RllTestCases_template::get_istemplate_kind(const char* type) const {
if (!strcmp(type, "AnyElement")) {
  if (template_selection != SPECIFIC_VALUE) {
    return FALSE;
  }
  for (int i = 0; i < single_value.n_elements; i++) {
    if (single_value.value_elements[i]->get_selection() == ANY_VALUE) {
      return TRUE;
    }
  }
  return FALSE;
} else if (!strcmp(type, "AnyElementsOrNone")) {
  if (template_selection != SPECIFIC_VALUE) {
    return FALSE;
  }
  for (int i = 0; i < single_value.n_elements; i++) {
    if (single_value.value_elements[i]->get_selection() == ANY_OR_OMIT) {
      return TRUE;
    }
  }
  return FALSE;
} else if (!strcmp(type, "permutation")) {
  return number_of_permutations;
} else if (!strcmp(type, "length")) {
  return length_restriction_type != NO_LENGTH_RESTRICTION;
} else {
  return Base_Template::get_istemplate_kind(type);
}
}
as__l1__exp__lapdm_Default::as__l1__exp__lapdm_Default(const LAPDm__Types::LapdmFrame_template& exp)
 : Default_Base("as_l1_exp_lapdm"), par_exp(exp)
{
}

alt_status as__l1__exp__lapdm_Default::call_altstep(boolean first_alt_run)
{
return as__l1__exp__lapdm_instance(par_exp, first_alt_run);
}

as__rsl__any__ind_Default::as__rsl__any__ind_Default(const BOOLEAN& exp__any)
 : Default_Base("as_rsl_any_ind"), par_exp__any(exp__any)
{
}

alt_status as__rsl__any__ind_Default::call_altstep(boolean first_alt_run)
{
return as__rsl__any__ind_instance(par_exp__any, first_alt_run);
}

f__TC__ms__pwr__ctrl__cb::f__TC__ms__pwr__ctrl__cb()
{
referred_function = NULL;
}

f__TC__ms__pwr__ctrl__cb::f__TC__ms__pwr__ctrl__cb(function_pointer other_value)
{
referred_function = other_value;
}

f__TC__ms__pwr__ctrl__cb::f__TC__ms__pwr__ctrl__cb(const f__TC__ms__pwr__ctrl__cb& other_value)
: Base_Type(){
other_value.must_bound("Copying an unbound @BTS_Tests.f_TC_ms_pwr_ctrl_cb value.");
referred_function = other_value.referred_function;
}

f__TC__ms__pwr__ctrl__cb& f__TC__ms__pwr__ctrl__cb::operator=(function_pointer other_value)
{
referred_function = other_value;
return *this;
}

f__TC__ms__pwr__ctrl__cb& f__TC__ms__pwr__ctrl__cb::operator=(const f__TC__ms__pwr__ctrl__cb& other_value)
{
other_value.must_bound("Assignment of an unbound value.");
referred_function = other_value.referred_function;
return *this;
}

boolean f__TC__ms__pwr__ctrl__cb::operator==(function_pointer other_value) const
{
must_bound("Unbound left operand of @BTS_Tests.f_TC_ms_pwr_ctrl_cb comparison.");
return referred_function == other_value;
}

boolean f__TC__ms__pwr__ctrl__cb::operator==(const f__TC__ms__pwr__ctrl__cb& other_value) const
{
must_bound("Unbound left operand of @BTS_Tests.f_TC_ms_pwr_ctrl_cb comparison.");
other_value.must_bound("Unbound right operand of @BTS_Tests.f_TC_ms_pwr_ctrl_cb comparison.");
return referred_function == other_value.referred_function;
}

OCTETSTRING f__TC__ms__pwr__ctrl__cb::invoke(GSM__RR__Types::SacchL1Header& l1h, const INTEGER& num__blocks) const
{
must_bound("Call of unbound function.");
if(referred_function == (f__TC__ms__pwr__ctrl__cb::function_pointer)Module_List::get_fat_null())
TTCN_error("null reference cannot be invoked.");
return referred_function(l1h, num__blocks);
}

void f__TC__ms__pwr__ctrl__cb::start(const COMPONENT& component_reference, GSM__RR__Types::SacchL1Header& l1h, const INTEGER& num__blocks) const
{
((f__TC__ms__pwr__ctrl__cb::start_pointer)Module_List::lookup_start_by_function_address((genericfunc_t)referred_function))(component_reference, l1h, num__blocks);
}

void f__TC__ms__pwr__ctrl__cb::log() const
{
Module_List::log_function((genericfunc_t)referred_function);
}

void f__TC__ms__pwr__ctrl__cb::set_param(Module_Param& param)
{
  param.error("Not supported.");
}

void f__TC__ms__pwr__ctrl__cb::encode_text(Text_Buf& text_buf) const
{
Module_List::encode_function(text_buf,(genericfunc_t)referred_function);
}

void f__TC__ms__pwr__ctrl__cb::decode_text(Text_Buf& text_buf)
{
Module_List::decode_function(text_buf,(genericfunc_t*)&referred_function);
}

boolean operator==(f__TC__ms__pwr__ctrl__cb::function_pointer value, const f__TC__ms__pwr__ctrl__cb& other_value)
{
other_value.must_bound("Unbound right operand of @BTS_Tests.f_TC_ms_pwr_ctrl_cb comparison.");
return value == other_value.referred_function;
}

void f__TC__ms__pwr__ctrl__cb_template::copy_template(const f__TC__ms__pwr__ctrl__cb_template& other_value)
{
switch(other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = other_value.single_value;
break;
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = other_value.value_list.n_values;
value_list.list_value = new f__TC__ms__pwr__ctrl__cb_template[value_list.n_values];
for(unsigned int i = 0; i < value_list.n_values; i++)
value_list.list_value[i] = other_value.value_list.list_value[i];
break;
default:
TTCN_error("Copying an unitialized/unsupported @BTS_Tests.f_TC_ms_pwr_ctrl_cb template.");
}
set_selection(other_value);
}

f__TC__ms__pwr__ctrl__cb_template::f__TC__ms__pwr__ctrl__cb_template()
{
}

f__TC__ms__pwr__ctrl__cb_template::f__TC__ms__pwr__ctrl__cb_template(template_sel other_value)
  : Base_Template(other_value)
{
check_single_selection(other_value);
}

f__TC__ms__pwr__ctrl__cb_template::f__TC__ms__pwr__ctrl__cb_template(f__TC__ms__pwr__ctrl__cb::function_pointer other_value)
  : Base_Template(SPECIFIC_VALUE)
{
single_value = other_value;
}

f__TC__ms__pwr__ctrl__cb_template::f__TC__ms__pwr__ctrl__cb_template(const f__TC__ms__pwr__ctrl__cb& other_value)
  :Base_Template(SPECIFIC_VALUE)
{
other_value.must_bound("Creating a template from an unbound @BTS_Tests.f_TC_ms_pwr_ctrl_cb value.");
single_value = other_value.referred_function;
}

f__TC__ms__pwr__ctrl__cb_template::f__TC__ms__pwr__ctrl__cb_template(const OPTIONAL<f__TC__ms__pwr__ctrl__cb>& other_value)
{
if(other_value.ispresent()) {
set_selection(SPECIFIC_VALUE);
single_value = ((const f__TC__ms__pwr__ctrl__cb&)other_value()).referred_function;
} else set_selection(OMIT_VALUE);
}

f__TC__ms__pwr__ctrl__cb_template::f__TC__ms__pwr__ctrl__cb_template(const f__TC__ms__pwr__ctrl__cb_template& other_value)
  :Base_Template()
{
copy_template(other_value);
}

f__TC__ms__pwr__ctrl__cb_template::~f__TC__ms__pwr__ctrl__cb_template()
{
  clean_up();
}

void f__TC__ms__pwr__ctrl__cb_template::clean_up(){
if(template_selection == VALUE_LIST ||
template_selection == COMPLEMENTED_LIST)
delete[] value_list.list_value;
template_selection = UNINITIALIZED_TEMPLATE;
}

f__TC__ms__pwr__ctrl__cb_template& f__TC__ms__pwr__ctrl__cb_template::operator=(template_sel other_value)
{
check_single_selection(other_value);
clean_up();
set_selection(other_value);
return *this;
}

f__TC__ms__pwr__ctrl__cb_template& f__TC__ms__pwr__ctrl__cb_template::operator=(f__TC__ms__pwr__ctrl__cb::function_pointer other_value)
{
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value;
return *this;}

f__TC__ms__pwr__ctrl__cb_template& f__TC__ms__pwr__ctrl__cb_template::operator=(const f__TC__ms__pwr__ctrl__cb& other_value)
{
other_value.must_bound("Assignment of an unbound @BTS_Tests.f_TC_ms_pwr_ctrl_cb value to a template.");
clean_up();
set_selection(SPECIFIC_VALUE);
single_value = other_value.referred_function;
return *this;
}

f__TC__ms__pwr__ctrl__cb_template& f__TC__ms__pwr__ctrl__cb_template::operator=(const OPTIONAL<f__TC__ms__pwr__ctrl__cb>& other_value)
{
clean_up();
if(other_value.ispresent()) { 
set_selection(SPECIFIC_VALUE);
single_value = ((const f__TC__ms__pwr__ctrl__cb&)other_value()).referred_function;
} else set_selection(OMIT_VALUE);
return *this;}

f__TC__ms__pwr__ctrl__cb_template& f__TC__ms__pwr__ctrl__cb_template::operator=(const f__TC__ms__pwr__ctrl__cb_template& other_value)
{
if(&other_value != this) {
clean_up();copy_template(other_value);
}
return *this;
}

boolean f__TC__ms__pwr__ctrl__cb_template::match(f__TC__ms__pwr__ctrl__cb::function_pointer other_value, boolean) const
{
switch(template_selection) {
case SPECIFIC_VALUE:
return single_value == other_value;
case OMIT_VALUE:
return FALSE;
case ANY_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
for(unsigned int i = 0; i < value_list.n_values; i++)
if(value_list.list_value[i].match(other_value))
return template_selection == VALUE_LIST;
return template_selection == COMPLEMENTED_LIST;
default:
TTCN_error("Matching with an unitialized/unsupported @BTS_Tests.f_TC_ms_pwr_ctrl_cb template.");
};
return FALSE;
}

boolean f__TC__ms__pwr__ctrl__cb_template::match(const f__TC__ms__pwr__ctrl__cb& other_value, boolean) const
{
  if (!other_value.is_bound()) return FALSE;
return match(other_value.referred_function);
}

f__TC__ms__pwr__ctrl__cb f__TC__ms__pwr__ctrl__cb_template::valueof() const
{
if(template_selection != SPECIFIC_VALUE || is_ifpresent)
TTCN_error("Performing a valueof or send operation on a non-specific @BTS_Tests.f_TC_ms_pwr_ctrl_cb template.");
return single_value;
}

void f__TC__ms__pwr__ctrl__cb_template::set_type(template_sel template_type, unsigned int list_length)
{
if(template_type != VALUE_LIST && template_type != COMPLEMENTED_LIST)
TTCN_error("Setting an invalid type for an @BTS_Tests.f_TC_ms_pwr_ctrl_cb template.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new f__TC__ms__pwr__ctrl__cb_template[list_length];
}

f__TC__ms__pwr__ctrl__cb_template& f__TC__ms__pwr__ctrl__cb_template::list_item(unsigned int list_index) const
{
if(template_selection != VALUE_LIST && template_selection != COMPLEMENTED_LIST)
TTCN_error("Accessing a list element of a non-list template of type @BTS_Tests.f_TC_ms_pwr_ctrl_cb");
if(list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BTS_Tests.f_TC_ms_pwr_ctrl_cb.");
return value_list.list_value[list_index];
}

void f__TC__ms__pwr__ctrl__cb_template::log() const
{
switch(template_selection) {
case SPECIFIC_VALUE:
Module_List::log_function((genericfunc_t)single_value);
break;
case COMPLEMENTED_LIST:
TTCN_Logger::log_event_str("complement");
case VALUE_LIST:
TTCN_Logger::log_char('(');
for(unsigned int i = 0; i < value_list.n_values; i++) {
if(i > 0) TTCN_Logger::log_event_str(", ");
value_list.list_value[i].log();
}
TTCN_Logger::log_char(')');
break;
default:
log_generic();
}
log_ifpresent();
}

void f__TC__ms__pwr__ctrl__cb_template::log_match(const f__TC__ms__pwr__ctrl__cb& match_value, boolean legacy) const
{
log();
TTCN_Logger::log_event_str(" with ");
match_value.log();
if(match(match_value, legacy)) TTCN_Logger::log_event_str(" matched");
else TTCN_Logger::log_event_str(" unmatched");
}

void f__TC__ms__pwr__ctrl__cb_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch(template_selection) {
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case SPECIFIC_VALUE:
Module_List::encode_function(text_buf, (genericfunc_t)single_value);
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
text_buf.push_int(value_list.n_values);
for(unsigned int i = 0; i < value_list.n_values; i++)
value_list.list_value[i].encode_text(text_buf);
break;
default:
TTCN_error("Text encoder: Encoding an uninitialized/unsupported template of type @BTS_Tests.f_TC_ms_pwr_ctrl_cb.");
}
}

void f__TC__ms__pwr__ctrl__cb_template::decode_text(Text_Buf& text_buf)
{
clean_up();
decode_text_base(text_buf);
switch(template_selection) {
case OMIT_VALUE:
case ANY_VALUE:
case ANY_OR_OMIT:
break;
case SPECIFIC_VALUE:
Module_List::decode_function(text_buf,(genericfunc_t*)&single_value);
break;
case VALUE_LIST:
case COMPLEMENTED_LIST:
value_list.n_values = text_buf.pull_int().get_val();
value_list.list_value = new f__TC__ms__pwr__ctrl__cb_template[value_list.n_values];
for(unsigned int i = 0; i < value_list.n_values; i++)
value_list.list_value[i].decode_text(text_buf);
default:
TTCN_error("Text decoder: An unknown/unsupported selection was received in a template of type @BTS_Tests.f_TC_ms_pwr_ctrl_cb.");
}
}

boolean f__TC__ms__pwr__ctrl__cb_template::is_present(boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return FALSE;
return !match_omit(legacy);
}

boolean f__TC__ms__pwr__ctrl__cb_template::match_omit(boolean legacy) const
{
if (is_ifpresent) return TRUE;
switch (template_selection) {
case OMIT_VALUE:
case ANY_OR_OMIT:
return TRUE;
case VALUE_LIST:
case COMPLEMENTED_LIST:
if (legacy) {
for (unsigned int i=0; i<value_list.n_values; i++)
if (value_list.list_value[i].match_omit())
return template_selection==VALUE_LIST;
return template_selection==COMPLEMENTED_LIST;
} // else fall through
default:
return FALSE;
}
return FALSE;
}

void f__TC__ms__pwr__ctrl__cb_template::set_param(Module_Param& param)
{
  param.error("Not supported.");
}

void f__TC__ms__pwr__ctrl__cb_template::check_restriction(template_res t_res, const char* t_name, boolean legacy) const
{
if (template_selection==UNINITIALIZED_TEMPLATE) return;
switch ((t_name&&(t_res==TR_VALUE))?TR_OMIT:t_res) {
case TR_VALUE:
if (!is_ifpresent && template_selection==SPECIFIC_VALUE) return;
break;
case TR_OMIT:
if (!is_ifpresent && (template_selection==OMIT_VALUE || template_selection==SPECIFIC_VALUE)) return;
break;
case TR_PRESENT:
if (!match_omit(legacy)) return;
break;
default:
return;
}
TTCN_error("Restriction `%s' on template of type %s violated.", get_res_name(t_res), t_name ? t_name : "@BTS_Tests.f_TC_ms_pwr_ctrl_cb");
}

as__TC__ms__pwr__ctrl_Default::as__TC__ms__pwr__ctrl_Default(const f__TC__ms__pwr__ctrl__cb& cb, INTEGER& num__blocks)
 : Default_Base("as_TC_ms_pwr_ctrl"), par_cb(cb), par_num__blocks(num__blocks)
{
}

alt_status as__TC__ms__pwr__ctrl_Default::call_altstep(boolean first_alt_run)
{
return as__TC__ms__pwr__ctrl_instance(par_cb, par_num__blocks, first_alt_run);
}


/* Bodies of functions, altsteps and testcases */

boolean operator==(null_type, const FreqHopConfig& other_value)
{
if (other_value.val_ptr == NULL)
TTCN_error("The right operand of comparison is an unbound value of type @BTS_Tests.FreqHopConfig.");
return other_value.val_ptr->n_elements == 0;
}

boolean operator==(null_type, const FreqHopGroups& other_value)
{
if (other_value.val_ptr == NULL)
TTCN_error("The right operand of comparison is an unbound value of type @BTS_Tests.FreqHopGroups.");
return other_value.val_ptr->n_elements == 0;
}

boolean operator==(null_type, const FreqHopGroupItems& other_value)
{
if (other_value.val_ptr == NULL)
TTCN_error("The right operand of comparison is an unbound value of type @BTS_Tests.FreqHopGroupItems.");
return other_value.val_ptr->n_elements == 0;
}

boolean operator==(null_type, const TrxPars& other_value)
{
if (other_value.val_ptr == NULL)
TTCN_error("The right operand of comparison is an unbound value of type @BTS_Tests.TrxPars.");
return other_value.val_ptr->n_elements == 0;
}

boolean operator==(null_type, const TrxTsPars& other_value)
{
if (other_value.val_ptr == NULL)
TTCN_error("The right operand of comparison is an unbound value of type @BTS_Tests.TrxTsPars.");
return other_value.val_ptr->n_elements == 0;
}

boolean operator==(null_type, const ChannelNrs& other_value)
{
if (other_value.val_ptr == NULL)
TTCN_error("The right operand of comparison is an unbound value of type @BTS_Tests.ChannelNrs.");
return other_value.val_ptr->n_elements == 0;
}

boolean operator==(null_type, const TopTestCase_steps& other_value)
{
if (other_value.val_ptr == NULL)
TTCN_error("The right operand of comparison is an unbound value of type @BTS_Tests.TopTestCase.steps.");
return other_value.val_ptr->n_elements == 0;
}

void f__init__rsl(const CHARSTRING& id)
{
TTCN_Location current_location("BTS_Tests.ttcn", 235, TTCN_Location::LOCATION_FUNCTION, "f_init_rsl");
current_location.update_lineno(236);
/* BTS_Tests.ttcn, line 236 */
BITSTRING trx__mask(bs_0);
current_location.update_lineno(237);
/* BTS_Tests.ttcn, line 237 */
BITSTRING rfind__mask(bs_0);
current_location.update_lineno(238);
/* BTS_Tests.ttcn, line 238 */
INTEGER trx__count(0);
current_location.update_lineno(239);
/* BTS_Tests.ttcn, line 239 */
INTEGER rfind__count(0);
current_location.update_lineno(240);
/* BTS_Tests.ttcn, line 240 */
RSL__Emulation::RSLEm__Event ev;
current_location.update_lineno(241);
/* BTS_Tests.ttcn, line 241 */
IPA__Emulation::ASP__RSL__Unitdata rx__ud;
current_location.update_lineno(242);
/* BTS_Tests.ttcn, line 242 */
TIMER T("T");
current_location.update_lineno(244);
/* BTS_Tests.ttcn, line 244 */
test__CT_component_vc__IPA = TTCN_Runtime::create_component("IPA_Emulation", "IPA_Emulation_CT", (id + cs_2), NULL, FALSE);
current_location.update_lineno(245);
/* BTS_Tests.ttcn, line 245 */
test__CT_component_vc__RSL = TTCN_Runtime::create_component("RSL_Emulation", "RSL_Emulation_CT", (id + cs_3), NULL, FALSE);
current_location.update_lineno(247);
/* BTS_Tests.ttcn, line 247 */
{
Map_Params tmp_2(0);
TTCN_Runtime::map_port(test__CT_component_vc__IPA, IPA__Emulation::IPA__Emulation__CT_component_IPA__PORT.get_name(), SYSTEM_COMPREF, "IPA_CODEC_PT", tmp_2);
}
current_location.update_lineno(248);
/* BTS_Tests.ttcn, line 248 */
TTCN_Runtime::connect_port(test__CT_component_vc__IPA, IPA__Emulation::IPA__Emulation__CT_component_IPA__RSL__PORT.get_name(), test__CT_component_vc__RSL, RSL__Emulation::RSL__Emulation__CT_component_IPA__PT.get_name());
current_location.update_lineno(249);
/* BTS_Tests.ttcn, line 249 */
TTCN_Runtime::connect_port(self, test__CT_component_RSL__CCHAN.get_name(), test__CT_component_vc__RSL, RSL__Emulation::RSL__Emulation__CT_component_CCHAN__PT.get_name());
current_location.update_lineno(251);
/* BTS_Tests.ttcn, line 251 */
IPA__Emulation::start_main__server(test__CT_component_vc__IPA, mp__rsl__ip, mp__rsl__port, IPA__Emulation::main__server_ccm__enabled_defval, IPA__Emulation::main__server_init__behavior_defval, IPA__Emulation::main__server_server__stop__on__ipa__ev__down_defval);
current_location.update_lineno(252);
/* BTS_Tests.ttcn, line 252 */
RSL__Emulation::start_main_(test__CT_component_vc__RSL, FALSE);
current_location.update_lineno(256);
/* BTS_Tests.ttcn, line 256 */
T.start(mp__ipa__up__timeout);
current_location.update_lineno(257);
/* BTS_Tests.ttcn, line 257 */
{
tmp_3:
alt_status tmp_3_alt_flag_0 = ALT_MAYBE;
alt_status tmp_3_alt_flag_1 = ALT_MAYBE;
alt_status tmp_3_alt_flag_2 = ALT_MAYBE;
alt_status tmp_3_alt_flag_3 = ALT_MAYBE;
alt_status tmp_3_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_3_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(259);
/* BTS_Tests.ttcn, line 259 */
tmp_3_alt_flag_0 = test__CT_component_RSL__CCHAN.receive(RSL__Emulation::tr__RSLEm__EV(RSL__Emulation::RSLEm__EventType_template(RSL__Emulation::RSLEm__EventType::RSLEM__EV__TRX__UP), IPA__Types::IpaStreamId_template(ANY_VALUE)), &(ev), any_compref, NULL, NULL, NULL);
if (tmp_3_alt_flag_0 == ALT_YES) {
current_location.update_lineno(261);
/* BTS_Tests.ttcn, line 261 */
if ((const_cast< const BITSTRING&>(trx__mask)[IPA__Types::IpaStreamId::enum2int(const_cast< const RSL__Emulation::RSLEm__Event&>(ev).sid())] == bs_1)) {
current_location.update_lineno(262);
/* BTS_Tests.ttcn, line 262 */
Misc__Helpers::f__shutdown(cs_4, 262, FAIL, (TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Duplicate RSL stream ID ("),const_cast< const RSL__Emulation::RSLEm__Event&>(ev).sid().log(),TTCN_Logger::log_char(')'),TTCN_Logger::end_event_log2str()));
}
current_location.update_lineno(266);
/* BTS_Tests.ttcn, line 266 */
trx__mask[IPA__Types::IpaStreamId::enum2int(const_cast< const RSL__Emulation::RSLEm__Event&>(ev).sid())] = bs_1;
current_location.update_lineno(267);
/* BTS_Tests.ttcn, line 267 */
{
INTEGER tmp_5;
++trx__count;
}
current_location.update_lineno(269);
/* BTS_Tests.ttcn, line 269 */
try {
TTCN_Logger::begin_event(TTCN_USER);
trx__count.log();
TTCN_Logger::log_char('/');
mp__transceiver__num.log();
TTCN_Logger::log_event_str(" transceiver(s) connected");
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(270);
/* BTS_Tests.ttcn, line 270 */
goto tmp_3;
}
}
if (tmp_3_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(273);
/* BTS_Tests.ttcn, line 273 */
tmp_3_alt_flag_1 = test__CT_component_RSL__CCHAN.receive(IPA__Emulation::tr__ASP__RSL__UD(RSL__Types::tr__RSL__RF__RES__IND(RSL__Types::tr__RSL__RF__RES__IND_info_defval), IPA__Types::IpaStreamId_template(ANY_VALUE), IPA__Emulation::tr__ASP__RSL__UD_conn__id_defval), &(rx__ud), any_compref, NULL, NULL, NULL);
if (tmp_3_alt_flag_1 == ALT_YES) {
current_location.update_lineno(274);
/* BTS_Tests.ttcn, line 274 */
if ((const_cast< const BITSTRING&>(trx__mask)[IPA__Types::IpaStreamId::enum2int(const_cast< const IPA__Emulation::ASP__RSL__Unitdata&>(rx__ud).streamId())] == bs_2)) {
current_location.update_lineno(275);
/* BTS_Tests.ttcn, line 275 */
Misc__Helpers::f__shutdown(cs_4, 275, FAIL, (TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Got RF Resource Indication before RSLEM_EV_TRX_UP ("),const_cast< const IPA__Emulation::ASP__RSL__Unitdata&>(rx__ud).streamId().log(),TTCN_Logger::log_char(')'),TTCN_Logger::end_event_log2str()));
}
current_location.update_lineno(278);
/* BTS_Tests.ttcn, line 278 */
if ((const_cast< const BITSTRING&>(rfind__mask)[IPA__Types::IpaStreamId::enum2int(const_cast< const IPA__Emulation::ASP__RSL__Unitdata&>(rx__ud).streamId())] == bs_1)) {
current_location.update_lineno(279);
/* BTS_Tests.ttcn, line 279 */
Misc__Helpers::f__shutdown(cs_4, 279, FAIL, (TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Duplicate RF Resource Indication ID ("),const_cast< const IPA__Emulation::ASP__RSL__Unitdata&>(rx__ud).streamId().log(),TTCN_Logger::log_char(')'),TTCN_Logger::end_event_log2str()));
}
current_location.update_lineno(283);
/* BTS_Tests.ttcn, line 283 */
rfind__mask[IPA__Types::IpaStreamId::enum2int(const_cast< const IPA__Emulation::ASP__RSL__Unitdata&>(rx__ud).streamId())] = bs_1;
current_location.update_lineno(284);
/* BTS_Tests.ttcn, line 284 */
{
INTEGER tmp_7;
++rfind__count;
}
current_location.update_lineno(285);
/* BTS_Tests.ttcn, line 285 */
try {
TTCN_Logger::begin_event(TTCN_USER);
rfind__count.log();
TTCN_Logger::log_char('/');
mp__transceiver__num.log();
TTCN_Logger::log_event_str(" RF Resource Indication(s) received");
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(286);
/* BTS_Tests.ttcn, line 286 */
if ((rfind__count < mp__transceiver__num)) {
current_location.update_lineno(286);
/* BTS_Tests.ttcn, line 286 */
goto tmp_3;
}
break;
}
}
if (tmp_3_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(289);
/* BTS_Tests.ttcn, line 289 */
tmp_3_alt_flag_2 = test__CT_component_RSL__CCHAN.receive(IPA__Emulation::ASP__RSL__Unitdata_template(ANY_VALUE), NULL, any_compref, NULL, NULL, NULL);
if (tmp_3_alt_flag_2 == ALT_YES) {
current_location.update_lineno(289);
/* BTS_Tests.ttcn, line 289 */
goto tmp_3;
}
}
if (tmp_3_alt_flag_3 == ALT_MAYBE) {
current_location.update_lineno(290);
/* BTS_Tests.ttcn, line 290 */
tmp_3_alt_flag_3 = T.timeout(NULL);
if (tmp_3_alt_flag_3 == ALT_YES) {
current_location.update_lineno(291);
/* BTS_Tests.ttcn, line 291 */
Misc__Helpers::f__shutdown(cs_4, 291, FAIL, cs_5);
break;
}
}
if (tmp_3_default_flag == ALT_MAYBE) {
tmp_3_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_3_default_flag == ALT_YES || tmp_3_default_flag == ALT_BREAK) break;
else if (tmp_3_default_flag == ALT_REPEAT) goto tmp_3;
}
current_location.update_lineno(257);
/* BTS_Tests.ttcn, line 257 */
if (tmp_3_alt_flag_0 == ALT_NO && tmp_3_alt_flag_1 == ALT_NO && tmp_3_alt_flag_2 == ALT_NO && tmp_3_alt_flag_3 == ALT_NO && tmp_3_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file BTS_Tests.ttcn between lines 257 and 294.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
}

void start_f__init__rsl(const COMPONENT& component_reference, const CHARSTRING& id)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_init_rsl(");
id.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_init_rsl", text_buf);
id.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__rsl__bcch__fill__raw(const RSL__Types::RSL__IE__SysinfoType& rsl__si__type, const OCTETSTRING& si__enc)
{
TTCN_Location current_location("BTS_Tests.ttcn", 442, TTCN_Location::LOCATION_FUNCTION, "f_rsl_bcch_fill_raw");
current_location.update_lineno(444);
/* BTS_Tests.ttcn, line 444 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("Setting ");
rsl__si__type.log();
TTCN_Logger::log_event_str(": ");
si__enc.log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(445);
/* BTS_Tests.ttcn, line 445 */
test__CT_component_RSL__CCHAN.send(IPA__Emulation::ts__ASP__RSL__UD(RSL__Types::ts__RSL__BCCH__INFO(rsl__si__type, si__enc), IPA__Emulation::ts__ASP__RSL__UD_sid_defval, IPA__Emulation::ts__ASP__RSL__UD_conn__id_defval), FALSE, NULL);
}

void start_f__rsl__bcch__fill__raw(const COMPONENT& component_reference, const RSL__Types::RSL__IE__SysinfoType& rsl__si__type, const OCTETSTRING& si__enc)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_rsl_bcch_fill_raw(");
rsl__si__type.log();
TTCN_Logger::log_event_str(", ");
si__enc.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_rsl_bcch_fill_raw", text_buf);
rsl__si__type.encode_text(text_buf);
si__enc.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__rsl__bcch__fill(const RSL__Types::RSL__IE__SysinfoType& rsl__si__type, const GSM__SystemInformation::SystemInformation_template& si__dec)
{
TTCN_Location current_location("BTS_Tests.ttcn", 448, TTCN_Location::LOCATION_FUNCTION, "f_rsl_bcch_fill");
current_location.update_lineno(450);
/* BTS_Tests.ttcn, line 450 */
OCTETSTRING si__enc(GSM__SystemInformation::enc__SystemInformation(si__dec.valueof()));
current_location.update_lineno(451);
/* BTS_Tests.ttcn, line 451 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("Setting ");
rsl__si__type.log();
TTCN_Logger::log_event_str(": ");
si__dec.log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(452);
/* BTS_Tests.ttcn, line 452 */
f__rsl__bcch__fill__raw(rsl__si__type, si__enc);
}

void start_f__rsl__bcch__fill(const COMPONENT& component_reference, const RSL__Types::RSL__IE__SysinfoType& rsl__si__type, const GSM__SystemInformation::SystemInformation_template& si__dec)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_rsl_bcch_fill(");
rsl__si__type.log();
TTCN_Logger::log_event_str(", ");
si__dec.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_rsl_bcch_fill", text_buf);
rsl__si__type.encode_text(text_buf);
si__dec.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__init__vty(const CHARSTRING& )
{
TTCN_Location current_location("BTS_Tests.ttcn", 455, TTCN_Location::LOCATION_FUNCTION, "f_init_vty");
current_location.update_lineno(456);
/* BTS_Tests.ttcn, line 456 */
{
Map_Params tmp_15(0);
TTCN_Runtime::map_port(self, test__CT_component_BTSVTY.get_name(), SYSTEM_COMPREF, "BTSVTY", tmp_15);
}
current_location.update_lineno(457);
/* BTS_Tests.ttcn, line 457 */
Osmocom__VTY__Functions::f__vty__set__prompts(test__CT_component_BTSVTY, Osmocom__VTY__Functions::f__vty__set__prompts_prompt__prefix_defval);
current_location.update_lineno(458);
/* BTS_Tests.ttcn, line 458 */
Osmocom__VTY__Functions::f__vty__transceive(test__CT_component_BTSVTY, cs_6, Osmocom__VTY__Functions::f__vty__transceive_strict_defval);
}

void start_f__init__vty(const COMPONENT& component_reference, const CHARSTRING& id)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_init_vty(");
id.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_init_vty", text_buf);
id.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__init__vty__bsc()
{
TTCN_Location current_location("BTS_Tests.ttcn", 461, TTCN_Location::LOCATION_FUNCTION, "f_init_vty_bsc");
current_location.update_lineno(462);
/* BTS_Tests.ttcn, line 462 */
{
Map_Params tmp_16(0);
TTCN_Runtime::map_port(self, test__CT_component_BSCVTY.get_name(), SYSTEM_COMPREF, "BSCVTY", tmp_16);
}
current_location.update_lineno(463);
/* BTS_Tests.ttcn, line 463 */
Osmocom__VTY__Functions::f__vty__set__prompts(test__CT_component_BSCVTY, cs_7);
current_location.update_lineno(464);
/* BTS_Tests.ttcn, line 464 */
Osmocom__VTY__Functions::f__vty__transceive(test__CT_component_BSCVTY, cs_6, Osmocom__VTY__Functions::f__vty__transceive_strict_defval);
}

void start_f__init__vty__bsc(const COMPONENT& component_reference)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_init_vty_bsc(");
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_init_vty_bsc", text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__connhdlr__init__vty__bsc()
{
TTCN_Location current_location("BTS_Tests.ttcn", 467, TTCN_Location::LOCATION_FUNCTION, "f_connhdlr_init_vty_bsc");
current_location.update_lineno(468);
/* BTS_Tests.ttcn, line 468 */
{
Map_Params tmp_17(0);
TTCN_Runtime::map_port(self, ConnHdlr_component_BSCVTY.get_name(), SYSTEM_COMPREF, "BSCVTY", tmp_17);
}
current_location.update_lineno(469);
/* BTS_Tests.ttcn, line 469 */
Osmocom__VTY__Functions::f__vty__set__prompts(ConnHdlr_component_BSCVTY, cs_7);
current_location.update_lineno(470);
/* BTS_Tests.ttcn, line 470 */
Osmocom__VTY__Functions::f__vty__transceive(ConnHdlr_component_BSCVTY, cs_6, Osmocom__VTY__Functions::f__vty__transceive_strict_defval);
}

void start_f__connhdlr__init__vty__bsc(const COMPONENT& component_reference)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_connhdlr_init_vty_bsc(");
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_connhdlr_init_vty_bsc", text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

alt_status as__pcu__info__ind_instance(PCUIF__CodecPort::PCUIF__CODEC__PT& pt, const INTEGER& pcu__conn__id, PCUIF__Types::PCUIF__Message& pcu__last__info, boolean first_alt_run)
{
TTCN_Location current_location("BTS_Tests.ttcn", 474, TTCN_Location::LOCATION_ALTSTEP, "as_pcu_info_ind");
current_location.update_lineno(476);
/* BTS_Tests.ttcn, line 476 */
PCUIF__CodecPort::PCUIF__send__data sd;
alt_status ret_val = ALT_NO;
current_location.update_lineno(477);
/* BTS_Tests.ttcn, line 477 */
switch (pt.receive(PCUIF__CodecPort::t__SD__PCUIF(pcu__conn__id, PCUIF__Types::tr__PCUIF__INFO__IND(INTEGER_template(0), PCUIF__Types::PCUIF__Flags_template(ANY_VALUE), PCUIF__Types::tr__PCUIF__INFO__IND_version_defval)), &(sd), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(478);
/* BTS_Tests.ttcn, line 478 */
pcu__last__info = const_cast< const PCUIF__CodecPort::PCUIF__send__data&>(sd).data();
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
current_location.update_lineno(480);
/* BTS_Tests.ttcn, line 480 */
switch (pt.receive(PCUIF__CodecPort::t__SD__PCUIF(pcu__conn__id, PCUIF__Types::tr__PCUIF__INFO__IND(INTEGER_template(ANY_VALUE), PCUIF__Types::PCUIF__Flags_template(ANY_VALUE), INTEGER_template(ANY_VALUE))), &(sd), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(481);
/* BTS_Tests.ttcn, line 481 */
Misc__Helpers::f__shutdown(cs_4, 481, FAIL, cs_8);
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
return ret_val;
}

void as__pcu__info__ind(boolean nodefault_modifier, PCUIF__CodecPort::PCUIF__CODEC__PT& pt, const INTEGER& pcu__conn__id, PCUIF__Types::PCUIF__Message& pcu__last__info)
{
altstep_begin:
boolean block_flag = FALSE;
alt_status altstep_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED;
for ( ; ; ) {
TTCN_Snapshot::take_new(block_flag);
if (altstep_flag != ALT_NO) {
altstep_flag = as__pcu__info__ind_instance(pt, pcu__conn__id, pcu__last__info, !block_flag);
if (altstep_flag == ALT_YES || altstep_flag == ALT_BREAK) return;
else if (altstep_flag == ALT_REPEAT) goto altstep_begin;
}
if (!nodefault_modifier && default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps(!block_flag);
if (default_flag == ALT_YES || default_flag == ALT_BREAK) return;
else if (default_flag == ALT_REPEAT) goto altstep_begin;
}
if (altstep_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in altstep as_pcu_info_ind.");
else block_flag = TRUE;
}
}

Default_Base *activate_as__pcu__info__ind(PCUIF__CodecPort::PCUIF__CODEC__PT& pt, const INTEGER& pcu__conn__id, PCUIF__Types::PCUIF__Message& pcu__last__info)
{
return new as__pcu__info__ind_Default(pt, pcu__conn__id, pcu__last__info);
}

void f__init__pcu(PCUIF__CodecPort::PCUIF__CODEC__PT& pt, const CHARSTRING& , INTEGER& pcu__conn__id, PCUIF__Types::PCUIF__Message& pcu__last__info)
{
TTCN_Location current_location("BTS_Tests.ttcn", 485, TTCN_Location::LOCATION_FUNCTION, "f_init_pcu");
current_location.update_lineno(487);
/* BTS_Tests.ttcn, line 487 */
TIMER T("T", 2.0);
current_location.update_lineno(488);
/* BTS_Tests.ttcn, line 488 */
PCUIF__CodecPort::PCUIF__send__data sd;
current_location.update_lineno(489);
/* BTS_Tests.ttcn, line 489 */
if ((mp__pcu__socket == cs_9)) {
current_location.update_lineno(490);
/* BTS_Tests.ttcn, line 490 */
pcu__conn__id = -1;
current_location.update_lineno(491);
/* BTS_Tests.ttcn, line 491 */
return;
}
current_location.update_lineno(493);
/* BTS_Tests.ttcn, line 493 */
pcu__conn__id = PCUIF__CodecPort::f__pcuif__connect(pt, mp__pcu__socket);
current_location.update_lineno(495);
/* BTS_Tests.ttcn, line 495 */
T.start();
current_location.update_lineno(496);
/* BTS_Tests.ttcn, line 496 */
{
tmp_21:
alt_status tmp_21_alt_flag_0 = ALT_MAYBE;
alt_status tmp_21_alt_flag_1 = ALT_MAYBE;
alt_status tmp_21_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_21_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(497);
/* BTS_Tests.ttcn, line 497 */
{
PCUIF__Types::PCUIF__Message tmp_22;
tmp_21_alt_flag_0 = as__pcu__info__ind_instance(pt, pcu__conn__id, tmp_22, first_run);
if (tmp_22.is_bound()) pcu__last__info = tmp_22;
}
if (tmp_21_alt_flag_0 == ALT_REPEAT) goto tmp_21;
if (tmp_21_alt_flag_0 == ALT_BREAK) break;
if (tmp_21_alt_flag_0 == ALT_YES) break;
}
if (tmp_21_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(498);
/* BTS_Tests.ttcn, line 498 */
tmp_21_alt_flag_1 = T.timeout(NULL);
if (tmp_21_alt_flag_1 == ALT_YES) {
current_location.update_lineno(499);
/* BTS_Tests.ttcn, line 499 */
Misc__Helpers::f__shutdown(cs_4, 499, FAIL, cs_10);
break;
}
}
if (tmp_21_default_flag == ALT_MAYBE) {
tmp_21_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_21_default_flag == ALT_YES || tmp_21_default_flag == ALT_BREAK) break;
else if (tmp_21_default_flag == ALT_REPEAT) goto tmp_21;
}
current_location.update_lineno(496);
/* BTS_Tests.ttcn, line 496 */
if (tmp_21_alt_flag_0 == ALT_NO && tmp_21_alt_flag_1 == ALT_NO && tmp_21_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file BTS_Tests.ttcn between lines 496 and 501.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
}

void f__init__trxc(TRXC__CodecPort::TRXC__CODEC__PT& pt, const CHARSTRING& , INTEGER& trxc__conn__id)
{
TTCN_Location current_location("BTS_Tests.ttcn", 504, TTCN_Location::LOCATION_FUNCTION, "f_init_trxc");
current_location.update_lineno(506);
/* BTS_Tests.ttcn, line 506 */
Socket__API__Definitions::Result res;
current_location.update_lineno(508);
/* BTS_Tests.ttcn, line 508 */
Socket__API__Definitions::ProtoTuple tmp_24;
tmp_24.udp() = NULL_VALUE;
res = TRXC__CodecPort__CtrlFunct::f__IPL4__connect(pt, mp__bts__trxc__ip, mp__bts__trxc__port, cs_9, -1, -1, tmp_24, NULL_VALUE);
current_location.update_lineno(510);
/* BTS_Tests.ttcn, line 510 */
{
boolean tmp_28;
{
boolean tmp_25 = res.is_bound();
if(tmp_25) {
const OPTIONAL< INTEGER >& tmp_26 = res.connId();
switch (tmp_26.get_selection()) {
case OPTIONAL_UNBOUND:
tmp_25 = FALSE;
break;
case OPTIONAL_OMIT:
tmp_25 = FALSE;
break;
default:
{
const INTEGER& tmp_27 = (const INTEGER&) tmp_26;
tmp_25 = tmp_27.is_present();
break;}
}
}
tmp_28 = (!(tmp_25));
}
if (tmp_28) {
current_location.update_lineno(511);
/* BTS_Tests.ttcn, line 511 */
Misc__Helpers::f__shutdown(cs_4, 511, FAIL, cs_11);
}
}
current_location.update_lineno(515);
/* BTS_Tests.ttcn, line 515 */
trxc__conn__id = const_cast< const Socket__API__Definitions::Result&>(res).connId();
}

ChannelNrs f__gen__chans__for__ts(const INTEGER& tn, const GSM__Types::PchanConfig& config)
{
TTCN_Location current_location("BTS_Tests.ttcn", 518, TTCN_Location::LOCATION_FUNCTION, "f_gen_chans_for_ts");
{
const GSM__Types::PchanConfig &tmp_31 = config;
current_location.update_lineno(522);
/* BTS_Tests.ttcn, line 522 */
if(tmp_31 == GSM__Types::PchanConfig::GSM__PCHAN__CCCH__SDCCH4) goto tmp_30_0;
current_location.update_lineno(528);
/* BTS_Tests.ttcn, line 528 */
if(tmp_31 == GSM__Types::PchanConfig::GSM__PCHAN__SDCCH8) goto tmp_30_1;
current_location.update_lineno(538);
/* BTS_Tests.ttcn, line 538 */
if(tmp_31 == GSM__Types::PchanConfig::GSM__PCHAN__TCHH__TCHF__PDCH) goto tmp_30_2;
current_location.update_lineno(543);
/* BTS_Tests.ttcn, line 543 */
if(tmp_31 == GSM__Types::PchanConfig::GSM__PCHAN__TCHH) goto tmp_30_3;
current_location.update_lineno(547);
/* BTS_Tests.ttcn, line 547 */
if(tmp_31 == GSM__Types::PchanConfig::GSM__PCHAN__TCHF) goto tmp_30_4;
current_location.update_lineno(548);
/* BTS_Tests.ttcn, line 548 */
if(tmp_31 == GSM__Types::PchanConfig::GSM__PCHAN__TCHF__PDCH) goto tmp_30_4;
goto tmp_30_end;
tmp_30_0:
{
current_location.update_lineno(523);
/* BTS_Tests.ttcn, line 523 */
ChannelNrs tmp_32;
tmp_32.set_size(4);
tmp_32[0] = GSM__Types::ts__RslChanNr__SDCCH4(tn, 0).valueof();
tmp_32[1] = GSM__Types::ts__RslChanNr__SDCCH4(tn, 1).valueof();
tmp_32[2] = GSM__Types::ts__RslChanNr__SDCCH4(tn, 2).valueof();
tmp_32[3] = GSM__Types::ts__RslChanNr__SDCCH4(tn, 3).valueof();
return tmp_32;
}
tmp_30_1:
{
current_location.update_lineno(529);
/* BTS_Tests.ttcn, line 529 */
ChannelNrs tmp_33;
tmp_33.set_size(8);
tmp_33[0] = GSM__Types::ts__RslChanNr__SDCCH8(tn, 0).valueof();
tmp_33[1] = GSM__Types::ts__RslChanNr__SDCCH8(tn, 1).valueof();
tmp_33[2] = GSM__Types::ts__RslChanNr__SDCCH8(tn, 2).valueof();
tmp_33[3] = GSM__Types::ts__RslChanNr__SDCCH8(tn, 3).valueof();
tmp_33[4] = GSM__Types::ts__RslChanNr__SDCCH8(tn, 4).valueof();
tmp_33[5] = GSM__Types::ts__RslChanNr__SDCCH8(tn, 5).valueof();
tmp_33[6] = GSM__Types::ts__RslChanNr__SDCCH8(tn, 6).valueof();
tmp_33[7] = GSM__Types::ts__RslChanNr__SDCCH8(tn, 7).valueof();
return tmp_33;
}
tmp_30_2:
{
current_location.update_lineno(539);
/* BTS_Tests.ttcn, line 539 */
ChannelNrs tmp_34;
tmp_34.set_size(3);
tmp_34[0] = GSM__Types::ts__RslChanNr__Lm(tn, 0).valueof();
tmp_34[1] = GSM__Types::ts__RslChanNr__Lm(tn, 1).valueof();
tmp_34[2] = GSM__Types::ts__RslChanNr__Bm(tn).valueof();
return tmp_34;
}
tmp_30_3:
{
current_location.update_lineno(544);
/* BTS_Tests.ttcn, line 544 */
ChannelNrs tmp_35;
tmp_35.set_size(2);
tmp_35[0] = GSM__Types::ts__RslChanNr__Lm(tn, 0).valueof();
tmp_35[1] = GSM__Types::ts__RslChanNr__Lm(tn, 1).valueof();
return tmp_35;
}
tmp_30_4:
{
current_location.update_lineno(549);
/* BTS_Tests.ttcn, line 549 */
ChannelNrs tmp_36;
tmp_36.set_size(1);
tmp_36[0] = GSM__Types::ts__RslChanNr__Bm(tn).valueof();
return tmp_36;
}
tmp_30_end: /* empty */;
}
current_location.update_lineno(553);
/* BTS_Tests.ttcn, line 553 */
return NULL_VALUE;
}

void f__init(const INTEGER& trx__nr)
{
TTCN_Location current_location("BTS_Tests.ttcn", 557, TTCN_Location::LOCATION_FUNCTION, "f_init");
current_location.update_lineno(560);
/* BTS_Tests.ttcn, line 560 */
TrxParsItem trx__pars(const_cast< const TrxPars&>(mp__trx__pars)[trx__nr]);
current_location.update_lineno(561);
/* BTS_Tests.ttcn, line 561 */
CHARSTRING id(TTCN_Runtime::get_testcasename());
current_location.update_lineno(565);
/* BTS_Tests.ttcn, line 565 */
if ((mp__bts__trxc__port != -1)) {
current_location.update_lineno(566);
/* BTS_Tests.ttcn, line 566 */
test__CT_component_g__AllChanTypes.set_size(4);
test__CT_component_g__AllChanTypes[0] = GSM__Types::ts__RslChanNr__Bm(1).valueof();
test__CT_component_g__AllChanTypes[1] = GSM__Types::ts__RslChanNr__Lm(5, 1).valueof();
test__CT_component_g__AllChanTypes[2] = GSM__Types::ts__RslChanNr__SDCCH4(0, 2).valueof();
test__CT_component_g__AllChanTypes[3] = GSM__Types::ts__RslChanNr__SDCCH8(6, 4).valueof();
}
else {
current_location.update_lineno(577);
/* BTS_Tests.ttcn, line 577 */
test__CT_component_g__AllChanTypes.set_size(3);
test__CT_component_g__AllChanTypes[0] = GSM__Types::ts__RslChanNr__Bm(1).valueof();
test__CT_component_g__AllChanTypes[1] = GSM__Types::ts__RslChanNr__SDCCH4(0, 2).valueof();
test__CT_component_g__AllChanTypes[2] = GSM__Types::ts__RslChanNr__SDCCH8(6, 4).valueof();
}
current_location.update_lineno(587);
/* BTS_Tests.ttcn, line 587 */
test__CT_component_g__AllChannels = NULL_VALUE;
{
current_location.update_lineno(590);
/* BTS_Tests.ttcn, line 590 */
INTEGER tn(0);
current_location.update_lineno(590);
/* BTS_Tests.ttcn, line 590 */
for ( ; ; ) {
current_location.update_lineno(590);
/* BTS_Tests.ttcn, line 590 */
if (!(tn < const_cast< const TrxParsItem&>(trx__pars).ts().lengthof())) break;
current_location.update_lineno(591);
/* BTS_Tests.ttcn, line 591 */
GSM__Types::PchanConfig config(const_cast< const TrxParsItem&>(trx__pars).ts()[tn].config());
current_location.update_lineno(592);
/* BTS_Tests.ttcn, line 592 */
{
ChannelNrs tmp_40;
tmp_40 = (test__CT_component_g__AllChannels + f__gen__chans__for__ts(tn, config));
test__CT_component_g__AllChannels = tmp_40;
}
current_location.update_lineno(590);
/* BTS_Tests.ttcn, line 590 */
{
INTEGER tmp_41;
++tn;
}
}
}
current_location.update_lineno(595);
/* BTS_Tests.ttcn, line 595 */
f__init__vty(id);
current_location.update_lineno(596);
/* BTS_Tests.ttcn, line 596 */
Osmocom__VTY__Functions::f__logp(test__CT_component_BTSVTY, (TTCN_Runtime::get_testcasename() + cs_12));
current_location.update_lineno(598);
/* BTS_Tests.ttcn, line 598 */
f__init__rsl(id);
current_location.update_lineno(599);
/* BTS_Tests.ttcn, line 599 */
Osmocom__Types::f__sleep(5.0e-1);
current_location.update_lineno(600);
/* BTS_Tests.ttcn, line 600 */
Osmocom__CTRL__Adapter::f__ipa__ctrl__start__client(mp__ctrl__ip, mp__ctrl__port);
current_location.update_lineno(603);
/* BTS_Tests.ttcn, line 603 */
f__rsl__bcch__fill(RSL__Types::RSL__IE__SysinfoType::RSL__SYSTEM__INFO__3, ts__SI3__default);
current_location.update_lineno(605);
/* BTS_Tests.ttcn, line 605 */
f__rsl__bcch__fill(RSL__Types::RSL__IE__SysinfoType::RSL__SYSTEM__INFO__2, ts__SI2__default);
current_location.update_lineno(606);
/* BTS_Tests.ttcn, line 606 */
f__rsl__bcch__fill(RSL__Types::RSL__IE__SysinfoType::RSL__SYSTEM__INFO__4, ts__SI4__default);
current_location.update_lineno(608);
/* BTS_Tests.ttcn, line 608 */
if ((mp__bts__trxc__port != -1)) {
current_location.update_lineno(609);
/* BTS_Tests.ttcn, line 609 */
TRXC__Types::TrxcMessage ret;
current_location.update_lineno(612);
/* BTS_Tests.ttcn, line 612 */
{
Map_Params tmp_42(0);
TTCN_Runtime::map_port(self, test__CT_component_BTS__TRXC.get_name(), SYSTEM_COMPREF, "BTS_TRXC", tmp_42);
}
current_location.update_lineno(613);
/* BTS_Tests.ttcn, line 613 */
{
INTEGER tmp_43;
f__init__trxc(test__CT_component_BTS__TRXC, id, tmp_43);
if (tmp_43.is_bound()) test__CT_component_g__bts__trxc__conn__id = tmp_43;
}
current_location.update_lineno(616);
/* BTS_Tests.ttcn, line 616 */
ret = TRXC__CodecPort::f__TRXC__transceive(test__CT_component_BTS__TRXC, test__CT_component_g__bts__trxc__conn__id, TRXC__Types::ts__TRXC__FAKE__TIMING(512, TRXC__Types::ts__TRXC__FAKE__TIMING_thresh_defval), TRXC__CodecPort::f__TRXC__transceive_tr_defval);
current_location.update_lineno(617);
/* BTS_Tests.ttcn, line 617 */
ret = TRXC__CodecPort::f__TRXC__transceive(test__CT_component_BTS__TRXC, test__CT_component_g__bts__trxc__conn__id, TRXC__Types::ts__TRXC__FAKE__RSSI(-60, TRXC__Types::ts__TRXC__FAKE__RSSI_thresh_defval), TRXC__CodecPort::f__TRXC__transceive_tr_defval);
current_location.update_lineno(619);
/* BTS_Tests.ttcn, line 619 */
ret = TRXC__CodecPort::f__TRXC__transceive(test__CT_component_BTS__TRXC, test__CT_component_g__bts__trxc__conn__id, TRXC__Types::ts__TRXC__FAKE__CI(60, TRXC__Types::ts__TRXC__FAKE__CI_thresh_defval), TRXC__CodecPort::f__TRXC__transceive_tr_defval);
}
current_location.update_lineno(624);
/* BTS_Tests.ttcn, line 624 */
Osmocom__Types::f__sleep(mp__ipa__up__delay);
}

void start_f__init(const COMPONENT& component_reference, const INTEGER& trx__nr)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_init(");
trx__nr.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_init", text_buf);
trx__nr.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__init__l1ctl()
{
TTCN_Location current_location("BTS_Tests.ttcn", 628, TTCN_Location::LOCATION_FUNCTION, "f_init_l1ctl");
current_location.update_lineno(629);
/* BTS_Tests.ttcn, line 629 */
{
Map_Params tmp_47(0);
TTCN_Runtime::map_port(self, test__CT_component_L1CTL.get_name(), SYSTEM_COMPREF, "L1CTL", tmp_47);
}
current_location.update_lineno(630);
/* BTS_Tests.ttcn, line 630 */
L1CTL__PortType::f__connect__reset(test__CT_component_L1CTL, L1CTL__PortType::f__connect__reset_l1ctl__sock__path_defval);
}

void start_f__init__l1ctl(const COMPONENT& component_reference)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_init_l1ctl(");
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_init_l1ctl", text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__resolve__fh__params(FreqHopPars& fhp, const INTEGER& tn, const INTEGER& trx__nr)
{
TTCN_Location current_location("BTS_Tests.ttcn", 649, TTCN_Location::LOCATION_FUNCTION, "f_resolve_fh_params");
current_location.update_lineno(652);
/* BTS_Tests.ttcn, line 652 */
FreqHopGroups groups(const_cast< const FreqHopConfig&>(mp__fh__config)[tn]);
current_location.update_lineno(653);
/* BTS_Tests.ttcn, line 653 */
INTEGER i;
current_location.update_lineno(653);
/* BTS_Tests.ttcn, line 653 */
INTEGER j;
current_location.update_lineno(655);
/* BTS_Tests.ttcn, line 655 */
fhp.enabled() = FALSE;
current_location.update_lineno(657);
/* BTS_Tests.ttcn, line 657 */
i = 0;
current_location.update_lineno(657);
/* BTS_Tests.ttcn, line 657 */
for ( ; ; ) {
current_location.update_lineno(657);
/* BTS_Tests.ttcn, line 657 */
if (!(i < groups.lengthof())) break;
current_location.update_lineno(658);
/* BTS_Tests.ttcn, line 658 */
FreqHopGroup g(const_cast< const FreqHopGroups&>(groups)[i]);
current_location.update_lineno(659);
/* BTS_Tests.ttcn, line 659 */
j = 0;
current_location.update_lineno(659);
/* BTS_Tests.ttcn, line 659 */
for ( ; ; ) {
current_location.update_lineno(659);
/* BTS_Tests.ttcn, line 659 */
if (!(j < const_cast< const FreqHopGroup&>(g).trx__maio().lengthof())) break;
current_location.update_lineno(660);
/* BTS_Tests.ttcn, line 660 */
FreqHopGroupItem gi(const_cast< const FreqHopGroup&>(g).trx__maio()[j]);
current_location.update_lineno(661);
/* BTS_Tests.ttcn, line 661 */
if ((const_cast< const FreqHopGroupItem&>(gi).trx__nr() == trx__nr)) {
current_location.update_lineno(662);
/* BTS_Tests.ttcn, line 662 */
fhp.maio__hsn().maio() = const_cast< const FreqHopGroupItem&>(gi).maio();
current_location.update_lineno(663);
/* BTS_Tests.ttcn, line 663 */
fhp.maio__hsn().hsn() = const_cast< const FreqHopGroup&>(g).hsn();
current_location.update_lineno(664);
/* BTS_Tests.ttcn, line 664 */
fhp.enabled() = TRUE;
current_location.update_lineno(665);
/* BTS_Tests.ttcn, line 665 */
break;
}
current_location.update_lineno(659);
/* BTS_Tests.ttcn, line 659 */
{
INTEGER tmp_54;
++j;
}
}
current_location.update_lineno(669);
/* BTS_Tests.ttcn, line 669 */
if (const_cast< const FreqHopPars&>(fhp).enabled()) {
current_location.update_lineno(671);
/* BTS_Tests.ttcn, line 671 */
fhp.ma__map().len() = (((mp__transceiver__num + 8) - 1) / 8);
current_location.update_lineno(672);
/* BTS_Tests.ttcn, line 672 */
fhp.ma__map().ma() = Osmocom__Types::f__pad__bit(bs_2, (const_cast< const FreqHopPars&>(fhp).ma__map().len() * 8), bs_2);
current_location.update_lineno(673);
/* BTS_Tests.ttcn, line 673 */
fhp.ma() = NULL_VALUE;
current_location.update_lineno(676);
/* BTS_Tests.ttcn, line 676 */
j = 0;
current_location.update_lineno(676);
/* BTS_Tests.ttcn, line 676 */
for ( ; ; ) {
current_location.update_lineno(676);
/* BTS_Tests.ttcn, line 676 */
if (!(j < const_cast< const FreqHopGroup&>(g).trx__maio().lengthof())) break;
current_location.update_lineno(677);
/* BTS_Tests.ttcn, line 677 */
FreqHopGroupItem gi(const_cast< const FreqHopGroup&>(g).trx__maio()[j]);
current_location.update_lineno(678);
/* BTS_Tests.ttcn, line 678 */
INTEGER arfcn(const_cast< const TrxPars&>(mp__trx__pars)[const_cast< const FreqHopGroupItem&>(gi).trx__nr()].arfcn());
current_location.update_lineno(679);
/* BTS_Tests.ttcn, line 679 */
{
L1CTL__Types::L1ctlMA tmp_59;
{
L1CTL__Types::L1ctlMA tmp_61;
tmp_61.set_size(1);
tmp_61[0] = GSM__Types::ts__GsmBandArfcn(INTEGER_template(arfcn), GSM__Types::ts__GsmBandArfcn_pcs_defval, GSM__Types::ts__GsmBandArfcn_uplink_defval).valueof();
tmp_59 = (const_cast< const FreqHopPars&>(fhp).ma() + tmp_61);
}
{
L1CTL__Types::L1ctlMA& tmp_60 = fhp.ma(); /* 7388 */
tmp_60 = tmp_59;
}
}
current_location.update_lineno(680);
/* BTS_Tests.ttcn, line 680 */
fhp.ma__map().ma()[const_cast< const FreqHopGroupItem&>(gi).trx__nr()] = bs_1;
current_location.update_lineno(676);
/* BTS_Tests.ttcn, line 676 */
{
INTEGER tmp_63;
++j;
}
}
current_location.update_lineno(683);
/* BTS_Tests.ttcn, line 683 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("Freq. hopping parameters: ");
fhp.log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(684);
/* BTS_Tests.ttcn, line 684 */
break;
}
current_location.update_lineno(657);
/* BTS_Tests.ttcn, line 657 */
{
INTEGER tmp_64;
++i;
}
}
}

COMPONENT f__start__handler(const void__fn& fn, const ConnHdlrPars& pars, const BOOLEAN& pcu__comp, const BOOLEAN& trxc__comp, const BOOLEAN& l1ctl)
{
ConnHdlrPars pars_shadow(pars);
TTCN_Location current_location("BTS_Tests.ttcn", 690, TTCN_Location::LOCATION_FUNCTION, "f_start_handler");
current_location.update_lineno(695);
/* BTS_Tests.ttcn, line 695 */
CHARSTRING id(TTCN_Runtime::get_testcasename());
current_location.update_lineno(696);
/* BTS_Tests.ttcn, line 696 */
COMPONENT vc__conn;
current_location.update_lineno(698);
/* BTS_Tests.ttcn, line 698 */
vc__conn = TTCN_Runtime::create_component("BTS_Tests", "ConnHdlr", id, NULL, FALSE);
current_location.update_lineno(700);
/* BTS_Tests.ttcn, line 700 */
TTCN_Runtime::connect_port(vc__conn, RSL__Emulation::RSL__DchanHdlr_component_RSL.get_name(), test__CT_component_vc__RSL, RSL__Emulation::RSL__Emulation__CT_component_CLIENT__PT.get_name());
current_location.update_lineno(701);
/* BTS_Tests.ttcn, line 701 */
TTCN_Runtime::connect_port(vc__conn, RSL__Emulation::RSL__DchanHdlr_component_RSL__PROC.get_name(), test__CT_component_vc__RSL, RSL__Emulation::RSL__Emulation__CT_component_RSL__PROC.get_name());
current_location.update_lineno(706);
/* BTS_Tests.ttcn, line 706 */
if (pcu__comp) {
current_location.update_lineno(707);
/* BTS_Tests.ttcn, line 707 */
{
Map_Params tmp_66(0);
TTCN_Runtime::unmap_port(self, test__CT_component_PCU.get_name(), SYSTEM_COMPREF, "PCU", tmp_66);
}
current_location.update_lineno(708);
/* BTS_Tests.ttcn, line 708 */
{
Map_Params tmp_67(0);
TTCN_Runtime::map_port(vc__conn, ConnHdlr_component_PCU.get_name(), SYSTEM_COMPREF, "PCU", tmp_67);
}
}
current_location.update_lineno(710);
/* BTS_Tests.ttcn, line 710 */
if (trxc__comp) {
current_location.update_lineno(711);
/* BTS_Tests.ttcn, line 711 */
{
Map_Params tmp_68(0);
TTCN_Runtime::unmap_port(self, test__CT_component_BTS__TRXC.get_name(), SYSTEM_COMPREF, "BTS_TRXC", tmp_68);
}
current_location.update_lineno(712);
/* BTS_Tests.ttcn, line 712 */
{
Map_Params tmp_69(0);
TTCN_Runtime::map_port(vc__conn, ConnHdlr_component_BTS__TRXC.get_name(), SYSTEM_COMPREF, "BTS_TRXC", tmp_69);
}
}
current_location.update_lineno(714);
/* BTS_Tests.ttcn, line 714 */
if (l1ctl) {
current_location.update_lineno(715);
/* BTS_Tests.ttcn, line 715 */
{
Map_Params tmp_70(0);
TTCN_Runtime::map_port(vc__conn, ConnHdlr_component_L1CTL.get_name(), SYSTEM_COMPREF, "L1CTL", tmp_70);
}
}
current_location.update_lineno(719);
/* BTS_Tests.ttcn, line 719 */
{
boolean tmp_71;
tmp_71 = mp__freq__hop__enabled;
if (tmp_71) tmp_71 = (mp__transceiver__num > 1);
if (tmp_71) {
current_location.update_lineno(720);
/* BTS_Tests.ttcn, line 720 */
f__resolve__fh__params(pars_shadow.fhp(), INTEGER(const_cast< const ConnHdlrPars&>(pars_shadow).chan__nr().tn()), f__resolve__fh__params_trx__nr_defval);
}
}
current_location.update_lineno(723);
/* BTS_Tests.ttcn, line 723 */
start_f__handler__init(vc__conn, fn, id, pars_shadow);
current_location.update_lineno(724);
/* BTS_Tests.ttcn, line 724 */
return vc__conn;
}

void start_f__start__handler(const COMPONENT& component_reference, const void__fn& fn, const ConnHdlrPars& pars, const BOOLEAN& pcu__comp, const BOOLEAN& trxc__comp, const BOOLEAN& l1ctl)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_start_handler(");
fn.log();
TTCN_Logger::log_event_str(", ");
pars.log();
TTCN_Logger::log_event_str(", ");
pcu__comp.log();
TTCN_Logger::log_event_str(", ");
trxc__comp.log();
TTCN_Logger::log_event_str(", ");
l1ctl.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_start_handler", text_buf);
fn.encode_text(text_buf);
pars.encode_text(text_buf);
pcu__comp.encode_text(text_buf);
trxc__comp.encode_text(text_buf);
l1ctl.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

alt_status as__Tguard_instance(boolean first_alt_run)
{
TTCN_Location current_location("BTS_Tests.ttcn", 727, TTCN_Location::LOCATION_ALTSTEP, "as_Tguard");
alt_status ret_val = ALT_NO;
current_location.update_lineno(728);
/* BTS_Tests.ttcn, line 728 */
switch (ConnHdlr_component_g__Tguard.timeout(NULL)) {
case ALT_YES:
{
current_location.update_lineno(729);
/* BTS_Tests.ttcn, line 729 */
Misc__Helpers::f__shutdown(cs_4, 729, FAIL, cs_13);
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
return ret_val;
}

void as__Tguard(boolean nodefault_modifier)
{
altstep_begin:
boolean block_flag = FALSE;
alt_status altstep_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED;
for ( ; ; ) {
TTCN_Snapshot::take_new(block_flag);
if (altstep_flag != ALT_NO) {
altstep_flag = as__Tguard_instance(!block_flag);
if (altstep_flag == ALT_YES || altstep_flag == ALT_BREAK) return;
else if (altstep_flag == ALT_REPEAT) goto altstep_begin;
}
if (!nodefault_modifier && default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps(!block_flag);
if (default_flag == ALT_YES || default_flag == ALT_BREAK) return;
else if (default_flag == ALT_REPEAT) goto altstep_begin;
}
if (altstep_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in altstep as_Tguard.");
else block_flag = TRUE;
}
}

Default_Base *activate_as__Tguard()
{
return new as__Tguard_Default();
}

void f__l1__tune(L1CTL__PortType::L1CTL__PT& L1CTL, const L1CTL__Types::L1ctlCcchMode& ccch__mode)
{
TTCN_Location current_location("BTS_Tests.ttcn", 733, TTCN_Location::LOCATION_FUNCTION, "f_l1_tune");
current_location.update_lineno(734);
/* BTS_Tests.ttcn, line 734 */
GSM__Types::GsmBandArfcn arfcn(GSM__Types::ts__GsmBandArfcn(INTEGER_template(const_cast< const TrxPars&>(mp__trx__pars)[0].arfcn()), GSM__Types::ts__GsmBandArfcn_pcs_defval, GSM__Types::ts__GsmBandArfcn_uplink_defval).valueof());
current_location.update_lineno(735);
/* BTS_Tests.ttcn, line 735 */
L1CTL__PortType::f__L1CTL__FBSB(L1CTL, arfcn, ccch__mode, mp__rxlev__exp);
}

void f__trxc__fake__rssi(const INTEGER& rssi)
{
TTCN_Location current_location("BTS_Tests.ttcn", 738, TTCN_Location::LOCATION_FUNCTION, "f_trxc_fake_rssi");
current_location.update_lineno(739);
/* BTS_Tests.ttcn, line 739 */
TRXC__Types::TrxcMessage ret;
current_location.update_lineno(740);
/* BTS_Tests.ttcn, line 740 */
ret = TRXC__CodecPort::f__TRXC__transceive(ConnHdlr_component_BTS__TRXC, ConnHdlr_component_g__bts__trxc__conn__id, TRXC__Types::ts__TRXC__FAKE__RSSI(rssi, TRXC__Types::ts__TRXC__FAKE__RSSI_thresh_defval), TRXC__CodecPort::f__TRXC__transceive_tr_defval);
}

void start_f__trxc__fake__rssi(const COMPONENT& component_reference, const INTEGER& rssi)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_trxc_fake_rssi(");
rssi.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_trxc_fake_rssi", text_buf);
rssi.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__trxc__fake__toffs256(const INTEGER& toffs256)
{
TTCN_Location current_location("BTS_Tests.ttcn", 743, TTCN_Location::LOCATION_FUNCTION, "f_trxc_fake_toffs256");
current_location.update_lineno(744);
/* BTS_Tests.ttcn, line 744 */
TRXC__Types::TrxcMessage ret;
current_location.update_lineno(745);
/* BTS_Tests.ttcn, line 745 */
ret = TRXC__CodecPort::f__TRXC__transceive(ConnHdlr_component_BTS__TRXC, ConnHdlr_component_g__bts__trxc__conn__id, TRXC__Types::ts__TRXC__FAKE__TIMING(toffs256, TRXC__Types::ts__TRXC__FAKE__TIMING_thresh_defval), TRXC__CodecPort::f__TRXC__transceive_tr_defval);
}

void start_f__trxc__fake__toffs256(const COMPONENT& component_reference, const INTEGER& toffs256)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_trxc_fake_toffs256(");
toffs256.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_trxc_fake_toffs256", text_buf);
toffs256.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__handler__init(const void__fn& fn, const CHARSTRING& id, const ConnHdlrPars& pars)
{
TTCN_Location current_location("BTS_Tests.ttcn", 749, TTCN_Location::LOCATION_FUNCTION, "f_handler_init");
current_location.update_lineno(751);
/* BTS_Tests.ttcn, line 751 */
ConnHdlr_component_g__pars = pars;
current_location.update_lineno(752);
/* BTS_Tests.ttcn, line 752 */
RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr = const_cast< const ConnHdlrPars&>(pars).chan__nr();
current_location.update_lineno(754);
/* BTS_Tests.ttcn, line 754 */
if (ConnHdlr_component_L1CTL.check_port_state(cs_14)) {
current_location.update_lineno(755);
/* BTS_Tests.ttcn, line 755 */
L1CTL__PortType::f__connect__reset(ConnHdlr_component_L1CTL, L1CTL__PortType::f__connect__reset_l1ctl__sock__path_defval);
}
current_location.update_lineno(758);
/* BTS_Tests.ttcn, line 758 */
{
boolean tmp_76;
tmp_76 = (mp__bts__trxc__port != -1);
if (tmp_76) tmp_76 = ConnHdlr_component_BTS__TRXC.check_port_state(cs_14);
if (tmp_76) {
current_location.update_lineno(759);
/* BTS_Tests.ttcn, line 759 */
{
INTEGER tmp_77;
f__init__trxc(ConnHdlr_component_BTS__TRXC, id, tmp_77);
if (tmp_77.is_bound()) ConnHdlr_component_g__bts__trxc__conn__id = tmp_77;
}
}
}
current_location.update_lineno(762);
/* BTS_Tests.ttcn, line 762 */
ConnHdlr_component_g__Tguard.start(const_cast< const ConnHdlrPars&>(pars).t__guard());
current_location.update_lineno(763);
/* BTS_Tests.ttcn, line 763 */
activate_as__Tguard();
current_location.update_lineno(765);
/* BTS_Tests.ttcn, line 765 */
RSL__Emulation::f__rslem__register(const_cast< const ConnHdlrPars&>(pars).trx__nr(), const_cast< const ConnHdlrPars&>(pars).chan__nr(), RSL__Emulation::RSL__DchanHdlr_component_RSL__PROC);
current_location.update_lineno(768);
/* BTS_Tests.ttcn, line 768 */
fn.invoke(id);
}

void start_f__handler__init(const COMPONENT& component_reference, const void__fn& fn, const CHARSTRING& id, const ConnHdlrPars& pars)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_handler_init(");
fn.log();
TTCN_Logger::log_event_str(", ");
id.log();
TTCN_Logger::log_event_str(", ");
pars.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_handler_init", text_buf);
fn.encode_text(text_buf);
id.encode_text(text_buf);
pars.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

RSL__Types::RSL__Message f__rsl__transceive__ret(const RSL__Types::RSL__Message_template& tx, const RSL__Types::RSL__Message_template& exp__rx, const CHARSTRING& id, const BOOLEAN& ignore__other)
{
TTCN_Location current_location("BTS_Tests.ttcn", 771, TTCN_Location::LOCATION_FUNCTION, "f_rsl_transceive_ret");
current_location.update_lineno(774);
/* BTS_Tests.ttcn, line 774 */
RSL__Types::RSL__Message rx;
current_location.update_lineno(775);
/* BTS_Tests.ttcn, line 775 */
TIMER T("T", 3.0);
current_location.update_lineno(776);
/* BTS_Tests.ttcn, line 776 */
RSL__Emulation::RSL__DchanHdlr_component_RSL.send(tx, FALSE, NULL);
current_location.update_lineno(777);
/* BTS_Tests.ttcn, line 777 */
T.start();
current_location.update_lineno(778);
/* BTS_Tests.ttcn, line 778 */
{
tmp_78:
alt_status tmp_78_alt_flag_0 = ALT_MAYBE;
alt_status tmp_78_alt_flag_1 = ALT_MAYBE;
alt_status tmp_78_alt_flag_2 = ALT_UNCHECKED;
alt_status tmp_78_alt_flag_3 = ALT_UNCHECKED;
alt_status tmp_78_alt_flag_4 = ALT_UNCHECKED;
alt_status tmp_78_alt_flag_5 = ALT_UNCHECKED;
alt_status tmp_78_alt_flag_6 = ALT_UNCHECKED;
alt_status tmp_78_alt_flag_7 = ALT_UNCHECKED;
alt_status tmp_78_alt_flag_8 = ALT_UNCHECKED;
alt_status tmp_78_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_78_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(779);
/* BTS_Tests.ttcn, line 779 */
tmp_78_alt_flag_0 = RSL__Emulation::RSL__DchanHdlr_component_RSL.receive(exp__rx, &(rx), any_compref, NULL, NULL, NULL);
if (tmp_78_alt_flag_0 == ALT_YES) {
current_location.update_lineno(780);
/* BTS_Tests.ttcn, line 780 */
T.stop();
current_location.update_lineno(781);
/* BTS_Tests.ttcn, line 781 */
TTCN_Runtime::setverdict(PASS);
break;
}
}
if (tmp_78_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(783);
/* BTS_Tests.ttcn, line 783 */
tmp_78_alt_flag_1 = T.timeout(NULL);
if (tmp_78_alt_flag_1 == ALT_YES) {
current_location.update_lineno(784);
/* BTS_Tests.ttcn, line 784 */
Misc__Helpers::f__shutdown(cs_4, 784, FAIL, (cs_15 + id));
break;
}
}
if (tmp_78_alt_flag_2 == ALT_UNCHECKED) {
current_location.update_lineno(786);
/* BTS_Tests.ttcn, line 786 */
if ((!(ignore__other))) tmp_78_alt_flag_2 = ALT_MAYBE;
else tmp_78_alt_flag_2 = ALT_NO;
}
if (tmp_78_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(786);
/* BTS_Tests.ttcn, line 786 */
tmp_78_alt_flag_2 = as__l1__sacch__loop_instance(first_run);
if (tmp_78_alt_flag_2 == ALT_REPEAT) goto tmp_78;
if (tmp_78_alt_flag_2 == ALT_BREAK) break;
if (tmp_78_alt_flag_2 == ALT_YES) break;
}
if (tmp_78_alt_flag_3 == ALT_UNCHECKED) {
current_location.update_lineno(787);
/* BTS_Tests.ttcn, line 787 */
if ((!(ignore__other))) tmp_78_alt_flag_3 = ALT_MAYBE;
else tmp_78_alt_flag_3 = ALT_NO;
}
if (tmp_78_alt_flag_3 == ALT_MAYBE) {
current_location.update_lineno(787);
/* BTS_Tests.ttcn, line 787 */
tmp_78_alt_flag_3 = as__meas__res_instance(as__meas__res_verify__meas_defval, first_run);
if (tmp_78_alt_flag_3 == ALT_REPEAT) goto tmp_78;
if (tmp_78_alt_flag_3 == ALT_BREAK) break;
if (tmp_78_alt_flag_3 == ALT_YES) break;
}
if (tmp_78_alt_flag_4 == ALT_UNCHECKED) {
current_location.update_lineno(788);
/* BTS_Tests.ttcn, line 788 */
if ((!(ignore__other))) tmp_78_alt_flag_4 = ALT_MAYBE;
else tmp_78_alt_flag_4 = ALT_NO;
}
if (tmp_78_alt_flag_4 == ALT_MAYBE) {
current_location.update_lineno(788);
/* BTS_Tests.ttcn, line 788 */
tmp_78_alt_flag_4 = as__l1__dcch__loop_instance(first_run);
if (tmp_78_alt_flag_4 == ALT_REPEAT) goto tmp_78;
if (tmp_78_alt_flag_4 == ALT_BREAK) break;
if (tmp_78_alt_flag_4 == ALT_YES) break;
}
if (tmp_78_alt_flag_5 == ALT_UNCHECKED) {
current_location.update_lineno(789);
/* BTS_Tests.ttcn, line 789 */
if ((!(ignore__other))) tmp_78_alt_flag_5 = ALT_MAYBE;
else tmp_78_alt_flag_5 = ALT_NO;
}
if (tmp_78_alt_flag_5 == ALT_MAYBE) {
current_location.update_lineno(789);
/* BTS_Tests.ttcn, line 789 */
tmp_78_alt_flag_5 = as__l1__tch__loop_instance(first_run);
if (tmp_78_alt_flag_5 == ALT_REPEAT) goto tmp_78;
if (tmp_78_alt_flag_5 == ALT_BREAK) break;
if (tmp_78_alt_flag_5 == ALT_YES) break;
}
if (tmp_78_alt_flag_6 == ALT_UNCHECKED) {
current_location.update_lineno(790);
/* BTS_Tests.ttcn, line 790 */
if ((!(ignore__other))) tmp_78_alt_flag_6 = ALT_MAYBE;
else tmp_78_alt_flag_6 = ALT_NO;
}
if (tmp_78_alt_flag_6 == ALT_MAYBE) {
current_location.update_lineno(790);
/* BTS_Tests.ttcn, line 790 */
tmp_78_alt_flag_6 = RSL__Emulation::RSL__DchanHdlr_component_RSL.receive(RSL__Types::RSL__Message_template(ANY_VALUE), &(rx), any_compref, NULL, NULL, NULL);
if (tmp_78_alt_flag_6 == ALT_YES) {
current_location.update_lineno(791);
/* BTS_Tests.ttcn, line 791 */
Misc__Helpers::f__shutdown(cs_4, 791, FAIL, (TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Rx unexpected RSL port message: "),rx.log(),TTCN_Logger::end_event_log2str()));
break;
}
}
if (tmp_78_alt_flag_7 == ALT_UNCHECKED) {
current_location.update_lineno(793);
/* BTS_Tests.ttcn, line 793 */
if ((!(ignore__other))) tmp_78_alt_flag_7 = ALT_MAYBE;
else tmp_78_alt_flag_7 = ALT_NO;
}
if (tmp_78_alt_flag_7 == ALT_MAYBE) {
current_location.update_lineno(793);
/* BTS_Tests.ttcn, line 793 */
tmp_78_alt_flag_7 = RSL__Emulation::RSL__DchanHdlr_component_RSL.receive(any_compref, NULL, NULL, NULL);
if (tmp_78_alt_flag_7 == ALT_YES) {
current_location.update_lineno(794);
/* BTS_Tests.ttcn, line 794 */
Misc__Helpers::f__shutdown(cs_4, 794, FAIL, cs_16);
break;
}
}
if (tmp_78_alt_flag_8 == ALT_UNCHECKED) {
current_location.update_lineno(796);
/* BTS_Tests.ttcn, line 796 */
if (ignore__other) tmp_78_alt_flag_8 = ALT_MAYBE;
else tmp_78_alt_flag_8 = ALT_NO;
}
if (tmp_78_alt_flag_8 == ALT_MAYBE) {
current_location.update_lineno(796);
/* BTS_Tests.ttcn, line 796 */
tmp_78_alt_flag_8 = RSL__Emulation::RSL__DchanHdlr_component_RSL.receive(any_compref, NULL, NULL, NULL);
if (tmp_78_alt_flag_8 == ALT_YES) {
current_location.update_lineno(796);
/* BTS_Tests.ttcn, line 796 */
goto tmp_78;
}
}
if (tmp_78_default_flag == ALT_MAYBE) {
tmp_78_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_78_default_flag == ALT_YES || tmp_78_default_flag == ALT_BREAK) break;
else if (tmp_78_default_flag == ALT_REPEAT) goto tmp_78;
}
current_location.update_lineno(778);
/* BTS_Tests.ttcn, line 778 */
if (tmp_78_alt_flag_0 == ALT_NO && tmp_78_alt_flag_1 == ALT_NO && tmp_78_alt_flag_2 == ALT_NO && tmp_78_alt_flag_3 == ALT_NO && tmp_78_alt_flag_4 == ALT_NO && tmp_78_alt_flag_5 == ALT_NO && tmp_78_alt_flag_6 == ALT_NO && tmp_78_alt_flag_7 == ALT_NO && tmp_78_alt_flag_8 == ALT_NO && tmp_78_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file BTS_Tests.ttcn between lines 778 and 797.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(798);
/* BTS_Tests.ttcn, line 798 */
return rx;
}

void start_f__rsl__transceive__ret(const COMPONENT& component_reference, const RSL__Types::RSL__Message_template& tx, const RSL__Types::RSL__Message_template& exp__rx, const CHARSTRING& id, const BOOLEAN& ignore__other)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_rsl_transceive_ret(");
tx.log();
TTCN_Logger::log_event_str(", ");
exp__rx.log();
TTCN_Logger::log_event_str(", ");
id.log();
TTCN_Logger::log_event_str(", ");
ignore__other.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_rsl_transceive_ret", text_buf);
tx.encode_text(text_buf);
exp__rx.encode_text(text_buf);
id.encode_text(text_buf);
ignore__other.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__rsl__transceive(const RSL__Types::RSL__Message_template& tx, const RSL__Types::RSL__Message_template& exp__rx, const CHARSTRING& id, const BOOLEAN& ignore__other)
{
TTCN_Location current_location("BTS_Tests.ttcn", 801, TTCN_Location::LOCATION_FUNCTION, "f_rsl_transceive");
current_location.update_lineno(804);
/* BTS_Tests.ttcn, line 804 */
RSL__Types::RSL__Message rx(f__rsl__transceive__ret(tx, exp__rx, id, ignore__other));
}

void start_f__rsl__transceive(const COMPONENT& component_reference, const RSL__Types::RSL__Message_template& tx, const RSL__Types::RSL__Message_template& exp__rx, const CHARSTRING& id, const BOOLEAN& ignore__other)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_rsl_transceive(");
tx.log();
TTCN_Logger::log_event_str(", ");
exp__rx.log();
TTCN_Logger::log_event_str(", ");
id.log();
TTCN_Logger::log_event_str(", ");
ignore__other.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_rsl_transceive", text_buf);
tx.encode_text(text_buf);
exp__rx.encode_text(text_buf);
id.encode_text(text_buf);
ignore__other.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__send__meas__rep(const GSM__RR__Types::MeasurementResults_template& meas__res)
{
TTCN_Location current_location("BTS_Tests.ttcn", 808, TTCN_Location::LOCATION_FUNCTION, "f_send_meas_rep");
current_location.update_lineno(810);
/* BTS_Tests.ttcn, line 810 */
GSM__RR__Types::SacchL1Header_template l1h;
current_location.update_lineno(812);
/* BTS_Tests.ttcn, line 812 */
l1h = GSM__RR__Types::ts__SacchL1Header(const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).l1__pars().ms__power__level(), const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).l1__pars().ms__actual__ta(), GSM__RR__Types::ts__SacchL1Header_fpc_defval);
current_location.update_lineno(813);
/* BTS_Tests.ttcn, line 813 */
f__send__meas__rep__l1h(meas__res, l1h);
}

void start_f__send__meas__rep(const COMPONENT& component_reference, const GSM__RR__Types::MeasurementResults_template& meas__res)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_send_meas_rep(");
meas__res.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_send_meas_rep", text_buf);
meas__res.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__send__meas__rep__l1h(const GSM__RR__Types::MeasurementResults_template& meas__res, const GSM__RR__Types::SacchL1Header_template& l1h)
{
TTCN_Location current_location("BTS_Tests.ttcn", 817, TTCN_Location::LOCATION_FUNCTION, "f_send_meas_rep_l1h");
current_location.update_lineno(820);
/* BTS_Tests.ttcn, line 820 */
OCTETSTRING l2;
current_location.update_lineno(823);
/* BTS_Tests.ttcn, line 823 */
GSM__RR__Types::GsmRrL3Message meas__rep;
meas__rep.header() = GSM__RR__Types::t__RrL3Header(GSM__RR__Types::RrMessageType::MEASUREMENT__REPORT).valueof();
meas__rep.payload().meas__rep().meas__res() = meas__res.valueof();
current_location.update_lineno(829);
/* BTS_Tests.ttcn, line 829 */
l2 = Osmocom__Types::f__pad__oct(LAPDm__Types::enc__LapdmFrameAB(ts__LAPDm__AB(INTEGER_template(0), GSM__RR__Types::GsmRrL3Message_template(meas__rep), ts__LAPDm__AB_c__r_defval, ts__LAPDm__AB_p_defval).valueof()), 21, os_1);
current_location.update_lineno(831);
/* BTS_Tests.ttcn, line 831 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("f_send_meas_rep_l1h(): Tx SACCH L1 header: ");
l1h.log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(834);
/* BTS_Tests.ttcn, line 834 */
ConnHdlr_component_L1CTL.send(L1CTL__Types::ts__L1CTL__DATA__REQ__SACCH(GSM__Types::RslChannelNr_template(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr), GSM__Types::ts__RslLinkID__SACCH(0), l1h, l2), FALSE, NULL);
}

void start_f__send__meas__rep__l1h(const COMPONENT& component_reference, const GSM__RR__Types::MeasurementResults_template& meas__res, const GSM__RR__Types::SacchL1Header_template& l1h)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_send_meas_rep_l1h(");
meas__res.log();
TTCN_Logger::log_event_str(", ");
l1h.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_send_meas_rep_l1h", text_buf);
meas__res.encode_text(text_buf);
l1h.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__transceive__meas__rep(const GSM__RR__Types::MeasurementResults_template& meas__res)
{
TTCN_Location current_location("BTS_Tests.ttcn", 839, TTCN_Location::LOCATION_FUNCTION, "f_transceive_meas_rep");
current_location.update_lineno(841);
/* BTS_Tests.ttcn, line 841 */
OCTETSTRING l3;
current_location.update_lineno(842);
/* BTS_Tests.ttcn, line 842 */
TIMER T("T");
current_location.update_lineno(845);
/* BTS_Tests.ttcn, line 845 */
GSM__RR__Types::GsmRrL3Message meas__rep;
meas__rep.header() = GSM__RR__Types::t__RrL3Header(GSM__RR__Types::RrMessageType::MEASUREMENT__REPORT).valueof();
meas__rep.payload().meas__rep().meas__res() = meas__res.valueof();
current_location.update_lineno(851);
/* BTS_Tests.ttcn, line 851 */
l3 = Osmocom__Types::f__pad__oct(GSM__RR__Types::enc__GsmRrL3Message(meas__rep), 18, os_1);
current_location.update_lineno(853);
/* BTS_Tests.ttcn, line 853 */
f__send__meas__rep(meas__res);
current_location.update_lineno(856);
/* BTS_Tests.ttcn, line 856 */
T.start(2.0);
current_location.update_lineno(857);
/* BTS_Tests.ttcn, line 857 */
{
tmp_82:
alt_status tmp_82_alt_flag_0 = ALT_MAYBE;
alt_status tmp_82_alt_flag_1 = ALT_MAYBE;
alt_status tmp_82_alt_flag_2 = ALT_MAYBE;
alt_status tmp_82_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_82_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(858);
/* BTS_Tests.ttcn, line 858 */
tmp_82_alt_flag_0 = RSL__Emulation::RSL__DchanHdlr_component_RSL.receive(RSL__Types::tr__RSL__MEAS__RES__OSMO(GSM__Types::RslChannelNr_template(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr), RSL__Types::tr__RSL__MEAS__RES__OSMO_meas__res__nr_defval, RSL__Types::tr__RSL__MEAS__RES__OSMO_ul__meas_defval, RSL__Types::tr__RSL__MEAS__RES__OSMO_bs__power_defval, RSL__Types::tr__RSL__MEAS__RES__OSMO_l1__info_defval, OCTETSTRING_template(l3), RSL__Types::tr__RSL__MEAS__RES__OSMO_ms__to_defval), NULL, any_compref, NULL, NULL, NULL);
if (tmp_82_alt_flag_0 == ALT_YES) {
current_location.update_lineno(859);
/* BTS_Tests.ttcn, line 859 */
TTCN_Runtime::setverdict(PASS);
break;
}
}
if (tmp_82_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(861);
/* BTS_Tests.ttcn, line 861 */
tmp_82_alt_flag_1 = RSL__Emulation::RSL__DchanHdlr_component_RSL.receive(any_compref, NULL, NULL, NULL);
if (tmp_82_alt_flag_1 == ALT_YES) {
current_location.update_lineno(861);
/* BTS_Tests.ttcn, line 861 */
goto tmp_82;
}
}
if (tmp_82_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(862);
/* BTS_Tests.ttcn, line 862 */
tmp_82_alt_flag_2 = T.timeout(NULL);
if (tmp_82_alt_flag_2 == ALT_YES) {
current_location.update_lineno(863);
/* BTS_Tests.ttcn, line 863 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Timeout waiting for RSL MEASurement RESult"),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(864);
/* BTS_Tests.ttcn, line 864 */
Misc__Helpers::f__shutdown(cs_4, 864, Misc__Helpers::f__shutdown_verdict_defval, Misc__Helpers::f__shutdown_text_defval);
break;
}
}
if (tmp_82_default_flag == ALT_MAYBE) {
tmp_82_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_82_default_flag == ALT_YES || tmp_82_default_flag == ALT_BREAK) break;
else if (tmp_82_default_flag == ALT_REPEAT) goto tmp_82;
}
current_location.update_lineno(857);
/* BTS_Tests.ttcn, line 857 */
if (tmp_82_alt_flag_0 == ALT_NO && tmp_82_alt_flag_1 == ALT_NO && tmp_82_alt_flag_2 == ALT_NO && tmp_82_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file BTS_Tests.ttcn between lines 857 and 866.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
}

void start_f__transceive__meas__rep(const COMPONENT& component_reference, const GSM__RR__Types::MeasurementResults_template& meas__res)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_transceive_meas_rep(");
meas__res.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_transceive_meas_rep", text_buf);
meas__res.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__rsl__chan__act(const RSL__Types::RSL__IE__ChannelMode& mode, const BOOLEAN& encr__enable, const RSL__Types::RSL__IE__List& more__ies, const RSL__Types::RSL__IE__ActivationType& act__type)
{
TTCN_Location current_location("BTS_Tests.ttcn", 869, TTCN_Location::LOCATION_FUNCTION, "f_rsl_chan_act");
current_location.update_lineno(874);
/* BTS_Tests.ttcn, line 874 */
RSL__Types::RSL__Message ch__act(RSL__Types::ts__RSL__CHAN__ACT(GSM__Types::RslChannelNr_template(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr), RSL__Types::RSL__IE__ChannelMode_template(mode), RSL__Types::RSL__IE__ActivationType_template(act__type)).valueof());
current_location.update_lineno(875);
/* BTS_Tests.ttcn, line 875 */
if (encr__enable) {
current_location.update_lineno(877);
/* BTS_Tests.ttcn, line 877 */
RSL__Types::RSL__IE__EncryptionInfo encr__info;
current_location.update_lineno(878);
/* BTS_Tests.ttcn, line 878 */
encr__info = RSL__Types::ts__RSL__IE__EncrInfo(RSL__Types::RSL__AlgId_template(const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).encr()().alg__id()), const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).encr()().key()).valueof();
current_location.update_lineno(879);
/* BTS_Tests.ttcn, line 879 */
{
OPTIONAL< RSL__Types::RSL__IE__List > tmp_84;
{
RSL__Types::RSL__IE__List tmp_86;
tmp_86.set_size(1);
{
RSL__Types::RSL__IE__Body_template tmp_87;
tmp_87.encr__info() = encr__info;
tmp_86[0] = RSL__Types::t__RSL__IE(RSL__Types::RSL__IE__Type::RSL__IE__ENCR__INFO, tmp_87).valueof();
}
tmp_84() = (const_cast< const RSL__Types::RSL__Message&>(ch__act).ies()() + tmp_86);
}
{
RSL__Types::RSL__IE__List& tmp_85 = ch__act.ies(); /* 7388 */
tmp_85 = tmp_84;
}
}
}
current_location.update_lineno(882);
/* BTS_Tests.ttcn, line 882 */
{
boolean tmp_88;
{
boolean tmp_89 = mode.is_bound();
if(tmp_89) {
const RSL__Types::RSL__IE__ChannelMode& tmp_90 = mode;
const RSL__Types::RSL__ChanModeOct6& tmp_91 = tmp_90.u();
tmp_89 = tmp_91.is_bound();
if (tmp_89) {
tmp_89 = tmp_91.ischosen(RSL__Types::RSL__ChanModeOct6::ALT_speech);
}
}
tmp_88 = tmp_89;
}
if (tmp_88) tmp_88 = (const_cast< const RSL__Types::RSL__IE__ChannelMode&>(mode).u().speech() == RSL__Types::RSL__ChanModeOct6SpeechAlgo::RSL__CMOD__SP__GSM3);
if (tmp_88) {
current_location.update_lineno(883);
/* BTS_Tests.ttcn, line 883 */
{
OPTIONAL< RSL__Types::RSL__IE__List > tmp_92;
{
RSL__Types::RSL__IE__List tmp_94;
tmp_94.set_size(1);
{
RSL__Types::RSL__IE__Body_template tmp_95;
tmp_95.multirate__cfg() = const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).mr__conf();
tmp_94[0] = RSL__Types::t__RSL__IE(RSL__Types::RSL__IE__Type::RSL__IE__MR__CONFIG, tmp_95).valueof();
}
tmp_92() = (const_cast< const RSL__Types::RSL__Message&>(ch__act).ies()() + tmp_94);
}
{
RSL__Types::RSL__IE__List& tmp_93 = ch__act.ies(); /* 7388 */
tmp_93 = tmp_92;
}
}
}
}
current_location.update_lineno(886);
/* BTS_Tests.ttcn, line 886 */
{
OPTIONAL< RSL__Types::RSL__IE__List > tmp_96;
tmp_96 = (const_cast< const RSL__Types::RSL__Message&>(ch__act).ies()() + more__ies);
ch__act.ies() = tmp_96;
}
current_location.update_lineno(887);
/* BTS_Tests.ttcn, line 887 */
f__rsl__transceive(RSL__Types::RSL__Message_template(ch__act), RSL__Types::tr__RSL__CHAN__ACT__ACK(GSM__Types::RslChannelNr_template(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr)), cs_17, f__rsl__transceive_ignore__other_defval);
}

void start_f__rsl__chan__act(const COMPONENT& component_reference, const RSL__Types::RSL__IE__ChannelMode& mode, const BOOLEAN& encr__enable, const RSL__Types::RSL__IE__List& more__ies, const RSL__Types::RSL__IE__ActivationType& act__type)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_rsl_chan_act(");
mode.log();
TTCN_Logger::log_event_str(", ");
encr__enable.log();
TTCN_Logger::log_event_str(", ");
more__ies.log();
TTCN_Logger::log_event_str(", ");
act__type.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_rsl_chan_act", text_buf);
mode.encode_text(text_buf);
encr__enable.encode_text(text_buf);
more__ies.encode_text(text_buf);
act__type.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__rsl__chan__deact()
{
TTCN_Location current_location("BTS_Tests.ttcn", 890, TTCN_Location::LOCATION_FUNCTION, "f_rsl_chan_deact");
current_location.update_lineno(891);
/* BTS_Tests.ttcn, line 891 */
f__rsl__transceive(RSL__Types::ts__RSL__RF__CHAN__REL(GSM__Types::RslChannelNr_template(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr)), RSL__Types::tr__RSL__RF__CHAN__REL__ACK(GSM__Types::RslChannelNr_template(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr)), cs_18, TRUE);
}

void start_f__rsl__chan__deact(const COMPONENT& component_reference)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_rsl_chan_deact(");
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_rsl_chan_deact", text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

ConnHdlrPars_template t__Pars(const GSM__Types::RslChannelNr_template& chan__nr, const RSL__Types::RSL__IE__ChannelMode_template& chan__mode, const TestSpecUnion_template& spec, const INTEGER& trx__nr, const FLOAT& t__guard)
{
TTCN_Location current_location("BTS_Tests.ttcn", 895, TTCN_Location::LOCATION_TEMPLATE, "t_Pars");
ConnHdlrPars_template ret_val;
ret_val.trx__nr() = trx__nr;
ret_val.chan__nr() = chan__nr.valueof();
ret_val.chan__mode() = chan__mode.valueof();
ret_val.mr__conf() = OMIT_VALUE;
ret_val.t__guard() = t__guard;
{
ConnL1Pars_template& tmp_97 = ret_val.l1__pars();
tmp_97.dtx__enabled() = FALSE;
tmp_97.toa256__enabled() = FALSE;
tmp_97.meas__valid() = TRUE;
{
MeasElemFS_template& tmp_98 = tmp_97.meas__ul();
{
MeasElem_template& tmp_99 = tmp_98.full();
tmp_99.rxlev() = mp__ul__rxlev__exp;
tmp_99.rxqual() = 0;
}
{
MeasElem_template& tmp_100 = tmp_98.sub();
tmp_100.rxlev() = mp__ul__rxlev__exp;
tmp_100.rxqual() = 0;
}
}
tmp_97.timing__offset__256syms() = mp__timing__offset__256syms__exp;
tmp_97.bs__power__level() = 0;
tmp_97.ms__power__level() = mp__ms__power__level__exp;
tmp_97.ms__actual__ta() = mp__ms__actual__ta__exp;
tmp_97.facch__enabled() = FALSE;
}
ret_val.spec() = spec;
ret_val.encr() = OMIT_VALUE;
ret_val.bts0__band() = OMIT_VALUE;
ret_val.tsc() = mp__tsc__def;
{
FreqHopPars_template& tmp_101 = ret_val.fhp();
tmp_101.enabled() = FALSE;
tmp_101.maio__hsn() = GSM__RR__Types::ts__HsnMaio(INTEGER_template(0), INTEGER_template(0));
tmp_101.ma__map() = c__MA__null;
tmp_101.ma() = NULL_VALUE;
}
ret_val.loc__osmux__cid() = trx__nr;
ret_val.rem__osmux__cid() = OMIT_VALUE;
return ret_val;
}

alt_status as__l1ctl__dl__msg_instance(L1CTL__Types::L1ctlMessage& msg, const OCTETSTRING_template& tr__data, const GSM__Types::RslChannelNr_template& chan__nr, const GSM__Types::RslLinkId_template& link__id, boolean first_alt_run)
{
TTCN_Location current_location("BTS_Tests.ttcn", 940, TTCN_Location::LOCATION_ALTSTEP, "as_l1ctl_dl_msg");
alt_status ret_val = ALT_NO;
current_location.update_lineno(945);
/* BTS_Tests.ttcn, line 945 */
switch (ConnHdlr_component_L1CTL.receive(L1CTL__Types::tr__L1CTL__DATA__IND(chan__nr, link__id, tr__data, L1CTL__Types::tr__L1CTL__DATA__IND_num__biterr_defval, L1CTL__Types::tr__L1CTL__DATA__IND_fire__crc_defval), &(msg), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
return ret_val;
}

void as__l1ctl__dl__msg(boolean nodefault_modifier, L1CTL__Types::L1ctlMessage& msg, const OCTETSTRING_template& tr__data, const GSM__Types::RslChannelNr_template& chan__nr, const GSM__Types::RslLinkId_template& link__id)
{
altstep_begin:
boolean block_flag = FALSE;
alt_status altstep_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED;
for ( ; ; ) {
TTCN_Snapshot::take_new(block_flag);
if (altstep_flag != ALT_NO) {
altstep_flag = as__l1ctl__dl__msg_instance(msg, tr__data, chan__nr, link__id, !block_flag);
if (altstep_flag == ALT_YES || altstep_flag == ALT_BREAK) return;
else if (altstep_flag == ALT_REPEAT) goto altstep_begin;
}
if (!nodefault_modifier && default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps(!block_flag);
if (default_flag == ALT_YES || default_flag == ALT_BREAK) return;
else if (default_flag == ALT_REPEAT) goto altstep_begin;
}
if (altstep_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in altstep as_l1ctl_dl_msg.");
else block_flag = TRUE;
}
}

Default_Base *activate_as__l1ctl__dl__msg(L1CTL__Types::L1ctlMessage& msg, const OCTETSTRING_template& tr__data, const GSM__Types::RslChannelNr_template& chan__nr, const GSM__Types::RslLinkId_template& link__id)
{
return new as__l1ctl__dl__msg_Default(msg, tr__data, chan__nr, link__id);
}

alt_status as__dl__lapdm__dummy_instance(const GSM__Types::RslChannelNr_template& chan__nr, const GSM__Types::RslLinkId_template& link__id, const INTEGER_template& sapi, const BOOLEAN& do__repeat, boolean first_alt_run)
{
TTCN_Location current_location("BTS_Tests.ttcn", 950, TTCN_Location::LOCATION_ALTSTEP, "as_dl_lapdm_dummy");
current_location.update_lineno(955);
/* BTS_Tests.ttcn, line 955 */
static LAPDm__Types::LapdmFrame_template tr__frame;
if (first_alt_run) {
tr__frame = LAPDm__Types::tr__LAPDm__UI(sapi, BOOLEAN_template(TRUE), OCTETSTRING_template(os_2));
}
current_location.update_lineno(956);
/* BTS_Tests.ttcn, line 956 */
L1CTL__Types::L1ctlMessage dl__msg;
alt_status ret_val = ALT_NO;
current_location.update_lineno(958);
/* BTS_Tests.ttcn, line 958 */
{
alt_status tmp_106;
{
L1CTL__Types::L1ctlMessage tmp_102;
OCTETSTRING_template tmp_103;
class Dec_Match_tmp_104 : public Dec_Match_Interface {
LAPDm__Types::LapdmFrame_template target;
LAPDm__Types::LapdmFrame* dec_val;
public:
Dec_Match_tmp_104(LAPDm__Types::LapdmFrame_template p_target): target(p_target), dec_val(NULL) { }
~Dec_Match_tmp_104() { if (dec_val != NULL) delete dec_val; }
virtual boolean match(TTCN_Buffer& buff)
{
if (dec_val != NULL) delete dec_val;
dec_val = new LAPDm__Types::LapdmFrame;
boolean ret_val;
OCTETSTRING os;
buff.get_string(os);
if (LAPDm__Types::LapdmFrame_decoder(os, *dec_val, LAPDm__Types::LapdmFrame_default_coding) != 0) {
TTCN_warning("Decoded content matching failed, because the data could not be decoded.");
ret_val = FALSE;
}
else if (os.lengthof() != 0) {
TTCN_warning("Decoded content matching failed, because the buffer was not empty after decoding. Remaining octets: %d.", os.lengthof());
ret_val = FALSE;
}
else ret_val = target.match(*dec_val);
if (!ret_val) {
delete dec_val;
dec_val = NULL;
}
return ret_val;
}
virtual void log() const
{
TTCN_Logger::log_event_str("LapdmFrame: ");
target.log();
}
void* get_dec_res() const { return dec_val; }
const TTCN_Typedescriptor_t* get_type_descr() const { return &LAPDm__Types::LapdmFrame_descr_; }
};
tmp_103.set_type(DECODE_MATCH);
{
LAPDm__Types::LapdmFrame_template tmp_105;
tmp_105 = tr__frame;
tmp_103.set_decmatch(new Dec_Match_tmp_104(tmp_105));
}
tmp_106 = as__l1ctl__dl__msg_instance(tmp_102, tmp_103, chan__nr, link__id, first_alt_run);
if (tmp_102.is_bound()) dl__msg = tmp_102;
}
switch (tmp_106) {
case ALT_YES:
{
current_location.update_lineno(959);
/* BTS_Tests.ttcn, line 959 */
if (do__repeat) {
current_location.update_lineno(960);
/* BTS_Tests.ttcn, line 960 */
return ALT_REPEAT;
}
}
return ALT_YES;
case ALT_REPEAT:
return ALT_REPEAT;
case ALT_BREAK:
return ALT_BREAK;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
}
return ret_val;
}

void as__dl__lapdm__dummy(boolean nodefault_modifier, const GSM__Types::RslChannelNr_template& chan__nr, const GSM__Types::RslLinkId_template& link__id, const INTEGER_template& sapi, const BOOLEAN& do__repeat)
{
altstep_begin:
boolean block_flag = FALSE;
alt_status altstep_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED;
for ( ; ; ) {
TTCN_Snapshot::take_new(block_flag);
if (altstep_flag != ALT_NO) {
altstep_flag = as__dl__lapdm__dummy_instance(chan__nr, link__id, sapi, do__repeat, !block_flag);
if (altstep_flag == ALT_YES || altstep_flag == ALT_BREAK) return;
else if (altstep_flag == ALT_REPEAT) goto altstep_begin;
}
if (!nodefault_modifier && default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps(!block_flag);
if (default_flag == ALT_YES || default_flag == ALT_BREAK) return;
else if (default_flag == ALT_REPEAT) goto altstep_begin;
}
if (altstep_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in altstep as_dl_lapdm_dummy.");
else block_flag = TRUE;
}
}

Default_Base *activate_as__dl__lapdm__dummy(const GSM__Types::RslChannelNr_template& chan__nr, const GSM__Types::RslLinkId_template& link__id, const INTEGER_template& sapi, const BOOLEAN& do__repeat)
{
return new as__dl__lapdm__dummy_Default(chan__nr, link__id, sapi, do__repeat);
}

alt_status as__dl__dcch__lapdm__ab_instance(LAPDm__Types::LapdmFrameAB& frame, const LAPDm__Types::LapdmFrameAB_template& tr__frame, const GSM__Types::RslLinkId_template& link__id, boolean first_alt_run)
{
TTCN_Location current_location("BTS_Tests.ttcn", 967, TTCN_Location::LOCATION_ALTSTEP, "as_dl_dcch_lapdm_ab");
current_location.update_lineno(971);
/* BTS_Tests.ttcn, line 971 */
L1CTL__Types::L1ctlMessage dl__msg;
alt_status ret_val = ALT_NO;
current_location.update_lineno(973);
/* BTS_Tests.ttcn, line 973 */
{
alt_status tmp_111;
{
L1CTL__Types::L1ctlMessage tmp_107;
OCTETSTRING_template tmp_108;
class Dec_Match_tmp_109 : public Dec_Match_Interface {
LAPDm__Types::LapdmFrameAB_template target;
LAPDm__Types::LapdmFrameAB* dec_val;
public:
Dec_Match_tmp_109(LAPDm__Types::LapdmFrameAB_template p_target): target(p_target), dec_val(NULL) { }
~Dec_Match_tmp_109() { if (dec_val != NULL) delete dec_val; }
virtual boolean match(TTCN_Buffer& buff)
{
if (dec_val != NULL) delete dec_val;
dec_val = new LAPDm__Types::LapdmFrameAB;
boolean ret_val;
OCTETSTRING os;
buff.get_string(os);
if (LAPDm__Types::LapdmFrameAB_decoder(os, *dec_val, LAPDm__Types::LapdmFrameAB_default_coding) != 0) {
TTCN_warning("Decoded content matching failed, because the data could not be decoded.");
ret_val = FALSE;
}
else if (os.lengthof() != 0) {
TTCN_warning("Decoded content matching failed, because the buffer was not empty after decoding. Remaining octets: %d.", os.lengthof());
ret_val = FALSE;
}
else ret_val = target.match(*dec_val);
if (!ret_val) {
delete dec_val;
dec_val = NULL;
}
return ret_val;
}
virtual void log() const
{
TTCN_Logger::log_event_str("LapdmFrameAB: ");
target.log();
}
void* get_dec_res() const { return dec_val; }
const TTCN_Typedescriptor_t* get_type_descr() const { return &LAPDm__Types::LapdmFrameAB_descr_; }
};
tmp_108.set_type(DECODE_MATCH);
{
LAPDm__Types::LapdmFrameAB_template tmp_110;
tmp_110 = tr__frame;
tmp_108.set_decmatch(new Dec_Match_tmp_109(tmp_110));
}
tmp_111 = as__l1ctl__dl__msg_instance(tmp_107, tmp_108, GSM__Types::RslChannelNr_template(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr), link__id, first_alt_run);
if (tmp_107.is_bound()) dl__msg = tmp_107;
}
switch (tmp_111) {
case ALT_YES:
{
current_location.update_lineno(974);
/* BTS_Tests.ttcn, line 974 */
frame = LAPDm__Types::dec__LapdmFrameAB(const_cast< const L1CTL__Types::L1ctlMessage&>(dl__msg).payload()().data__ind().payload());
}
return ALT_YES;
case ALT_REPEAT:
return ALT_REPEAT;
case ALT_BREAK:
return ALT_BREAK;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
}
return ret_val;
}

void as__dl__dcch__lapdm__ab(boolean nodefault_modifier, LAPDm__Types::LapdmFrameAB& frame, const LAPDm__Types::LapdmFrameAB_template& tr__frame, const GSM__Types::RslLinkId_template& link__id)
{
altstep_begin:
boolean block_flag = FALSE;
alt_status altstep_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED;
for ( ; ; ) {
TTCN_Snapshot::take_new(block_flag);
if (altstep_flag != ALT_NO) {
altstep_flag = as__dl__dcch__lapdm__ab_instance(frame, tr__frame, link__id, !block_flag);
if (altstep_flag == ALT_YES || altstep_flag == ALT_BREAK) return;
else if (altstep_flag == ALT_REPEAT) goto altstep_begin;
}
if (!nodefault_modifier && default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps(!block_flag);
if (default_flag == ALT_YES || default_flag == ALT_BREAK) return;
else if (default_flag == ALT_REPEAT) goto altstep_begin;
}
if (altstep_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in altstep as_dl_dcch_lapdm_ab.");
else block_flag = TRUE;
}
}

Default_Base *activate_as__dl__dcch__lapdm__ab(LAPDm__Types::LapdmFrameAB& frame, const LAPDm__Types::LapdmFrameAB_template& tr__frame, const GSM__Types::RslLinkId_template& link__id)
{
return new as__dl__dcch__lapdm__ab_Default(frame, tr__frame, link__id);
}

alt_status as__dl__sacch__lapdm__ab_instance(GSM__RR__Types::SacchL1Header& l1h, LAPDm__Types::LapdmFrameAB& frame, const LAPDm__Types::LapdmFrameAB_template& tr__frame, const GSM__RR__Types::SacchL1Header_template& tr__l1h, const INTEGER_template& sapi, boolean first_alt_run)
{
TTCN_Location current_location("BTS_Tests.ttcn", 980, TTCN_Location::LOCATION_ALTSTEP, "as_dl_sacch_lapdm_ab");
current_location.update_lineno(985);
/* BTS_Tests.ttcn, line 985 */
L1CTL__Types::L1ctlMessage dl__msg;
current_location.update_lineno(986);
/* BTS_Tests.ttcn, line 986 */
static GSM__Types::RslLinkId_template link__id;
if (first_alt_run) {
link__id = GSM__Types::tr__RslLinkID__SACCH(sapi);
}
current_location.update_lineno(987);
/* BTS_Tests.ttcn, line 987 */
static L1CTL__Types::L1ctlDataReq_template tr__data;
if (first_alt_run) {
tr__data.l1header() = tr__l1h;
{
OCTETSTRING_template& tmp_113 = tr__data.l2__payload();
class Dec_Match_tmp_114 : public Dec_Match_Interface {
LAPDm__Types::LapdmFrameAB_template target;
LAPDm__Types::LapdmFrameAB* dec_val;
public:
Dec_Match_tmp_114(LAPDm__Types::LapdmFrameAB_template p_target): target(p_target), dec_val(NULL) { }
~Dec_Match_tmp_114() { if (dec_val != NULL) delete dec_val; }
virtual boolean match(TTCN_Buffer& buff)
{
if (dec_val != NULL) delete dec_val;
dec_val = new LAPDm__Types::LapdmFrameAB;
boolean ret_val;
OCTETSTRING os;
buff.get_string(os);
if (LAPDm__Types::LapdmFrameAB_decoder(os, *dec_val, LAPDm__Types::LapdmFrameAB_default_coding) != 0) {
TTCN_warning("Decoded content matching failed, because the data could not be decoded.");
ret_val = FALSE;
}
else if (os.lengthof() != 0) {
TTCN_warning("Decoded content matching failed, because the buffer was not empty after decoding. Remaining octets: %d.", os.lengthof());
ret_val = FALSE;
}
else ret_val = target.match(*dec_val);
if (!ret_val) {
delete dec_val;
dec_val = NULL;
}
return ret_val;
}
virtual void log() const
{
TTCN_Logger::log_event_str("LapdmFrameAB: ");
target.log();
}
void* get_dec_res() const { return dec_val; }
const TTCN_Typedescriptor_t* get_type_descr() const { return &LAPDm__Types::LapdmFrameAB_descr_; }
};
tmp_113.set_type(DECODE_MATCH);
{
LAPDm__Types::LapdmFrameAB_template tmp_115;
tmp_115 = tr__frame;
tmp_113.set_decmatch(new Dec_Match_tmp_114(tmp_115));
}
}
}
alt_status ret_val = ALT_NO;
current_location.update_lineno(992);
/* BTS_Tests.ttcn, line 992 */
{
alt_status tmp_120;
{
L1CTL__Types::L1ctlMessage tmp_116;
OCTETSTRING_template tmp_117;
class Dec_Match_tmp_118 : public Dec_Match_Interface {
L1CTL__Types::L1ctlDataReq_template target;
L1CTL__Types::L1ctlDataReq* dec_val;
public:
Dec_Match_tmp_118(L1CTL__Types::L1ctlDataReq_template p_target): target(p_target), dec_val(NULL) { }
~Dec_Match_tmp_118() { if (dec_val != NULL) delete dec_val; }
virtual boolean match(TTCN_Buffer& buff)
{
if (dec_val != NULL) delete dec_val;
dec_val = new L1CTL__Types::L1ctlDataReq;
boolean ret_val;
OCTETSTRING os;
buff.get_string(os);
if (L1CTL__Types::L1ctlDataReq_decoder(os, *dec_val, L1CTL__Types::L1ctlDataReq_default_coding) != 0) {
TTCN_warning("Decoded content matching failed, because the data could not be decoded.");
ret_val = FALSE;
}
else if (os.lengthof() != 0) {
TTCN_warning("Decoded content matching failed, because the buffer was not empty after decoding. Remaining octets: %d.", os.lengthof());
ret_val = FALSE;
}
else ret_val = target.match(*dec_val);
if (!ret_val) {
delete dec_val;
dec_val = NULL;
}
return ret_val;
}
virtual void log() const
{
TTCN_Logger::log_event_str("L1ctlDataReq: ");
target.log();
}
void* get_dec_res() const { return dec_val; }
const TTCN_Typedescriptor_t* get_type_descr() const { return &L1CTL__Types::L1ctlDataReq_descr_; }
};
tmp_117.set_type(DECODE_MATCH);
{
L1CTL__Types::L1ctlDataReq_template tmp_119;
tmp_119 = tr__data;
tmp_117.set_decmatch(new Dec_Match_tmp_118(tmp_119));
}
tmp_120 = as__l1ctl__dl__msg_instance(tmp_116, tmp_117, GSM__Types::RslChannelNr_template(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr), link__id, first_alt_run);
if (tmp_116.is_bound()) dl__msg = tmp_116;
}
switch (tmp_120) {
case ALT_YES:
{
current_location.update_lineno(993);
/* BTS_Tests.ttcn, line 993 */
OCTETSTRING data(const_cast< const L1CTL__Types::L1ctlMessage&>(dl__msg).payload()().data__ind().payload());
current_location.update_lineno(994);
/* BTS_Tests.ttcn, line 994 */
l1h = GSM__RR__Types::dec__SacchL1Header(substr(data, 0, 2));
current_location.update_lineno(995);
/* BTS_Tests.ttcn, line 995 */
frame = LAPDm__Types::dec__LapdmFrameAB(substr(data, 2, (data.lengthof() - 2)));
}
return ALT_YES;
case ALT_REPEAT:
return ALT_REPEAT;
case ALT_BREAK:
return ALT_BREAK;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
}
return ret_val;
}

void as__dl__sacch__lapdm__ab(boolean nodefault_modifier, GSM__RR__Types::SacchL1Header& l1h, LAPDm__Types::LapdmFrameAB& frame, const LAPDm__Types::LapdmFrameAB_template& tr__frame, const GSM__RR__Types::SacchL1Header_template& tr__l1h, const INTEGER_template& sapi)
{
altstep_begin:
boolean block_flag = FALSE;
alt_status altstep_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED;
for ( ; ; ) {
TTCN_Snapshot::take_new(block_flag);
if (altstep_flag != ALT_NO) {
altstep_flag = as__dl__sacch__lapdm__ab_instance(l1h, frame, tr__frame, tr__l1h, sapi, !block_flag);
if (altstep_flag == ALT_YES || altstep_flag == ALT_BREAK) return;
else if (altstep_flag == ALT_REPEAT) goto altstep_begin;
}
if (!nodefault_modifier && default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps(!block_flag);
if (default_flag == ALT_YES || default_flag == ALT_BREAK) return;
else if (default_flag == ALT_REPEAT) goto altstep_begin;
}
if (altstep_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in altstep as_dl_sacch_lapdm_ab.");
else block_flag = TRUE;
}
}

Default_Base *activate_as__dl__sacch__lapdm__ab(GSM__RR__Types::SacchL1Header& l1h, LAPDm__Types::LapdmFrameAB& frame, const LAPDm__Types::LapdmFrameAB_template& tr__frame, const GSM__RR__Types::SacchL1Header_template& tr__l1h, const INTEGER_template& sapi)
{
return new as__dl__sacch__lapdm__ab_Default(l1h, frame, tr__frame, tr__l1h, sapi);
}

alt_status as__dl__dcch__pdu_instance(MobileL3__Types::PDU__ML3__NW__MS& pdu, const MobileL3__Types::PDU__ML3__NW__MS_template& tr__pdu, const INTEGER_template& sapi, boolean first_alt_run)
{
TTCN_Location current_location("BTS_Tests.ttcn", 1002, TTCN_Location::LOCATION_ALTSTEP, "as_dl_dcch_pdu");
current_location.update_lineno(1006);
/* BTS_Tests.ttcn, line 1006 */
static LAPDm__Types::LapdmFrame_template tr__frame;
if (first_alt_run) {
{
OCTETSTRING_template tmp_123;
class Dec_Match_tmp_124 : public Dec_Match_Interface {
MobileL3__Types::PDU__ML3__NW__MS_template target;
MobileL3__Types::PDU__ML3__NW__MS* dec_val;
public:
Dec_Match_tmp_124(MobileL3__Types::PDU__ML3__NW__MS_template p_target): target(p_target), dec_val(NULL) { }
~Dec_Match_tmp_124() { if (dec_val != NULL) delete dec_val; }
virtual boolean match(TTCN_Buffer& buff)
{
if (dec_val != NULL) delete dec_val;
dec_val = new MobileL3__Types::PDU__ML3__NW__MS;
boolean ret_val;
OCTETSTRING os;
buff.get_string(os);
if (MobileL3__Types::PDU__ML3__NW__MS_decoder(os, *dec_val, MobileL3__Types::PDU__ML3__NW__MS_default_coding) != 0) {
TTCN_warning("Decoded content matching failed, because the data could not be decoded.");
ret_val = FALSE;
}
else if (os.lengthof() != 0) {
TTCN_warning("Decoded content matching failed, because the buffer was not empty after decoding. Remaining octets: %d.", os.lengthof());
ret_val = FALSE;
}
else ret_val = target.match(*dec_val);
if (!ret_val) {
delete dec_val;
dec_val = NULL;
}
return ret_val;
}
virtual void log() const
{
TTCN_Logger::log_event_str("PDU_ML3_NW_MS: ");
target.log();
}
void* get_dec_res() const { return dec_val; }
const TTCN_Typedescriptor_t* get_type_descr() const { return &MobileL3__Types::PDU__ML3__NW__MS_descr_; }
};
tmp_123.set_type(DECODE_MATCH);
{
MobileL3__Types::PDU__ML3__NW__MS_template tmp_125;
tmp_125 = tr__pdu;
tmp_123.set_decmatch(new Dec_Match_tmp_124(tmp_125));
}
tr__frame = LAPDm__Types::tr__LAPDm__UI(sapi, BOOLEAN_template(TRUE), tmp_123);
}
}
current_location.update_lineno(1007);
/* BTS_Tests.ttcn, line 1007 */
static GSM__Types::RslLinkId_template link__id;
if (first_alt_run) {
link__id = GSM__Types::tr__RslLinkID__DCCH(sapi);
}
current_location.update_lineno(1008);
/* BTS_Tests.ttcn, line 1008 */
LAPDm__Types::LapdmFrameAB lapdm__frame;
alt_status ret_val = ALT_NO;
current_location.update_lineno(1010);
/* BTS_Tests.ttcn, line 1010 */
{
alt_status tmp_127;
{
LAPDm__Types::LapdmFrameAB tmp_126;
tmp_127 = as__dl__dcch__lapdm__ab_instance(tmp_126, const_cast< const LAPDm__Types::LapdmFrame_template&>(tr__frame).ab(), link__id, first_alt_run);
if (tmp_126.is_bound()) lapdm__frame = tmp_126;
}
switch (tmp_127) {
case ALT_YES:
{
current_location.update_lineno(1011);
/* BTS_Tests.ttcn, line 1011 */
pdu = MobileL3__Types::dec__PDU__ML3__NW__MS(const_cast< const LAPDm__Types::LapdmFrameAB&>(lapdm__frame).payload());
}
return ALT_YES;
case ALT_REPEAT:
return ALT_REPEAT;
case ALT_BREAK:
return ALT_BREAK;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
}
return ret_val;
}

void as__dl__dcch__pdu(boolean nodefault_modifier, MobileL3__Types::PDU__ML3__NW__MS& pdu, const MobileL3__Types::PDU__ML3__NW__MS_template& tr__pdu, const INTEGER_template& sapi)
{
altstep_begin:
boolean block_flag = FALSE;
alt_status altstep_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED;
for ( ; ; ) {
TTCN_Snapshot::take_new(block_flag);
if (altstep_flag != ALT_NO) {
altstep_flag = as__dl__dcch__pdu_instance(pdu, tr__pdu, sapi, !block_flag);
if (altstep_flag == ALT_YES || altstep_flag == ALT_BREAK) return;
else if (altstep_flag == ALT_REPEAT) goto altstep_begin;
}
if (!nodefault_modifier && default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps(!block_flag);
if (default_flag == ALT_YES || default_flag == ALT_BREAK) return;
else if (default_flag == ALT_REPEAT) goto altstep_begin;
}
if (altstep_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in altstep as_dl_dcch_pdu.");
else block_flag = TRUE;
}
}

Default_Base *activate_as__dl__dcch__pdu(MobileL3__Types::PDU__ML3__NW__MS& pdu, const MobileL3__Types::PDU__ML3__NW__MS_template& tr__pdu, const INTEGER_template& sapi)
{
return new as__dl__dcch__pdu_Default(pdu, tr__pdu, sapi);
}

void f__TC__chan__act__stress(const CHARSTRING& )
{
TTCN_Location current_location("BTS_Tests.ttcn", 1020, TTCN_Location::LOCATION_FUNCTION, "f_TC_chan_act_stress");
{
current_location.update_lineno(1021);
/* BTS_Tests.ttcn, line 1021 */
INTEGER i(0);
current_location.update_lineno(1021);
/* BTS_Tests.ttcn, line 1021 */
for ( ; ; ) {
current_location.update_lineno(1021);
/* BTS_Tests.ttcn, line 1021 */
if (!(i < 500)) break;
current_location.update_lineno(1022);
/* BTS_Tests.ttcn, line 1022 */
f__rsl__chan__act(RSL__Types::RSL__IE__ChannelMode(const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).chan__mode()), f__rsl__chan__act_encr__enable_defval, f__rsl__chan__act_more__ies_defval, f__rsl__chan__act_act__type_defval);
current_location.update_lineno(1023);
/* BTS_Tests.ttcn, line 1023 */
f__rsl__chan__deact();
current_location.update_lineno(1021);
/* BTS_Tests.ttcn, line 1021 */
{
INTEGER tmp_129;
++i;
}
}
}
current_location.update_lineno(1025);
/* BTS_Tests.ttcn, line 1025 */
TTCN_Runtime::setverdict(PASS);
}

void start_f__TC__chan__act__stress(const COMPONENT& component_reference, const CHARSTRING& id)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_TC_chan_act_stress(");
id.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_TC_chan_act_stress", text_buf);
id.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

verdicttype testcase_TC__chan__act__stress(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests.ttcn", 1027, TTCN_Location::LOCATION_TESTCASE, "TC_chan_act_stress");
try {
TTCN_Runtime::begin_testcase("BTS_Tests", "TC_chan_act_stress", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(1028);
/* BTS_Tests.ttcn, line 1028 */
COMPONENT vc__conn;
current_location.update_lineno(1029);
/* BTS_Tests.ttcn, line 1029 */
ConnHdlrPars pars(t__Pars(GSM__Types::t__RslChanNr__Bm(INTEGER_template(1)), RSL__Types::ts__RSL__ChanMode__SIGN(RSL__Types::ts__RSL__ChanMode__SIGN_t_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxd_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxu_defval), t__Pars_spec_defval, t__Pars_trx__nr_defval, t__Pars_t__guard_defval).valueof());
current_location.update_lineno(1030);
/* BTS_Tests.ttcn, line 1030 */
f__init(f__init_trx__nr_defval);
current_location.update_lineno(1031);
/* BTS_Tests.ttcn, line 1031 */
vc__conn = f__start__handler(&f__TC__chan__act__stress, pars, f__start__handler_pcu__comp_defval, f__start__handler_trxc__comp_defval, f__start__handler_l1ctl_defval);
current_location.update_lineno(1032);
/* BTS_Tests.ttcn, line 1032 */
{
tmp_131:
alt_status alt_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (alt_flag != ALT_NO) {
alt_flag = vc__conn.done(NULL, NULL);
if (alt_flag == ALT_YES) break;
else if (alt_flag == ALT_REPEAT) goto tmp_131;
}
if (default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps(first_run);
if (default_flag == ALT_YES || default_flag == ALT_BREAK) break;
else if (default_flag == ALT_REPEAT) goto tmp_131;
}
current_location.update_lineno(1032);
/* BTS_Tests.ttcn, line 1032 */
if (alt_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("Stand-alone done statement failed in file BTS_Tests.ttcn, line 1032.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(1033);
/* BTS_Tests.ttcn, line 1033 */
Misc__Helpers::f__shutdown(cs_4, 1033, Misc__Helpers::f__shutdown_verdict_defval, Misc__Helpers::f__shutdown_text_defval);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_chan_act_stress was stopped.");
}
return TTCN_Runtime::end_testcase();
}

void f__TC__chan__act__react(const CHARSTRING& )
{
TTCN_Location current_location("BTS_Tests.ttcn", 1037, TTCN_Location::LOCATION_FUNCTION, "f_TC_chan_act_react");
current_location.update_lineno(1038);
/* BTS_Tests.ttcn, line 1038 */
f__rsl__chan__act(RSL__Types::RSL__IE__ChannelMode(const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).chan__mode()), f__rsl__chan__act_encr__enable_defval, f__rsl__chan__act_more__ies_defval, f__rsl__chan__act_act__type_defval);
current_location.update_lineno(1040);
/* BTS_Tests.ttcn, line 1040 */
RSL__Emulation::RSL__DchanHdlr_component_RSL.send(RSL__Types::ts__RSL__CHAN__ACT(GSM__Types::RslChannelNr_template(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr), RSL__Types::RSL__IE__ChannelMode_template(const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).chan__mode()), RSL__Types::ts__RSL__CHAN__ACT_at_defval), FALSE, NULL);
current_location.update_lineno(1041);
/* BTS_Tests.ttcn, line 1041 */
{
tmp_132:
alt_status tmp_132_alt_flag_0 = ALT_MAYBE;
alt_status tmp_132_alt_flag_1 = ALT_MAYBE;
alt_status tmp_132_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_132_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(1042);
/* BTS_Tests.ttcn, line 1042 */
tmp_132_alt_flag_0 = RSL__Emulation::RSL__DchanHdlr_component_RSL.receive(RSL__Types::tr__RSL__CHAN__ACT__ACK(GSM__Types::RslChannelNr_template(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr)), NULL, any_compref, NULL, NULL, NULL);
if (tmp_132_alt_flag_0 == ALT_YES) {
current_location.update_lineno(1043);
/* BTS_Tests.ttcn, line 1043 */
Misc__Helpers::f__shutdown(cs_4, 1043, FAIL, cs_19);
break;
}
}
if (tmp_132_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(1045);
/* BTS_Tests.ttcn, line 1045 */
tmp_132_alt_flag_1 = RSL__Emulation::RSL__DchanHdlr_component_RSL.receive(RSL__Types::tr__RSL__CHAN__ACT__NACK(GSM__Types::RslChannelNr_template(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr), RSL__Types::tr__RSL__CHAN__ACT__NACK_cause_defval), NULL, any_compref, NULL, NULL, NULL);
if (tmp_132_alt_flag_1 == ALT_YES) {
current_location.update_lineno(1046);
/* BTS_Tests.ttcn, line 1046 */
TTCN_Runtime::setverdict(PASS);
break;
}
}
if (tmp_132_default_flag == ALT_MAYBE) {
tmp_132_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_132_default_flag == ALT_YES || tmp_132_default_flag == ALT_BREAK) break;
else if (tmp_132_default_flag == ALT_REPEAT) goto tmp_132;
}
current_location.update_lineno(1041);
/* BTS_Tests.ttcn, line 1041 */
if (tmp_132_alt_flag_0 == ALT_NO && tmp_132_alt_flag_1 == ALT_NO && tmp_132_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file BTS_Tests.ttcn between lines 1041 and 1048.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(1049);
/* BTS_Tests.ttcn, line 1049 */
f__rsl__chan__deact();
}

void start_f__TC__chan__act__react(const COMPONENT& component_reference, const CHARSTRING& id)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_TC_chan_act_react(");
id.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_TC_chan_act_react", text_buf);
id.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

verdicttype testcase_TC__chan__act__react(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests.ttcn", 1051, TTCN_Location::LOCATION_TESTCASE, "TC_chan_act_react");
try {
TTCN_Runtime::begin_testcase("BTS_Tests", "TC_chan_act_react", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(1052);
/* BTS_Tests.ttcn, line 1052 */
COMPONENT vc__conn;
current_location.update_lineno(1053);
/* BTS_Tests.ttcn, line 1053 */
ConnHdlrPars pars(t__Pars(GSM__Types::t__RslChanNr__Bm(INTEGER_template(1)), RSL__Types::ts__RSL__ChanMode__SIGN(RSL__Types::ts__RSL__ChanMode__SIGN_t_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxd_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxu_defval), t__Pars_spec_defval, t__Pars_trx__nr_defval, t__Pars_t__guard_defval).valueof());
current_location.update_lineno(1054);
/* BTS_Tests.ttcn, line 1054 */
f__init(f__init_trx__nr_defval);
current_location.update_lineno(1055);
/* BTS_Tests.ttcn, line 1055 */
vc__conn = f__start__handler(&f__TC__chan__act__react, pars, f__start__handler_pcu__comp_defval, f__start__handler_trxc__comp_defval, f__start__handler_l1ctl_defval);
current_location.update_lineno(1056);
/* BTS_Tests.ttcn, line 1056 */
{
tmp_134:
alt_status alt_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (alt_flag != ALT_NO) {
alt_flag = vc__conn.done(NULL, NULL);
if (alt_flag == ALT_YES) break;
else if (alt_flag == ALT_REPEAT) goto tmp_134;
}
if (default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps(first_run);
if (default_flag == ALT_YES || default_flag == ALT_BREAK) break;
else if (default_flag == ALT_REPEAT) goto tmp_134;
}
current_location.update_lineno(1056);
/* BTS_Tests.ttcn, line 1056 */
if (alt_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("Stand-alone done statement failed in file BTS_Tests.ttcn, line 1056.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(1057);
/* BTS_Tests.ttcn, line 1057 */
Misc__Helpers::f__shutdown(cs_4, 1057, Misc__Helpers::f__shutdown_verdict_defval, Misc__Helpers::f__shutdown_text_defval);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_chan_act_react was stopped.");
}
return TTCN_Runtime::end_testcase();
}

void f__TC__chan__deact__not__active(const CHARSTRING& )
{
TTCN_Location current_location("BTS_Tests.ttcn", 1061, TTCN_Location::LOCATION_FUNCTION, "f_TC_chan_deact_not_active");
current_location.update_lineno(1062);
/* BTS_Tests.ttcn, line 1062 */
TIMER T("T", 3.0);
current_location.update_lineno(1063);
/* BTS_Tests.ttcn, line 1063 */
RSL__Emulation::RSL__DchanHdlr_component_RSL.send(RSL__Types::ts__RSL__RF__CHAN__REL(GSM__Types::RslChannelNr_template(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr)), FALSE, NULL);
current_location.update_lineno(1064);
/* BTS_Tests.ttcn, line 1064 */
T.start();
current_location.update_lineno(1065);
/* BTS_Tests.ttcn, line 1065 */
{
tmp_135:
alt_status tmp_135_alt_flag_0 = ALT_MAYBE;
alt_status tmp_135_alt_flag_1 = ALT_MAYBE;
alt_status tmp_135_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_135_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(1066);
/* BTS_Tests.ttcn, line 1066 */
tmp_135_alt_flag_0 = RSL__Emulation::RSL__DchanHdlr_component_RSL.receive(RSL__Types::tr__RSL__RF__CHAN__REL__ACK(GSM__Types::RslChannelNr_template(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr)), NULL, any_compref, NULL, NULL, NULL);
if (tmp_135_alt_flag_0 == ALT_YES) {
current_location.update_lineno(1067);
/* BTS_Tests.ttcn, line 1067 */
TTCN_Runtime::setverdict(PASS);
break;
}
}
if (tmp_135_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(1069);
/* BTS_Tests.ttcn, line 1069 */
tmp_135_alt_flag_1 = T.timeout(NULL);
if (tmp_135_alt_flag_1 == ALT_YES) {
current_location.update_lineno(1070);
/* BTS_Tests.ttcn, line 1070 */
Misc__Helpers::f__shutdown(cs_4, 1070, FAIL, cs_20);
break;
}
}
if (tmp_135_default_flag == ALT_MAYBE) {
tmp_135_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_135_default_flag == ALT_YES || tmp_135_default_flag == ALT_BREAK) break;
else if (tmp_135_default_flag == ALT_REPEAT) goto tmp_135;
}
current_location.update_lineno(1065);
/* BTS_Tests.ttcn, line 1065 */
if (tmp_135_alt_flag_0 == ALT_NO && tmp_135_alt_flag_1 == ALT_NO && tmp_135_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file BTS_Tests.ttcn between lines 1065 and 1072.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
}

void start_f__TC__chan__deact__not__active(const COMPONENT& component_reference, const CHARSTRING& id)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_TC_chan_deact_not_active(");
id.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_TC_chan_deact_not_active", text_buf);
id.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

verdicttype testcase_TC__chan__deact__not__active(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests.ttcn", 1074, TTCN_Location::LOCATION_TESTCASE, "TC_chan_deact_not_active");
try {
TTCN_Runtime::begin_testcase("BTS_Tests", "TC_chan_deact_not_active", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(1075);
/* BTS_Tests.ttcn, line 1075 */
ConnHdlrPars pars(t__Pars(GSM__Types::t__RslChanNr__Bm(INTEGER_template(1)), RSL__Types::ts__RSL__ChanMode__SIGN(RSL__Types::ts__RSL__ChanMode__SIGN_t_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxd_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxu_defval), t__Pars_spec_defval, t__Pars_trx__nr_defval, t__Pars_t__guard_defval).valueof());
current_location.update_lineno(1076);
/* BTS_Tests.ttcn, line 1076 */
f__init(f__init_trx__nr_defval);
current_location.update_lineno(1077);
/* BTS_Tests.ttcn, line 1077 */
COMPONENT vc__conn(f__start__handler(&f__TC__chan__deact__not__active, pars, f__start__handler_pcu__comp_defval, f__start__handler_trxc__comp_defval, f__start__handler_l1ctl_defval));
current_location.update_lineno(1078);
/* BTS_Tests.ttcn, line 1078 */
{
tmp_136:
alt_status alt_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (alt_flag != ALT_NO) {
alt_flag = vc__conn.done(NULL, NULL);
if (alt_flag == ALT_YES) break;
else if (alt_flag == ALT_REPEAT) goto tmp_136;
}
if (default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps(first_run);
if (default_flag == ALT_YES || default_flag == ALT_BREAK) break;
else if (default_flag == ALT_REPEAT) goto tmp_136;
}
current_location.update_lineno(1078);
/* BTS_Tests.ttcn, line 1078 */
if (alt_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("Stand-alone done statement failed in file BTS_Tests.ttcn, line 1078.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(1079);
/* BTS_Tests.ttcn, line 1079 */
Misc__Helpers::f__shutdown(cs_4, 1079, Misc__Helpers::f__shutdown_verdict_defval, Misc__Helpers::f__shutdown_text_defval);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_chan_deact_not_active was stopped.");
}
return TTCN_Runtime::end_testcase();
}

void f__TC__chan__act__wrong__nr(const CHARSTRING& )
{
TTCN_Location current_location("BTS_Tests.ttcn", 1083, TTCN_Location::LOCATION_FUNCTION, "f_TC_chan_act_wrong_nr");
current_location.update_lineno(1084);
/* BTS_Tests.ttcn, line 1084 */
RSL__Emulation::RSL__DchanHdlr_component_RSL.send(RSL__Types::ts__RSL__CHAN__ACT(GSM__Types::RslChannelNr_template(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr), RSL__Types::RSL__IE__ChannelMode_template(const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).chan__mode()), RSL__Types::ts__RSL__CHAN__ACT_at_defval), FALSE, NULL);
current_location.update_lineno(1085);
/* BTS_Tests.ttcn, line 1085 */
{
tmp_137:
alt_status tmp_137_alt_flag_0 = ALT_MAYBE;
alt_status tmp_137_alt_flag_1 = ALT_MAYBE;
alt_status tmp_137_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_137_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(1086);
/* BTS_Tests.ttcn, line 1086 */
tmp_137_alt_flag_0 = RSL__Emulation::RSL__DchanHdlr_component_RSL.receive(RSL__Types::tr__RSL__CHAN__ACT__ACK(GSM__Types::RslChannelNr_template(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr)), NULL, any_compref, NULL, NULL, NULL);
if (tmp_137_alt_flag_0 == ALT_YES) {
current_location.update_lineno(1087);
/* BTS_Tests.ttcn, line 1087 */
Misc__Helpers::f__shutdown(cs_4, 1087, FAIL, cs_21);
break;
}
}
if (tmp_137_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(1089);
/* BTS_Tests.ttcn, line 1089 */
tmp_137_alt_flag_1 = RSL__Emulation::RSL__DchanHdlr_component_RSL.receive(RSL__Types::tr__RSL__CHAN__ACT__NACK(GSM__Types::RslChannelNr_template(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr), RSL__Types::tr__RSL__CHAN__ACT__NACK_cause_defval), NULL, any_compref, NULL, NULL, NULL);
if (tmp_137_alt_flag_1 == ALT_YES) {
current_location.update_lineno(1090);
/* BTS_Tests.ttcn, line 1090 */
TTCN_Runtime::setverdict(PASS);
break;
}
}
if (tmp_137_default_flag == ALT_MAYBE) {
tmp_137_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_137_default_flag == ALT_YES || tmp_137_default_flag == ALT_BREAK) break;
else if (tmp_137_default_flag == ALT_REPEAT) goto tmp_137;
}
current_location.update_lineno(1085);
/* BTS_Tests.ttcn, line 1085 */
if (tmp_137_alt_flag_0 == ALT_NO && tmp_137_alt_flag_1 == ALT_NO && tmp_137_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file BTS_Tests.ttcn between lines 1085 and 1092.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
}

void start_f__TC__chan__act__wrong__nr(const COMPONENT& component_reference, const CHARSTRING& id)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_TC_chan_act_wrong_nr(");
id.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_TC_chan_act_wrong_nr", text_buf);
id.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

boolean operator==(null_type, const WrongChanNrCases& other_value)
{
if (other_value.val_ptr == NULL)
TTCN_error("The right operand of comparison is an unbound value of type @BTS_Tests.WrongChanNrCases.");
return other_value.val_ptr->n_elements == 0;
}

WrongChanNrCase_template t__WCN(const GSM__Types::RslChannelNr_template& chan__nr, const CHARSTRING& desc)
{
TTCN_Location current_location("BTS_Tests.ttcn", 1099, TTCN_Location::LOCATION_TEMPLATE, "t_WCN");
WrongChanNrCase_template ret_val;
ret_val.chan__nr() = chan__nr;
ret_val.description() = desc;
return ret_val;
}

verdicttype testcase_TC__chan__act__wrong__nr(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests.ttcn", 1104, TTCN_Location::LOCATION_TESTCASE, "TC_chan_act_wrong_nr");
try {
TTCN_Runtime::begin_testcase("BTS_Tests", "TC_chan_act_wrong_nr", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(1105);
/* BTS_Tests.ttcn, line 1105 */
COMPONENT vc__conn;
current_location.update_lineno(1106);
/* BTS_Tests.ttcn, line 1106 */
ConnHdlrPars pars;
current_location.update_lineno(1108);
/* BTS_Tests.ttcn, line 1108 */
f__init(f__init_trx__nr_defval);
current_location.update_lineno(1110);
/* BTS_Tests.ttcn, line 1110 */
WrongChanNrCases wrong;
wrong.set_size(13);
wrong[0] = t__WCN(GSM__Types::t__RslChanNr__RACH(INTEGER_template(0)), cs_22).valueof();
wrong[1] = t__WCN(GSM__Types::t__RslChanNr__RACH(INTEGER_template(1)), cs_23).valueof();
wrong[2] = t__WCN(GSM__Types::t__RslChanNr__BCCH(INTEGER_template(0)), cs_24).valueof();
wrong[3] = t__WCN(GSM__Types::t__RslChanNr__PCH__AGCH(INTEGER_template(0)), cs_25).valueof();
wrong[4] = t__WCN(GSM__Types::t__RslChanNr__Bm(INTEGER_template(0)), cs_26).valueof();
wrong[5] = t__WCN(GSM__Types::t__RslChanNr__Lm(INTEGER_template(0), INTEGER_template(0)), cs_27).valueof();
wrong[6] = t__WCN(GSM__Types::t__RslChanNr__Lm(INTEGER_template(0), INTEGER_template(1)), cs_27).valueof();
wrong[7] = t__WCN(GSM__Types::t__RslChanNr__PDCH(INTEGER_template(0)), cs_28).valueof();
wrong[8] = t__WCN(GSM__Types::t__RslChanNr__SDCCH8(INTEGER_template(0), INTEGER_template(0)), cs_29).valueof();
wrong[9] = t__WCN(GSM__Types::t__RslChanNr__SDCCH8(INTEGER_template(0), INTEGER_template(7)), cs_29).valueof();
wrong[10] = t__WCN(GSM__Types::t__RslChanNr__SDCCH4(INTEGER_template(7), INTEGER_template(0)), cs_30).valueof();
wrong[11] = t__WCN(GSM__Types::t__RslChanNr__SDCCH4(INTEGER_template(7), INTEGER_template(3)), cs_30).valueof();
wrong[12] = t__WCN(GSM__Types::t__RslChanNr__Lm(INTEGER_template(1), INTEGER_template(0)), cs_31).valueof();
{
current_location.update_lineno(1126);
/* BTS_Tests.ttcn, line 1126 */
INTEGER i(0);
current_location.update_lineno(1126);
/* BTS_Tests.ttcn, line 1126 */
for ( ; ; ) {
current_location.update_lineno(1126);
/* BTS_Tests.ttcn, line 1126 */
if (!(i < wrong.size_of())) break;
current_location.update_lineno(1127);
/* BTS_Tests.ttcn, line 1127 */
pars = t__Pars(GSM__Types::RslChannelNr_template(const_cast< const WrongChanNrCases&>(wrong)[i].chan__nr()), RSL__Types::ts__RSL__ChanMode__SIGN(RSL__Types::ts__RSL__ChanMode__SIGN_t_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxd_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxu_defval), t__Pars_spec_defval, t__Pars_trx__nr_defval, t__Pars_t__guard_defval).valueof();
current_location.update_lineno(1128);
/* BTS_Tests.ttcn, line 1128 */
vc__conn = f__start__handler(&f__TC__chan__act__wrong__nr, pars, f__start__handler_pcu__comp_defval, f__start__handler_trxc__comp_defval, f__start__handler_l1ctl_defval);
current_location.update_lineno(1129);
/* BTS_Tests.ttcn, line 1129 */
{
tmp_140:
alt_status alt_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (alt_flag != ALT_NO) {
alt_flag = vc__conn.done(NULL, NULL);
if (alt_flag == ALT_YES) break;
else if (alt_flag == ALT_REPEAT) goto tmp_140;
}
if (default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps(first_run);
if (default_flag == ALT_YES || default_flag == ALT_BREAK) break;
else if (default_flag == ALT_REPEAT) goto tmp_140;
}
current_location.update_lineno(1129);
/* BTS_Tests.ttcn, line 1129 */
if (alt_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("Stand-alone done statement failed in file BTS_Tests.ttcn, line 1129.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(1126);
/* BTS_Tests.ttcn, line 1126 */
{
INTEGER tmp_141;
++i;
}
}
}
current_location.update_lineno(1131);
/* BTS_Tests.ttcn, line 1131 */
Misc__Helpers::f__shutdown(cs_4, 1131, Misc__Helpers::f__shutdown_verdict_defval, Misc__Helpers::f__shutdown_text_defval);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_chan_act_wrong_nr was stopped.");
}
return TTCN_Runtime::end_testcase();
}

void f__testmatrix__each__chan(const ConnHdlrPars& pars, const void__fn& fn)
{
ConnHdlrPars pars_shadow(pars);
TTCN_Location current_location("BTS_Tests.ttcn", 1135, TTCN_Location::LOCATION_FUNCTION, "f_testmatrix_each_chan");
current_location.update_lineno(1136);
/* BTS_Tests.ttcn, line 1136 */
COMPONENT vc__conn;
current_location.update_lineno(1137);
/* BTS_Tests.ttcn, line 1137 */
f__init(f__init_trx__nr_defval);
{
current_location.update_lineno(1140);
/* BTS_Tests.ttcn, line 1140 */
INTEGER i(0);
current_location.update_lineno(1140);
/* BTS_Tests.ttcn, line 1140 */
for ( ; ; ) {
current_location.update_lineno(1140);
/* BTS_Tests.ttcn, line 1140 */
if (!(i < test__CT_component_g__AllChanTypes.size_of())) break;
current_location.update_lineno(1141);
/* BTS_Tests.ttcn, line 1141 */
pars_shadow.chan__nr() = const_cast< const ChannelNrs&>(test__CT_component_g__AllChanTypes)[i];
current_location.update_lineno(1143);
/* BTS_Tests.ttcn, line 1143 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Runtime::get_testcasename().log();
TTCN_Logger::log_event_str(": XXX Starting on ");
const_cast< const ChannelNrs&>(test__CT_component_g__AllChanTypes)[i].log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(1144);
/* BTS_Tests.ttcn, line 1144 */
vc__conn = f__start__handler(fn, pars_shadow, f__start__handler_pcu__comp_defval, f__start__handler_trxc__comp_defval, f__start__handler_l1ctl_defval);
current_location.update_lineno(1145);
/* BTS_Tests.ttcn, line 1145 */
{
tmp_144:
alt_status alt_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (alt_flag != ALT_NO) {
alt_flag = vc__conn.done(NULL, NULL);
if (alt_flag == ALT_YES) break;
else if (alt_flag == ALT_REPEAT) goto tmp_144;
}
if (default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps(first_run);
if (default_flag == ALT_YES || default_flag == ALT_BREAK) break;
else if (default_flag == ALT_REPEAT) goto tmp_144;
}
current_location.update_lineno(1145);
/* BTS_Tests.ttcn, line 1145 */
if (alt_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("Stand-alone done statement failed in file BTS_Tests.ttcn, line 1145.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(1140);
/* BTS_Tests.ttcn, line 1140 */
{
INTEGER tmp_145;
++i;
}
}
}
current_location.update_lineno(1148);
/* BTS_Tests.ttcn, line 1148 */
Misc__Helpers::f__shutdown(cs_4, 1148, Misc__Helpers::f__shutdown_verdict_defval, Misc__Helpers::f__shutdown_text_defval);
}

void start_f__testmatrix__each__chan(const COMPONENT& component_reference, const ConnHdlrPars& pars, const void__fn& fn)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_testmatrix_each_chan(");
pars.log();
TTCN_Logger::log_event_str(", ");
fn.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_testmatrix_each_chan", text_buf);
pars.encode_text(text_buf);
fn.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__exp__sacch(const BOOLEAN& exp)
{
TTCN_Location current_location("BTS_Tests.ttcn", 1155, TTCN_Location::LOCATION_FUNCTION, "f_exp_sacch");
current_location.update_lineno(1156);
/* BTS_Tests.ttcn, line 1156 */
TIMER T__sacch("T_sacch", 3.0);
current_location.update_lineno(1157);
/* BTS_Tests.ttcn, line 1157 */
T__sacch.start();
current_location.update_lineno(1158);
/* BTS_Tests.ttcn, line 1158 */
{
tmp_146:
alt_status tmp_146_alt_flag_0 = ALT_UNCHECKED;
alt_status tmp_146_alt_flag_1 = ALT_UNCHECKED;
alt_status tmp_146_alt_flag_2 = ALT_UNCHECKED;
alt_status tmp_146_alt_flag_3 = ALT_UNCHECKED;
alt_status tmp_146_alt_flag_4 = ALT_MAYBE;
alt_status tmp_146_alt_flag_5 = ALT_MAYBE;
alt_status tmp_146_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_146_alt_flag_0 == ALT_UNCHECKED) {
current_location.update_lineno(1159);
/* BTS_Tests.ttcn, line 1159 */
if ((!(exp))) tmp_146_alt_flag_0 = ALT_MAYBE;
else tmp_146_alt_flag_0 = ALT_NO;
}
if (tmp_146_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(1159);
/* BTS_Tests.ttcn, line 1159 */
tmp_146_alt_flag_0 = ConnHdlr_component_L1CTL.receive(L1CTL__Types::tr__L1CTL__DATA__IND(GSM__Types::RslChannelNr_template(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr), GSM__Types::tr__RslLinkID__SACCH(INTEGER_template(0)), L1CTL__Types::tr__L1CTL__DATA__IND_l2__data_defval, L1CTL__Types::tr__L1CTL__DATA__IND_num__biterr_defval, L1CTL__Types::tr__L1CTL__DATA__IND_fire__crc_defval), NULL, any_compref, NULL, NULL, NULL);
if (tmp_146_alt_flag_0 == ALT_YES) {
current_location.update_lineno(1160);
/* BTS_Tests.ttcn, line 1160 */
Misc__Helpers::f__shutdown(cs_4, 1160, FAIL, cs_32);
break;
}
}
if (tmp_146_alt_flag_1 == ALT_UNCHECKED) {
current_location.update_lineno(1162);
/* BTS_Tests.ttcn, line 1162 */
if ((!(exp))) tmp_146_alt_flag_1 = ALT_MAYBE;
else tmp_146_alt_flag_1 = ALT_NO;
}
if (tmp_146_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(1162);
/* BTS_Tests.ttcn, line 1162 */
tmp_146_alt_flag_1 = T__sacch.timeout(NULL);
if (tmp_146_alt_flag_1 == ALT_YES) {
current_location.update_lineno(1163);
/* BTS_Tests.ttcn, line 1163 */
TTCN_Runtime::setverdict(PASS);
break;
}
}
if (tmp_146_alt_flag_2 == ALT_UNCHECKED) {
current_location.update_lineno(1165);
/* BTS_Tests.ttcn, line 1165 */
if (exp) tmp_146_alt_flag_2 = ALT_MAYBE;
else tmp_146_alt_flag_2 = ALT_NO;
}
if (tmp_146_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(1165);
/* BTS_Tests.ttcn, line 1165 */
tmp_146_alt_flag_2 = ConnHdlr_component_L1CTL.receive(L1CTL__Types::tr__L1CTL__DATA__IND(GSM__Types::RslChannelNr_template(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr), GSM__Types::tr__RslLinkID__SACCH(INTEGER_template(0)), L1CTL__Types::tr__L1CTL__DATA__IND_l2__data_defval, L1CTL__Types::tr__L1CTL__DATA__IND_num__biterr_defval, L1CTL__Types::tr__L1CTL__DATA__IND_fire__crc_defval), NULL, any_compref, NULL, NULL, NULL);
if (tmp_146_alt_flag_2 == ALT_YES) {
current_location.update_lineno(1166);
/* BTS_Tests.ttcn, line 1166 */
TTCN_Runtime::setverdict(PASS);
break;
}
}
if (tmp_146_alt_flag_3 == ALT_UNCHECKED) {
current_location.update_lineno(1168);
/* BTS_Tests.ttcn, line 1168 */
if (exp) tmp_146_alt_flag_3 = ALT_MAYBE;
else tmp_146_alt_flag_3 = ALT_NO;
}
if (tmp_146_alt_flag_3 == ALT_MAYBE) {
current_location.update_lineno(1168);
/* BTS_Tests.ttcn, line 1168 */
tmp_146_alt_flag_3 = T__sacch.timeout(NULL);
if (tmp_146_alt_flag_3 == ALT_YES) {
current_location.update_lineno(1169);
/* BTS_Tests.ttcn, line 1169 */
Misc__Helpers::f__shutdown(cs_4, 1169, FAIL, (TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Timeout waiting for SACCH on "),RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr.log(),TTCN_Logger::end_event_log2str()));
break;
}
}
if (tmp_146_alt_flag_4 == ALT_MAYBE) {
current_location.update_lineno(1171);
/* BTS_Tests.ttcn, line 1171 */
tmp_146_alt_flag_4 = ConnHdlr_component_L1CTL.receive(any_compref, NULL, NULL, NULL);
if (tmp_146_alt_flag_4 == ALT_YES) {
current_location.update_lineno(1171);
/* BTS_Tests.ttcn, line 1171 */
goto tmp_146;
}
}
if (tmp_146_alt_flag_5 == ALT_MAYBE) {
current_location.update_lineno(1172);
/* BTS_Tests.ttcn, line 1172 */
tmp_146_alt_flag_5 = RSL__Emulation::RSL__DchanHdlr_component_RSL.receive(any_compref, NULL, NULL, NULL);
if (tmp_146_alt_flag_5 == ALT_YES) {
current_location.update_lineno(1172);
/* BTS_Tests.ttcn, line 1172 */
goto tmp_146;
}
}
if (tmp_146_default_flag == ALT_MAYBE) {
tmp_146_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_146_default_flag == ALT_YES || tmp_146_default_flag == ALT_BREAK) break;
else if (tmp_146_default_flag == ALT_REPEAT) goto tmp_146;
}
current_location.update_lineno(1158);
/* BTS_Tests.ttcn, line 1158 */
if (tmp_146_alt_flag_0 == ALT_NO && tmp_146_alt_flag_1 == ALT_NO && tmp_146_alt_flag_2 == ALT_NO && tmp_146_alt_flag_3 == ALT_NO && tmp_146_alt_flag_4 == ALT_NO && tmp_146_alt_flag_5 == ALT_NO && tmp_146_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file BTS_Tests.ttcn between lines 1158 and 1173.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
}

void start_f__exp__sacch(const COMPONENT& component_reference, const BOOLEAN& exp)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_exp_sacch(");
exp.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_exp_sacch", text_buf);
exp.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__TC__deact__sacch(const CHARSTRING& )
{
TTCN_Location current_location("BTS_Tests.ttcn", 1177, TTCN_Location::LOCATION_FUNCTION, "f_TC_deact_sacch");
current_location.update_lineno(1178);
/* BTS_Tests.ttcn, line 1178 */
f__l1__tune(ConnHdlr_component_L1CTL, f__l1__tune_ccch__mode_defval);
current_location.update_lineno(1179);
/* BTS_Tests.ttcn, line 1179 */
RSL__Emulation::RSL__DchanHdlr_component_RSL.clear();
current_location.update_lineno(1182);
/* BTS_Tests.ttcn, line 1182 */
f__est__dchan(f__est__dchan_encr__enable_defval, f__est__dchan_more__ies_defval, f__est__dchan_act__type_defval);
current_location.update_lineno(1183);
/* BTS_Tests.ttcn, line 1183 */
ConnHdlr_component_L1CTL.clear();
current_location.update_lineno(1186);
/* BTS_Tests.ttcn, line 1186 */
f__exp__sacch(TRUE);
current_location.update_lineno(1189);
/* BTS_Tests.ttcn, line 1189 */
RSL__Emulation::RSL__DchanHdlr_component_RSL.send(RSL__Types::ts__RSL__DEACT__SACCH(GSM__Types::RslChannelNr_template(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr)), FALSE, NULL);
current_location.update_lineno(1190);
/* BTS_Tests.ttcn, line 1190 */
Osmocom__Types::f__sleep(1.0);
current_location.update_lineno(1191);
/* BTS_Tests.ttcn, line 1191 */
ConnHdlr_component_L1CTL.clear();
current_location.update_lineno(1194);
/* BTS_Tests.ttcn, line 1194 */
f__exp__sacch(FALSE);
current_location.update_lineno(1197);
/* BTS_Tests.ttcn, line 1197 */
f__rsl__chan__deact();
current_location.update_lineno(1198);
/* BTS_Tests.ttcn, line 1198 */
L1CTL__PortType::f__L1CTL__DM__REL__REQ(ConnHdlr_component_L1CTL, RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr);
}

void start_f__TC__deact__sacch(const COMPONENT& component_reference, const CHARSTRING& id)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_TC_deact_sacch(");
id.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_TC_deact_sacch", text_buf);
id.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

verdicttype testcase_TC__deact__sacch(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests.ttcn", 1200, TTCN_Location::LOCATION_TESTCASE, "TC_deact_sacch");
try {
TTCN_Runtime::begin_testcase("BTS_Tests", "TC_deact_sacch", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(1201);
/* BTS_Tests.ttcn, line 1201 */
COMPONENT vc__conn;
current_location.update_lineno(1202);
/* BTS_Tests.ttcn, line 1202 */
ConnHdlrPars pars;
current_location.update_lineno(1203);
/* BTS_Tests.ttcn, line 1203 */
f__init(f__init_trx__nr_defval);
{
current_location.update_lineno(1204);
/* BTS_Tests.ttcn, line 1204 */
INTEGER i(0);
current_location.update_lineno(1204);
/* BTS_Tests.ttcn, line 1204 */
for ( ; ; ) {
current_location.update_lineno(1204);
/* BTS_Tests.ttcn, line 1204 */
if (!(i < test__CT_component_g__AllChannels.size_of())) break;
current_location.update_lineno(1206);
/* BTS_Tests.ttcn, line 1206 */
pars = t__Pars(GSM__Types::RslChannelNr_template(const_cast< const ChannelNrs&>(test__CT_component_g__AllChannels)[i]), RSL__Types::ts__RSL__ChanMode__SIGN(RSL__Types::ts__RSL__ChanMode__SIGN_t_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxd_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxu_defval), t__Pars_spec_defval, t__Pars_trx__nr_defval, t__Pars_t__guard_defval).valueof();
current_location.update_lineno(1207);
/* BTS_Tests.ttcn, line 1207 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("TC_deact_sacch: Starting for ");
const_cast< const ChannelNrs&>(test__CT_component_g__AllChannels)[i].log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(1208);
/* BTS_Tests.ttcn, line 1208 */
vc__conn = f__start__handler(&f__TC__deact__sacch, pars, f__start__handler_pcu__comp_defval, f__start__handler_trxc__comp_defval, f__start__handler_l1ctl_defval);
current_location.update_lineno(1209);
/* BTS_Tests.ttcn, line 1209 */
{
tmp_149:
alt_status alt_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (alt_flag != ALT_NO) {
alt_flag = vc__conn.done(NULL, NULL);
if (alt_flag == ALT_YES) break;
else if (alt_flag == ALT_REPEAT) goto tmp_149;
}
if (default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps(first_run);
if (default_flag == ALT_YES || default_flag == ALT_BREAK) break;
else if (default_flag == ALT_REPEAT) goto tmp_149;
}
current_location.update_lineno(1209);
/* BTS_Tests.ttcn, line 1209 */
if (alt_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("Stand-alone done statement failed in file BTS_Tests.ttcn, line 1209.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(1204);
/* BTS_Tests.ttcn, line 1204 */
{
INTEGER tmp_150;
++i;
}
}
}
current_location.update_lineno(1212);
/* BTS_Tests.ttcn, line 1212 */
Misc__Helpers::f__shutdown(cs_4, 1212, Misc__Helpers::f__shutdown_verdict_defval, Misc__Helpers::f__shutdown_text_defval);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_deact_sacch was stopped.");
}
return TTCN_Runtime::end_testcase();
}

void f__sacch__present(const OCTETSTRING_template& l3__exp, const BOOLEAN& do__fail)
{
TTCN_Location current_location("BTS_Tests.ttcn", 1216, TTCN_Location::LOCATION_FUNCTION, "f_sacch_present");
current_location.update_lineno(1219);
/* BTS_Tests.ttcn, line 1219 */
L1CTL__Types::L1ctlMessage dl;
current_location.update_lineno(1220);
/* BTS_Tests.ttcn, line 1220 */
TIMER T__sacch("T_sacch", 3.0);
current_location.update_lineno(1221);
/* BTS_Tests.ttcn, line 1221 */
ConnHdlr_component_L1CTL.clear();
current_location.update_lineno(1222);
/* BTS_Tests.ttcn, line 1222 */
T__sacch.start();
current_location.update_lineno(1223);
/* BTS_Tests.ttcn, line 1223 */
{
tmp_151:
alt_status tmp_151_alt_flag_0 = ALT_MAYBE;
alt_status tmp_151_alt_flag_1 = ALT_MAYBE;
alt_status tmp_151_alt_flag_2 = ALT_UNCHECKED;
alt_status tmp_151_alt_flag_3 = ALT_UNCHECKED;
alt_status tmp_151_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_151_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(1224);
/* BTS_Tests.ttcn, line 1224 */
tmp_151_alt_flag_0 = ConnHdlr_component_L1CTL.receive(L1CTL__Types::tr__L1CTL__DATA__IND(GSM__Types::RslChannelNr_template(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr), GSM__Types::tr__RslLinkID__SACCH(INTEGER_template(0)), L1CTL__Types::tr__L1CTL__DATA__IND_l2__data_defval, L1CTL__Types::tr__L1CTL__DATA__IND_num__biterr_defval, L1CTL__Types::tr__L1CTL__DATA__IND_fire__crc_defval), &(dl), any_compref, NULL, NULL, NULL);
if (tmp_151_alt_flag_0 == ALT_YES) {
current_location.update_lineno(1225);
/* BTS_Tests.ttcn, line 1225 */
OCTETSTRING l3(substr(const_cast< const L1CTL__Types::L1ctlMessage&>(dl).payload()().data__ind().payload(), 4, 19));
current_location.update_lineno(1226);
/* BTS_Tests.ttcn, line 1226 */
if (l3__exp.match(l3)) {
current_location.update_lineno(1227);
/* BTS_Tests.ttcn, line 1227 */
TTCN_Runtime::setverdict(PASS);
}
else {
current_location.update_lineno(1229);
/* BTS_Tests.ttcn, line 1229 */
goto tmp_151;
}
break;
}
}
if (tmp_151_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(1232);
/* BTS_Tests.ttcn, line 1232 */
tmp_151_alt_flag_1 = ConnHdlr_component_L1CTL.receive(any_compref, NULL, NULL, NULL);
if (tmp_151_alt_flag_1 == ALT_YES) {
current_location.update_lineno(1232);
/* BTS_Tests.ttcn, line 1232 */
goto tmp_151;
}
}
if (tmp_151_alt_flag_2 == ALT_UNCHECKED) {
current_location.update_lineno(1233);
/* BTS_Tests.ttcn, line 1233 */
if ((!(do__fail))) tmp_151_alt_flag_2 = ALT_MAYBE;
else tmp_151_alt_flag_2 = ALT_NO;
}
if (tmp_151_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(1233);
/* BTS_Tests.ttcn, line 1233 */
tmp_151_alt_flag_2 = T__sacch.timeout(NULL);
if (tmp_151_alt_flag_2 == ALT_YES) {
current_location.update_lineno(1234);
/* BTS_Tests.ttcn, line 1234 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("Timeout waiting for SACCH ");
l3__exp.log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
break;
}
}
if (tmp_151_alt_flag_3 == ALT_UNCHECKED) {
current_location.update_lineno(1236);
/* BTS_Tests.ttcn, line 1236 */
if (do__fail) tmp_151_alt_flag_3 = ALT_MAYBE;
else tmp_151_alt_flag_3 = ALT_NO;
}
if (tmp_151_alt_flag_3 == ALT_MAYBE) {
current_location.update_lineno(1236);
/* BTS_Tests.ttcn, line 1236 */
tmp_151_alt_flag_3 = T__sacch.timeout(NULL);
if (tmp_151_alt_flag_3 == ALT_YES) {
current_location.update_lineno(1237);
/* BTS_Tests.ttcn, line 1237 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Timeout waiting for SACCH "),l3__exp.log(),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(1238);
/* BTS_Tests.ttcn, line 1238 */
Misc__Helpers::f__shutdown(cs_4, 1238, Misc__Helpers::f__shutdown_verdict_defval, Misc__Helpers::f__shutdown_text_defval);
break;
}
}
if (tmp_151_default_flag == ALT_MAYBE) {
tmp_151_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_151_default_flag == ALT_YES || tmp_151_default_flag == ALT_BREAK) break;
else if (tmp_151_default_flag == ALT_REPEAT) goto tmp_151;
}
current_location.update_lineno(1223);
/* BTS_Tests.ttcn, line 1223 */
if (tmp_151_alt_flag_0 == ALT_NO && tmp_151_alt_flag_1 == ALT_NO && tmp_151_alt_flag_2 == ALT_NO && tmp_151_alt_flag_3 == ALT_NO && tmp_151_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file BTS_Tests.ttcn between lines 1223 and 1240.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
}

void start_f__sacch__present(const COMPONENT& component_reference, const OCTETSTRING_template& l3__exp, const BOOLEAN& do__fail)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_sacch_present(");
l3__exp.log();
TTCN_Logger::log_event_str(", ");
do__fail.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_sacch_present", text_buf);
l3__exp.encode_text(text_buf);
do__fail.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__sacch__missing(const OCTETSTRING_template& l3__exp)
{
TTCN_Location current_location("BTS_Tests.ttcn", 1244, TTCN_Location::LOCATION_FUNCTION, "f_sacch_missing");
current_location.update_lineno(1245);
/* BTS_Tests.ttcn, line 1245 */
L1CTL__Types::L1ctlMessage dl;
current_location.update_lineno(1246);
/* BTS_Tests.ttcn, line 1246 */
TIMER T__sacch("T_sacch", 3.0);
current_location.update_lineno(1247);
/* BTS_Tests.ttcn, line 1247 */
ConnHdlr_component_L1CTL.clear();
current_location.update_lineno(1248);
/* BTS_Tests.ttcn, line 1248 */
T__sacch.start();
current_location.update_lineno(1249);
/* BTS_Tests.ttcn, line 1249 */
{
tmp_152:
alt_status tmp_152_alt_flag_0 = ALT_MAYBE;
alt_status tmp_152_alt_flag_1 = ALT_MAYBE;
alt_status tmp_152_alt_flag_2 = ALT_MAYBE;
alt_status tmp_152_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_152_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(1250);
/* BTS_Tests.ttcn, line 1250 */
tmp_152_alt_flag_0 = ConnHdlr_component_L1CTL.receive(L1CTL__Types::tr__L1CTL__DATA__IND(GSM__Types::RslChannelNr_template(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr), GSM__Types::tr__RslLinkID__SACCH(INTEGER_template(0)), L1CTL__Types::tr__L1CTL__DATA__IND_l2__data_defval, L1CTL__Types::tr__L1CTL__DATA__IND_num__biterr_defval, L1CTL__Types::tr__L1CTL__DATA__IND_fire__crc_defval), &(dl), any_compref, NULL, NULL, NULL);
if (tmp_152_alt_flag_0 == ALT_YES) {
current_location.update_lineno(1251);
/* BTS_Tests.ttcn, line 1251 */
OCTETSTRING l3(substr(const_cast< const L1CTL__Types::L1ctlMessage&>(dl).payload()().data__ind().payload(), 4, 19));
current_location.update_lineno(1252);
/* BTS_Tests.ttcn, line 1252 */
if (l3__exp.match(l3)) {
current_location.update_lineno(1253);
/* BTS_Tests.ttcn, line 1253 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Received unexpected SACCH "),dl.log(),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(1254);
/* BTS_Tests.ttcn, line 1254 */
Misc__Helpers::f__shutdown(cs_4, 1254, Misc__Helpers::f__shutdown_verdict_defval, Misc__Helpers::f__shutdown_text_defval);
}
else {
current_location.update_lineno(1256);
/* BTS_Tests.ttcn, line 1256 */
goto tmp_152;
}
break;
}
}
if (tmp_152_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(1259);
/* BTS_Tests.ttcn, line 1259 */
tmp_152_alt_flag_1 = ConnHdlr_component_L1CTL.receive(any_compref, NULL, NULL, NULL);
if (tmp_152_alt_flag_1 == ALT_YES) {
current_location.update_lineno(1259);
/* BTS_Tests.ttcn, line 1259 */
goto tmp_152;
}
}
if (tmp_152_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(1260);
/* BTS_Tests.ttcn, line 1260 */
tmp_152_alt_flag_2 = T__sacch.timeout(NULL);
if (tmp_152_alt_flag_2 == ALT_YES) {
current_location.update_lineno(1261);
/* BTS_Tests.ttcn, line 1261 */
TTCN_Runtime::setverdict(PASS);
break;
}
}
if (tmp_152_default_flag == ALT_MAYBE) {
tmp_152_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_152_default_flag == ALT_YES || tmp_152_default_flag == ALT_BREAK) break;
else if (tmp_152_default_flag == ALT_REPEAT) goto tmp_152;
}
current_location.update_lineno(1249);
/* BTS_Tests.ttcn, line 1249 */
if (tmp_152_alt_flag_0 == ALT_NO && tmp_152_alt_flag_1 == ALT_NO && tmp_152_alt_flag_2 == ALT_NO && tmp_152_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file BTS_Tests.ttcn between lines 1249 and 1263.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
}

void start_f__sacch__missing(const COMPONENT& component_reference, const OCTETSTRING_template& l3__exp)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_sacch_missing(");
l3__exp.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_sacch_missing", text_buf);
l3__exp.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__TC__sacch__filling(const CHARSTRING& )
{
TTCN_Location current_location("BTS_Tests.ttcn", 1267, TTCN_Location::LOCATION_FUNCTION, "f_TC_sacch_filling");
current_location.update_lineno(1269);
/* BTS_Tests.ttcn, line 1269 */
OCTETSTRING si5(Osmocom__Types::f__rnd__octstring(19));
current_location.update_lineno(1270);
/* BTS_Tests.ttcn, line 1270 */
RSL__Emulation::RSL__DchanHdlr_component_RSL.send(RSL__Types::ts__RSL__SACCH__FILL(RSL__Types::RSL__IE__SysinfoType::RSL__SYSTEM__INFO__5, si5), FALSE, NULL);
current_location.update_lineno(1272);
/* BTS_Tests.ttcn, line 1272 */
f__l1__tune(ConnHdlr_component_L1CTL, f__l1__tune_ccch__mode_defval);
current_location.update_lineno(1273);
/* BTS_Tests.ttcn, line 1273 */
RSL__Emulation::RSL__DchanHdlr_component_RSL.clear();
current_location.update_lineno(1276);
/* BTS_Tests.ttcn, line 1276 */
f__est__dchan(f__est__dchan_encr__enable_defval, f__est__dchan_more__ies_defval, f__est__dchan_act__type_defval);
current_location.update_lineno(1279);
/* BTS_Tests.ttcn, line 1279 */
f__sacch__present(OCTETSTRING_template(si5), f__sacch__present_do__fail_defval);
current_location.update_lineno(1282);
/* BTS_Tests.ttcn, line 1282 */
RSL__Emulation::RSL__DchanHdlr_component_RSL.clear();
current_location.update_lineno(1283);
/* BTS_Tests.ttcn, line 1283 */
f__rsl__chan__deact();
current_location.update_lineno(1284);
/* BTS_Tests.ttcn, line 1284 */
L1CTL__PortType::f__L1CTL__DM__REL__REQ(ConnHdlr_component_L1CTL, RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr);
}

void start_f__TC__sacch__filling(const COMPONENT& component_reference, const CHARSTRING& id)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_TC_sacch_filling(");
id.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_TC_sacch_filling", text_buf);
id.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

verdicttype testcase_TC__sacch__filling(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests.ttcn", 1286, TTCN_Location::LOCATION_TESTCASE, "TC_sacch_filling");
try {
TTCN_Runtime::begin_testcase("BTS_Tests", "TC_sacch_filling", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(1287);
/* BTS_Tests.ttcn, line 1287 */
COMPONENT vc__conn;
current_location.update_lineno(1288);
/* BTS_Tests.ttcn, line 1288 */
ConnHdlrPars pars;
current_location.update_lineno(1289);
/* BTS_Tests.ttcn, line 1289 */
f__init(f__init_trx__nr_defval);
{
current_location.update_lineno(1290);
/* BTS_Tests.ttcn, line 1290 */
INTEGER i(0);
current_location.update_lineno(1290);
/* BTS_Tests.ttcn, line 1290 */
for ( ; ; ) {
current_location.update_lineno(1290);
/* BTS_Tests.ttcn, line 1290 */
if (!(i < test__CT_component_g__AllChannels.size_of())) break;
current_location.update_lineno(1291);
/* BTS_Tests.ttcn, line 1291 */
pars = t__Pars(GSM__Types::RslChannelNr_template(const_cast< const ChannelNrs&>(test__CT_component_g__AllChannels)[i]), RSL__Types::ts__RSL__ChanMode__SIGN(RSL__Types::ts__RSL__ChanMode__SIGN_t_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxd_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxu_defval), t__Pars_spec_defval, t__Pars_trx__nr_defval, t__Pars_t__guard_defval).valueof();
current_location.update_lineno(1292);
/* BTS_Tests.ttcn, line 1292 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("TC_sacch_filling: Starting for ");
const_cast< const ChannelNrs&>(test__CT_component_g__AllChannels)[i].log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(1293);
/* BTS_Tests.ttcn, line 1293 */
vc__conn = f__start__handler(&f__TC__sacch__filling, pars, f__start__handler_pcu__comp_defval, f__start__handler_trxc__comp_defval, f__start__handler_l1ctl_defval);
current_location.update_lineno(1294);
/* BTS_Tests.ttcn, line 1294 */
{
tmp_155:
alt_status alt_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (alt_flag != ALT_NO) {
alt_flag = vc__conn.done(NULL, NULL);
if (alt_flag == ALT_YES) break;
else if (alt_flag == ALT_REPEAT) goto tmp_155;
}
if (default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps(first_run);
if (default_flag == ALT_YES || default_flag == ALT_BREAK) break;
else if (default_flag == ALT_REPEAT) goto tmp_155;
}
current_location.update_lineno(1294);
/* BTS_Tests.ttcn, line 1294 */
if (alt_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("Stand-alone done statement failed in file BTS_Tests.ttcn, line 1294.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(1290);
/* BTS_Tests.ttcn, line 1290 */
{
INTEGER tmp_156;
++i;
}
}
}
current_location.update_lineno(1297);
/* BTS_Tests.ttcn, line 1297 */
Misc__Helpers::f__shutdown(cs_4, 1297, Misc__Helpers::f__shutdown_verdict_defval, Misc__Helpers::f__shutdown_text_defval);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_sacch_filling was stopped.");
}
return TTCN_Runtime::end_testcase();
}

void f__TC__sacch__info__mod(const CHARSTRING& )
{
TTCN_Location current_location("BTS_Tests.ttcn", 1301, TTCN_Location::LOCATION_FUNCTION, "f_TC_sacch_info_mod");
current_location.update_lineno(1303);
/* BTS_Tests.ttcn, line 1303 */
OCTETSTRING si5(Osmocom__Types::f__rnd__octstring(19));
current_location.update_lineno(1304);
/* BTS_Tests.ttcn, line 1304 */
OCTETSTRING si5__diff(Osmocom__Types::f__rnd__octstring(19));
current_location.update_lineno(1305);
/* BTS_Tests.ttcn, line 1305 */
RSL__Emulation::RSL__DchanHdlr_component_RSL.send(RSL__Types::ts__RSL__SACCH__FILL(RSL__Types::RSL__IE__SysinfoType::RSL__SYSTEM__INFO__5, si5), FALSE, NULL);
current_location.update_lineno(1307);
/* BTS_Tests.ttcn, line 1307 */
f__l1__tune(ConnHdlr_component_L1CTL, f__l1__tune_ccch__mode_defval);
current_location.update_lineno(1308);
/* BTS_Tests.ttcn, line 1308 */
RSL__Emulation::RSL__DchanHdlr_component_RSL.clear();
current_location.update_lineno(1310);
/* BTS_Tests.ttcn, line 1310 */
TTCN_Logger::log_str(TTCN_USER, "Activating channel, expecting standard SI5");
current_location.update_lineno(1312);
/* BTS_Tests.ttcn, line 1312 */
f__est__dchan(f__est__dchan_encr__enable_defval, f__est__dchan_more__ies_defval, f__est__dchan_act__type_defval);
current_location.update_lineno(1314);
/* BTS_Tests.ttcn, line 1314 */
f__sacch__present(OCTETSTRING_template(si5), f__sacch__present_do__fail_defval);
current_location.update_lineno(1317);
/* BTS_Tests.ttcn, line 1317 */
TTCN_Logger::log_str(TTCN_USER, "Setting channel specific SACCH INFO, expecting it");
current_location.update_lineno(1318);
/* BTS_Tests.ttcn, line 1318 */
RSL__Emulation::RSL__DchanHdlr_component_RSL.send(RSL__Types::ts__RSL__SACCH__INF__MOD(GSM__Types::RslChannelNr_template(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr), RSL__Types::RSL__IE__SysinfoType::RSL__SYSTEM__INFO__5, si5__diff), FALSE, NULL);
current_location.update_lineno(1320);
/* BTS_Tests.ttcn, line 1320 */
f__sacch__present(OCTETSTRING_template(si5__diff), f__sacch__present_do__fail_defval);
current_location.update_lineno(1323);
/* BTS_Tests.ttcn, line 1323 */
TTCN_Logger::log_str(TTCN_USER, "De-activating and re-activating channel, expecting standard SI5");
current_location.update_lineno(1324);
/* BTS_Tests.ttcn, line 1324 */
f__rsl__chan__deact();
current_location.update_lineno(1325);
/* BTS_Tests.ttcn, line 1325 */
f__rsl__chan__act(RSL__Types::ts__RSL__ChanMode__SIGN(RSL__Types::ts__RSL__ChanMode__SIGN_t_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxd_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxu_defval).valueof(), f__rsl__chan__act_encr__enable_defval, f__rsl__chan__act_more__ies_defval, f__rsl__chan__act_act__type_defval);
current_location.update_lineno(1327);
/* BTS_Tests.ttcn, line 1327 */
f__sacch__present(OCTETSTRING_template(si5), f__sacch__present_do__fail_defval);
current_location.update_lineno(1330);
/* BTS_Tests.ttcn, line 1330 */
RSL__Emulation::RSL__DchanHdlr_component_RSL.clear();
current_location.update_lineno(1331);
/* BTS_Tests.ttcn, line 1331 */
f__rsl__chan__deact();
current_location.update_lineno(1332);
/* BTS_Tests.ttcn, line 1332 */
L1CTL__PortType::f__L1CTL__DM__REL__REQ(ConnHdlr_component_L1CTL, RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr);
}

void start_f__TC__sacch__info__mod(const COMPONENT& component_reference, const CHARSTRING& id)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_TC_sacch_info_mod(");
id.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_TC_sacch_info_mod", text_buf);
id.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

verdicttype testcase_TC__sacch__info__mod(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests.ttcn", 1334, TTCN_Location::LOCATION_TESTCASE, "TC_sacch_info_mod");
try {
TTCN_Runtime::begin_testcase("BTS_Tests", "TC_sacch_info_mod", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(1335);
/* BTS_Tests.ttcn, line 1335 */
COMPONENT vc__conn;
current_location.update_lineno(1336);
/* BTS_Tests.ttcn, line 1336 */
ConnHdlrPars pars;
current_location.update_lineno(1337);
/* BTS_Tests.ttcn, line 1337 */
f__init(f__init_trx__nr_defval);
{
current_location.update_lineno(1338);
/* BTS_Tests.ttcn, line 1338 */
INTEGER i(0);
current_location.update_lineno(1338);
/* BTS_Tests.ttcn, line 1338 */
for ( ; ; ) {
current_location.update_lineno(1338);
/* BTS_Tests.ttcn, line 1338 */
if (!(i < test__CT_component_g__AllChannels.size_of())) break;
current_location.update_lineno(1339);
/* BTS_Tests.ttcn, line 1339 */
pars = t__Pars(GSM__Types::RslChannelNr_template(const_cast< const ChannelNrs&>(test__CT_component_g__AllChannels)[i]), RSL__Types::ts__RSL__ChanMode__SIGN(RSL__Types::ts__RSL__ChanMode__SIGN_t_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxd_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxu_defval), t__Pars_spec_defval, t__Pars_trx__nr_defval, t__Pars_t__guard_defval).valueof();
current_location.update_lineno(1340);
/* BTS_Tests.ttcn, line 1340 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("TC_sacch_info_mod: Starting for ");
const_cast< const ChannelNrs&>(test__CT_component_g__AllChannels)[i].log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(1341);
/* BTS_Tests.ttcn, line 1341 */
vc__conn = f__start__handler(&f__TC__sacch__info__mod, pars, f__start__handler_pcu__comp_defval, f__start__handler_trxc__comp_defval, f__start__handler_l1ctl_defval);
current_location.update_lineno(1342);
/* BTS_Tests.ttcn, line 1342 */
{
tmp_159:
alt_status alt_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (alt_flag != ALT_NO) {
alt_flag = vc__conn.done(NULL, NULL);
if (alt_flag == ALT_YES) break;
else if (alt_flag == ALT_REPEAT) goto tmp_159;
}
if (default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps(first_run);
if (default_flag == ALT_YES || default_flag == ALT_BREAK) break;
else if (default_flag == ALT_REPEAT) goto tmp_159;
}
current_location.update_lineno(1342);
/* BTS_Tests.ttcn, line 1342 */
if (alt_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("Stand-alone done statement failed in file BTS_Tests.ttcn, line 1342.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(1338);
/* BTS_Tests.ttcn, line 1338 */
{
INTEGER tmp_160;
++i;
}
}
}
current_location.update_lineno(1345);
/* BTS_Tests.ttcn, line 1345 */
Misc__Helpers::f__shutdown(cs_4, 1345, Misc__Helpers::f__shutdown_verdict_defval, Misc__Helpers::f__shutdown_text_defval);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_sacch_info_mod was stopped.");
}
return TTCN_Runtime::end_testcase();
}

void f__TC__sacch__multi(const CHARSTRING& )
{
TTCN_Location current_location("BTS_Tests.ttcn", 1349, TTCN_Location::LOCATION_FUNCTION, "f_TC_sacch_multi");
current_location.update_lineno(1350);
/* BTS_Tests.ttcn, line 1350 */
OCTETSTRING si5(Osmocom__Types::f__rnd__octstring(19));
current_location.update_lineno(1351);
/* BTS_Tests.ttcn, line 1351 */
OCTETSTRING si5bis(Osmocom__Types::f__rnd__octstring(19));
current_location.update_lineno(1352);
/* BTS_Tests.ttcn, line 1352 */
OCTETSTRING si5ter(Osmocom__Types::f__rnd__octstring(19));
current_location.update_lineno(1353);
/* BTS_Tests.ttcn, line 1353 */
OCTETSTRING si6(Osmocom__Types::f__rnd__octstring(19));
current_location.update_lineno(1355);
/* BTS_Tests.ttcn, line 1355 */
RSL__Emulation::RSL__DchanHdlr_component_RSL.send(RSL__Types::ts__RSL__SACCH__FILL(RSL__Types::RSL__IE__SysinfoType::RSL__SYSTEM__INFO__5, si5), FALSE, NULL);
current_location.update_lineno(1356);
/* BTS_Tests.ttcn, line 1356 */
RSL__Emulation::RSL__DchanHdlr_component_RSL.send(RSL__Types::ts__RSL__SACCH__FILL(RSL__Types::RSL__IE__SysinfoType::RSL__SYSTEM__INFO__5bis, si5bis), FALSE, NULL);
current_location.update_lineno(1357);
/* BTS_Tests.ttcn, line 1357 */
RSL__Emulation::RSL__DchanHdlr_component_RSL.send(RSL__Types::ts__RSL__SACCH__FILL(RSL__Types::RSL__IE__SysinfoType::RSL__SYSTEM__INFO__5ter, si5ter), FALSE, NULL);
current_location.update_lineno(1358);
/* BTS_Tests.ttcn, line 1358 */
RSL__Emulation::RSL__DchanHdlr_component_RSL.send(RSL__Types::ts__RSL__SACCH__FILL(RSL__Types::RSL__IE__SysinfoType::RSL__SYSTEM__INFO__6, si6), FALSE, NULL);
current_location.update_lineno(1360);
/* BTS_Tests.ttcn, line 1360 */
f__l1__tune(ConnHdlr_component_L1CTL, f__l1__tune_ccch__mode_defval);
current_location.update_lineno(1361);
/* BTS_Tests.ttcn, line 1361 */
RSL__Emulation::RSL__DchanHdlr_component_RSL.clear();
current_location.update_lineno(1364);
/* BTS_Tests.ttcn, line 1364 */
f__est__dchan(f__est__dchan_encr__enable_defval, f__est__dchan_more__ies_defval, f__est__dchan_act__type_defval);
current_location.update_lineno(1365);
/* BTS_Tests.ttcn, line 1365 */
ConnHdlr_component_L1CTL.clear();
current_location.update_lineno(1368);
/* BTS_Tests.ttcn, line 1368 */
f__sacch__present(OCTETSTRING_template(si5), f__sacch__present_do__fail_defval);
current_location.update_lineno(1369);
/* BTS_Tests.ttcn, line 1369 */
f__sacch__present(OCTETSTRING_template(si5bis), f__sacch__present_do__fail_defval);
current_location.update_lineno(1370);
/* BTS_Tests.ttcn, line 1370 */
f__sacch__present(OCTETSTRING_template(si5ter), f__sacch__present_do__fail_defval);
current_location.update_lineno(1371);
/* BTS_Tests.ttcn, line 1371 */
f__sacch__present(OCTETSTRING_template(si6), f__sacch__present_do__fail_defval);
current_location.update_lineno(1374);
/* BTS_Tests.ttcn, line 1374 */
f__rsl__chan__deact();
current_location.update_lineno(1375);
/* BTS_Tests.ttcn, line 1375 */
L1CTL__PortType::f__L1CTL__DM__REL__REQ(ConnHdlr_component_L1CTL, RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr);
}

void start_f__TC__sacch__multi(const COMPONENT& component_reference, const CHARSTRING& id)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_TC_sacch_multi(");
id.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_TC_sacch_multi", text_buf);
id.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

verdicttype testcase_TC__sacch__multi(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests.ttcn", 1377, TTCN_Location::LOCATION_TESTCASE, "TC_sacch_multi");
try {
TTCN_Runtime::begin_testcase("BTS_Tests", "TC_sacch_multi", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(1378);
/* BTS_Tests.ttcn, line 1378 */
COMPONENT vc__conn;
current_location.update_lineno(1379);
/* BTS_Tests.ttcn, line 1379 */
ConnHdlrPars pars;
current_location.update_lineno(1380);
/* BTS_Tests.ttcn, line 1380 */
f__init(f__init_trx__nr_defval);
{
current_location.update_lineno(1381);
/* BTS_Tests.ttcn, line 1381 */
INTEGER i(0);
current_location.update_lineno(1381);
/* BTS_Tests.ttcn, line 1381 */
for ( ; ; ) {
current_location.update_lineno(1381);
/* BTS_Tests.ttcn, line 1381 */
if (!(i < test__CT_component_g__AllChannels.size_of())) break;
current_location.update_lineno(1382);
/* BTS_Tests.ttcn, line 1382 */
pars = t__Pars(GSM__Types::RslChannelNr_template(const_cast< const ChannelNrs&>(test__CT_component_g__AllChannels)[i]), RSL__Types::ts__RSL__ChanMode__SIGN(RSL__Types::ts__RSL__ChanMode__SIGN_t_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxd_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxu_defval), t__Pars_spec_defval, t__Pars_trx__nr_defval, t__Pars_t__guard_defval).valueof();
current_location.update_lineno(1383);
/* BTS_Tests.ttcn, line 1383 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("TC_sacch_multi: Starting for ");
const_cast< const ChannelNrs&>(test__CT_component_g__AllChannels)[i].log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(1384);
/* BTS_Tests.ttcn, line 1384 */
vc__conn = f__start__handler(&f__TC__sacch__multi, pars, f__start__handler_pcu__comp_defval, f__start__handler_trxc__comp_defval, f__start__handler_l1ctl_defval);
current_location.update_lineno(1385);
/* BTS_Tests.ttcn, line 1385 */
{
tmp_163:
alt_status alt_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (alt_flag != ALT_NO) {
alt_flag = vc__conn.done(NULL, NULL);
if (alt_flag == ALT_YES) break;
else if (alt_flag == ALT_REPEAT) goto tmp_163;
}
if (default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps(first_run);
if (default_flag == ALT_YES || default_flag == ALT_BREAK) break;
else if (default_flag == ALT_REPEAT) goto tmp_163;
}
current_location.update_lineno(1385);
/* BTS_Tests.ttcn, line 1385 */
if (alt_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("Stand-alone done statement failed in file BTS_Tests.ttcn, line 1385.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(1381);
/* BTS_Tests.ttcn, line 1381 */
{
INTEGER tmp_164;
++i;
}
}
}
current_location.update_lineno(1388);
/* BTS_Tests.ttcn, line 1388 */
Misc__Helpers::f__shutdown(cs_4, 1388, Misc__Helpers::f__shutdown_verdict_defval, Misc__Helpers::f__shutdown_text_defval);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_sacch_multi was stopped.");
}
return TTCN_Runtime::end_testcase();
}

void f__TC__sacch__multi__chg(const CHARSTRING& )
{
TTCN_Location current_location("BTS_Tests.ttcn", 1392, TTCN_Location::LOCATION_FUNCTION, "f_TC_sacch_multi_chg");
current_location.update_lineno(1393);
/* BTS_Tests.ttcn, line 1393 */
OCTETSTRING si5(Osmocom__Types::f__rnd__octstring(19));
current_location.update_lineno(1394);
/* BTS_Tests.ttcn, line 1394 */
OCTETSTRING si6(Osmocom__Types::f__rnd__octstring(19));
current_location.update_lineno(1397);
/* BTS_Tests.ttcn, line 1397 */
RSL__Emulation::RSL__DchanHdlr_component_RSL.send(RSL__Types::ts__RSL__SACCH__FILL(RSL__Types::RSL__IE__SysinfoType::RSL__SYSTEM__INFO__5, si5), FALSE, NULL);
current_location.update_lineno(1398);
/* BTS_Tests.ttcn, line 1398 */
RSL__Emulation::RSL__DchanHdlr_component_RSL.send(RSL__Types::ts__RSL__SACCH__FILL(RSL__Types::RSL__IE__SysinfoType::RSL__SYSTEM__INFO__6, si6), FALSE, NULL);
current_location.update_lineno(1400);
/* BTS_Tests.ttcn, line 1400 */
f__l1__tune(ConnHdlr_component_L1CTL, f__l1__tune_ccch__mode_defval);
current_location.update_lineno(1401);
/* BTS_Tests.ttcn, line 1401 */
RSL__Emulation::RSL__DchanHdlr_component_RSL.clear();
current_location.update_lineno(1404);
/* BTS_Tests.ttcn, line 1404 */
f__est__dchan(f__est__dchan_encr__enable_defval, f__est__dchan_more__ies_defval, f__est__dchan_act__type_defval);
current_location.update_lineno(1405);
/* BTS_Tests.ttcn, line 1405 */
ConnHdlr_component_L1CTL.clear();
current_location.update_lineno(1408);
/* BTS_Tests.ttcn, line 1408 */
f__sacch__present(OCTETSTRING_template(si5), f__sacch__present_do__fail_defval);
current_location.update_lineno(1409);
/* BTS_Tests.ttcn, line 1409 */
f__sacch__present(OCTETSTRING_template(si6), f__sacch__present_do__fail_defval);
current_location.update_lineno(1412);
/* BTS_Tests.ttcn, line 1412 */
RSL__Emulation::RSL__DchanHdlr_component_RSL.send(RSL__Types::ts__RSL__SACCH__FILL(RSL__Types::RSL__IE__SysinfoType::RSL__SYSTEM__INFO__6, os_2), FALSE, NULL);
current_location.update_lineno(1415);
/* BTS_Tests.ttcn, line 1415 */
f__sacch__present(OCTETSTRING_template(si5), f__sacch__present_do__fail_defval);
current_location.update_lineno(1417);
/* BTS_Tests.ttcn, line 1417 */
f__sacch__missing(OCTETSTRING_template(si6));
current_location.update_lineno(1420);
/* BTS_Tests.ttcn, line 1420 */
f__rsl__chan__deact();
current_location.update_lineno(1421);
/* BTS_Tests.ttcn, line 1421 */
L1CTL__PortType::f__L1CTL__DM__REL__REQ(ConnHdlr_component_L1CTL, RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr);
}

void start_f__TC__sacch__multi__chg(const COMPONENT& component_reference, const CHARSTRING& id)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_TC_sacch_multi_chg(");
id.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_TC_sacch_multi_chg", text_buf);
id.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

verdicttype testcase_TC__sacch__multi__chg(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests.ttcn", 1423, TTCN_Location::LOCATION_TESTCASE, "TC_sacch_multi_chg");
try {
TTCN_Runtime::begin_testcase("BTS_Tests", "TC_sacch_multi_chg", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(1424);
/* BTS_Tests.ttcn, line 1424 */
COMPONENT vc__conn;
current_location.update_lineno(1425);
/* BTS_Tests.ttcn, line 1425 */
ConnHdlrPars pars;
current_location.update_lineno(1426);
/* BTS_Tests.ttcn, line 1426 */
f__init(f__init_trx__nr_defval);
{
current_location.update_lineno(1427);
/* BTS_Tests.ttcn, line 1427 */
INTEGER i(0);
current_location.update_lineno(1427);
/* BTS_Tests.ttcn, line 1427 */
for ( ; ; ) {
current_location.update_lineno(1427);
/* BTS_Tests.ttcn, line 1427 */
if (!(i < test__CT_component_g__AllChannels.size_of())) break;
current_location.update_lineno(1428);
/* BTS_Tests.ttcn, line 1428 */
pars = t__Pars(GSM__Types::RslChannelNr_template(const_cast< const ChannelNrs&>(test__CT_component_g__AllChannels)[i]), RSL__Types::ts__RSL__ChanMode__SIGN(RSL__Types::ts__RSL__ChanMode__SIGN_t_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxd_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxu_defval), t__Pars_spec_defval, t__Pars_trx__nr_defval, t__Pars_t__guard_defval).valueof();
current_location.update_lineno(1429);
/* BTS_Tests.ttcn, line 1429 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("TC_sacch_multi_chg: Starting for ");
const_cast< const ChannelNrs&>(test__CT_component_g__AllChannels)[i].log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(1430);
/* BTS_Tests.ttcn, line 1430 */
vc__conn = f__start__handler(&f__TC__sacch__multi__chg, pars, f__start__handler_pcu__comp_defval, f__start__handler_trxc__comp_defval, f__start__handler_l1ctl_defval);
current_location.update_lineno(1431);
/* BTS_Tests.ttcn, line 1431 */
{
tmp_167:
alt_status alt_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (alt_flag != ALT_NO) {
alt_flag = vc__conn.done(NULL, NULL);
if (alt_flag == ALT_YES) break;
else if (alt_flag == ALT_REPEAT) goto tmp_167;
}
if (default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps(first_run);
if (default_flag == ALT_YES || default_flag == ALT_BREAK) break;
else if (default_flag == ALT_REPEAT) goto tmp_167;
}
current_location.update_lineno(1431);
/* BTS_Tests.ttcn, line 1431 */
if (alt_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("Stand-alone done statement failed in file BTS_Tests.ttcn, line 1431.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(1427);
/* BTS_Tests.ttcn, line 1427 */
{
INTEGER tmp_168;
++i;
}
}
}
current_location.update_lineno(1434);
/* BTS_Tests.ttcn, line 1434 */
Misc__Helpers::f__shutdown(cs_4, 1434, Misc__Helpers::f__shutdown_verdict_defval, Misc__Helpers::f__shutdown_text_defval);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_sacch_multi_chg was stopped.");
}
return TTCN_Runtime::end_testcase();
}

void f__TC__sacch__chan__act(const CHARSTRING& )
{
TTCN_Location current_location("BTS_Tests.ttcn", 1438, TTCN_Location::LOCATION_FUNCTION, "f_TC_sacch_chan_act");
current_location.update_lineno(1439);
/* BTS_Tests.ttcn, line 1439 */
OCTETSTRING si5(Osmocom__Types::f__rnd__octstring(19));
current_location.update_lineno(1440);
/* BTS_Tests.ttcn, line 1440 */
OCTETSTRING si6(Osmocom__Types::f__rnd__octstring(19));
current_location.update_lineno(1441);
/* BTS_Tests.ttcn, line 1441 */
OCTETSTRING si5__specific(Osmocom__Types::f__rnd__octstring(19));
current_location.update_lineno(1442);
/* BTS_Tests.ttcn, line 1442 */
OCTETSTRING si6__specific(Osmocom__Types::f__rnd__octstring(19));
current_location.update_lineno(1445);
/* BTS_Tests.ttcn, line 1445 */
RSL__Emulation::RSL__DchanHdlr_component_RSL.send(RSL__Types::ts__RSL__SACCH__FILL(RSL__Types::RSL__IE__SysinfoType::RSL__SYSTEM__INFO__5, si5), FALSE, NULL);
current_location.update_lineno(1446);
/* BTS_Tests.ttcn, line 1446 */
RSL__Emulation::RSL__DchanHdlr_component_RSL.send(RSL__Types::ts__RSL__SACCH__FILL(RSL__Types::RSL__IE__SysinfoType::RSL__SYSTEM__INFO__6, si6), FALSE, NULL);
current_location.update_lineno(1448);
/* BTS_Tests.ttcn, line 1448 */
f__l1__tune(ConnHdlr_component_L1CTL, f__l1__tune_ccch__mode_defval);
current_location.update_lineno(1449);
/* BTS_Tests.ttcn, line 1449 */
RSL__Emulation::RSL__DchanHdlr_component_RSL.clear();
current_location.update_lineno(1452);
/* BTS_Tests.ttcn, line 1452 */
RSL__Types::RSL__SacchInfo sacch__info;
{
RSL__Types::RSL__SacchInfoElements_template tmp_169;
tmp_169.set_size(2);
tmp_169[0] = RSL__Types::ts__RSL__SacchInfoElem(RSL__Types::RSL__IE__SysinfoType::RSL__SYSTEM__INFO__5, si5__specific);
tmp_169[1] = RSL__Types::ts__RSL__SacchInfoElem(RSL__Types::RSL__IE__SysinfoType::RSL__SYSTEM__INFO__6, si6__specific);
sacch__info = RSL__Types::ts__RSL__SacchInfo(tmp_169).valueof();
}
current_location.update_lineno(1456);
/* BTS_Tests.ttcn, line 1456 */
RSL__Types::RSL__IE__List addl__ies;
addl__ies.set_size(1);
{
RSL__Types::RSL__IE__Body_template tmp_170;
tmp_170.sacch__info() = sacch__info;
addl__ies[0] = RSL__Types::t__RSL__IE(RSL__Types::RSL__IE__Type::RSL__IE__SACCH__INFO, tmp_170).valueof();
}
current_location.update_lineno(1458);
/* BTS_Tests.ttcn, line 1458 */
f__est__dchan(f__est__dchan_encr__enable_defval, addl__ies, f__est__dchan_act__type_defval);
current_location.update_lineno(1461);
/* BTS_Tests.ttcn, line 1461 */
f__sacch__present(OCTETSTRING_template(si5__specific), f__sacch__present_do__fail_defval);
current_location.update_lineno(1462);
/* BTS_Tests.ttcn, line 1462 */
f__sacch__present(OCTETSTRING_template(si6__specific), f__sacch__present_do__fail_defval);
current_location.update_lineno(1465);
/* BTS_Tests.ttcn, line 1465 */
f__rsl__chan__deact();
current_location.update_lineno(1466);
/* BTS_Tests.ttcn, line 1466 */
L1CTL__PortType::f__L1CTL__DM__REL__REQ(ConnHdlr_component_L1CTL, RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr);
}

void start_f__TC__sacch__chan__act(const COMPONENT& component_reference, const CHARSTRING& id)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_TC_sacch_chan_act(");
id.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_TC_sacch_chan_act", text_buf);
id.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

verdicttype testcase_TC__sacch__chan__act(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests.ttcn", 1468, TTCN_Location::LOCATION_TESTCASE, "TC_sacch_chan_act");
try {
TTCN_Runtime::begin_testcase("BTS_Tests", "TC_sacch_chan_act", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(1469);
/* BTS_Tests.ttcn, line 1469 */
COMPONENT vc__conn;
current_location.update_lineno(1470);
/* BTS_Tests.ttcn, line 1470 */
ConnHdlrPars pars;
current_location.update_lineno(1471);
/* BTS_Tests.ttcn, line 1471 */
f__init(f__init_trx__nr_defval);
{
current_location.update_lineno(1473);
/* BTS_Tests.ttcn, line 1473 */
INTEGER i(0);
current_location.update_lineno(1473);
/* BTS_Tests.ttcn, line 1473 */
for ( ; ; ) {
current_location.update_lineno(1473);
/* BTS_Tests.ttcn, line 1473 */
if (!(i < test__CT_component_g__AllChannels.size_of())) break;
current_location.update_lineno(1474);
/* BTS_Tests.ttcn, line 1474 */
pars = t__Pars(GSM__Types::RslChannelNr_template(const_cast< const ChannelNrs&>(test__CT_component_g__AllChannels)[i]), RSL__Types::ts__RSL__ChanMode__SIGN(RSL__Types::ts__RSL__ChanMode__SIGN_t_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxd_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxu_defval), t__Pars_spec_defval, t__Pars_trx__nr_defval, t__Pars_t__guard_defval).valueof();
current_location.update_lineno(1475);
/* BTS_Tests.ttcn, line 1475 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("TC_sacch_chan_act: Starting for ");
const_cast< const ChannelNrs&>(test__CT_component_g__AllChannels)[i].log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(1476);
/* BTS_Tests.ttcn, line 1476 */
vc__conn = f__start__handler(&f__TC__sacch__chan__act, pars, f__start__handler_pcu__comp_defval, f__start__handler_trxc__comp_defval, f__start__handler_l1ctl_defval);
current_location.update_lineno(1477);
/* BTS_Tests.ttcn, line 1477 */
{
tmp_173:
alt_status alt_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (alt_flag != ALT_NO) {
alt_flag = vc__conn.done(NULL, NULL);
if (alt_flag == ALT_YES) break;
else if (alt_flag == ALT_REPEAT) goto tmp_173;
}
if (default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps(first_run);
if (default_flag == ALT_YES || default_flag == ALT_BREAK) break;
else if (default_flag == ALT_REPEAT) goto tmp_173;
}
current_location.update_lineno(1477);
/* BTS_Tests.ttcn, line 1477 */
if (alt_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("Stand-alone done statement failed in file BTS_Tests.ttcn, line 1477.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(1473);
/* BTS_Tests.ttcn, line 1473 */
{
INTEGER tmp_174;
++i;
}
}
}
current_location.update_lineno(1480);
/* BTS_Tests.ttcn, line 1480 */
Misc__Helpers::f__shutdown(cs_4, 1480, Misc__Helpers::f__shutdown_verdict_defval, Misc__Helpers::f__shutdown_text_defval);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_sacch_chan_act was stopped.");
}
return TTCN_Runtime::end_testcase();
}

void f__TC__sacch__chan__act__ho__async(const CHARSTRING& )
{
TTCN_Location current_location("BTS_Tests.ttcn", 1485, TTCN_Location::LOCATION_FUNCTION, "f_TC_sacch_chan_act_ho_async");
current_location.update_lineno(1486);
/* BTS_Tests.ttcn, line 1486 */
OCTETSTRING si5(Osmocom__Types::f__rnd__octstring(19));
current_location.update_lineno(1487);
/* BTS_Tests.ttcn, line 1487 */
RSL__Emulation::RSL__DchanHdlr_component_RSL.send(RSL__Types::ts__RSL__SACCH__FILL(RSL__Types::RSL__IE__SysinfoType::RSL__SYSTEM__INFO__5, si5), FALSE, NULL);
current_location.update_lineno(1489);
/* BTS_Tests.ttcn, line 1489 */
f__l1__tune(ConnHdlr_component_L1CTL, f__l1__tune_ccch__mode_defval);
current_location.update_lineno(1490);
/* BTS_Tests.ttcn, line 1490 */
RSL__Emulation::RSL__DchanHdlr_component_RSL.clear();
current_location.update_lineno(1494);
/* BTS_Tests.ttcn, line 1494 */
INTEGER ho__ref(oct2int(Osmocom__Types::f__rnd__octstring(1)));
current_location.update_lineno(1495);
/* BTS_Tests.ttcn, line 1495 */
RSL__Types::RSL__IE ho__ref__ie;
{
RSL__Types::RSL__IE__Body_template tmp_175;
tmp_175.handover__ref() = ho__ref;
ho__ref__ie = RSL__Types::t__RSL__IE(RSL__Types::RSL__IE__Type::RSL__IE__HANDO__REF, tmp_175).valueof();
}
current_location.update_lineno(1497);
/* BTS_Tests.ttcn, line 1497 */
RSL__Types::RSL__IE__List addl__ies;
addl__ies.set_size(1);
addl__ies[0] = ho__ref__ie;
current_location.update_lineno(1502);
/* BTS_Tests.ttcn, line 1502 */
f__rsl__chan__act(RSL__Types::RSL__IE__ChannelMode(const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).chan__mode()), f__rsl__chan__act_encr__enable_defval, addl__ies, RSL__Types::c__RSL__IE__ActType__HO__ASYNC);
current_location.update_lineno(1505);
/* BTS_Tests.ttcn, line 1505 */
f__l1ctl__est__dchan(ConnHdlr_component_L1CTL, ConnHdlr_component_g__pars);
current_location.update_lineno(1508);
/* BTS_Tests.ttcn, line 1508 */
f__sacch__missing(OCTETSTRING_template(ANY_VALUE));
current_location.update_lineno(1511);
/* BTS_Tests.ttcn, line 1511 */
L1CTL__PortType::f__L1CTL__RACH(ConnHdlr_component_L1CTL, ho__ref, L1CTL__PortType::f__L1CTL__RACH_combined_defval, L1CTL__PortType::f__L1CTL__RACH_offset_defval, GSM__Types::RslChannelNr_template(const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).chan__nr()), L1CTL__PortType::f__L1CTL__RACH_link__id_defval);
current_location.update_lineno(1513);
/* BTS_Tests.ttcn, line 1513 */
f__sacch__present(OCTETSTRING_template(si5), f__sacch__present_do__fail_defval);
current_location.update_lineno(1515);
/* BTS_Tests.ttcn, line 1515 */
f__rsl__chan__deact();
current_location.update_lineno(1516);
/* BTS_Tests.ttcn, line 1516 */
L1CTL__PortType::f__L1CTL__DM__REL__REQ(ConnHdlr_component_L1CTL, RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr);
current_location.update_lineno(1517);
/* BTS_Tests.ttcn, line 1517 */
L1CTL__PortType::f__L1CTL__RESET(ConnHdlr_component_L1CTL, L1CTL__PortType::f__L1CTL__RESET_res__type_defval);
current_location.update_lineno(1520);
/* BTS_Tests.ttcn, line 1520 */
f__l1__tune(ConnHdlr_component_L1CTL, f__l1__tune_ccch__mode_defval);
current_location.update_lineno(1526);
/* BTS_Tests.ttcn, line 1526 */
addl__ies.set_size(2);
addl__ies[0] = ho__ref__ie;
{
RSL__Types::RSL__IE__Body_template tmp_177;
tmp_177.ms__power() = RSL__Types::ts__RSL__IE__MS__Power(0, RSL__Types::ts__RSL__IE__MS__Power_fpc__epc_defval);
addl__ies[1] = RSL__Types::t__RSL__IE(RSL__Types::RSL__IE__Type::RSL__IE__MS__POWER, tmp_177).valueof();
}
current_location.update_lineno(1530);
/* BTS_Tests.ttcn, line 1530 */
f__rsl__chan__act(RSL__Types::RSL__IE__ChannelMode(const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).chan__mode()), f__rsl__chan__act_encr__enable_defval, addl__ies, RSL__Types::c__RSL__IE__ActType__HO__ASYNC);
current_location.update_lineno(1533);
/* BTS_Tests.ttcn, line 1533 */
f__l1ctl__est__dchan(ConnHdlr_component_L1CTL, ConnHdlr_component_g__pars);
current_location.update_lineno(1537);
/* BTS_Tests.ttcn, line 1537 */
f__sacch__present(OCTETSTRING_template(si5), FALSE);
current_location.update_lineno(1540);
/* BTS_Tests.ttcn, line 1540 */
L1CTL__PortType::f__L1CTL__RACH(ConnHdlr_component_L1CTL, ho__ref, L1CTL__PortType::f__L1CTL__RACH_combined_defval, L1CTL__PortType::f__L1CTL__RACH_offset_defval, GSM__Types::RslChannelNr_template(const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).chan__nr()), L1CTL__PortType::f__L1CTL__RACH_link__id_defval);
current_location.update_lineno(1542);
/* BTS_Tests.ttcn, line 1542 */
f__sacch__present(OCTETSTRING_template(si5), f__sacch__present_do__fail_defval);
current_location.update_lineno(1544);
/* BTS_Tests.ttcn, line 1544 */
f__rsl__chan__deact();
current_location.update_lineno(1545);
/* BTS_Tests.ttcn, line 1545 */
L1CTL__PortType::f__L1CTL__DM__REL__REQ(ConnHdlr_component_L1CTL, RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr);
}

void start_f__TC__sacch__chan__act__ho__async(const COMPONENT& component_reference, const CHARSTRING& id)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_TC_sacch_chan_act_ho_async(");
id.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_TC_sacch_chan_act_ho_async", text_buf);
id.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

verdicttype testcase_TC__sacch__chan__act__ho__async(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests.ttcn", 1547, TTCN_Location::LOCATION_TESTCASE, "TC_sacch_chan_act_ho_async");
try {
TTCN_Runtime::begin_testcase("BTS_Tests", "TC_sacch_chan_act_ho_async", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(1548);
/* BTS_Tests.ttcn, line 1548 */
COMPONENT vc__conn;
current_location.update_lineno(1549);
/* BTS_Tests.ttcn, line 1549 */
ConnHdlrPars pars;
current_location.update_lineno(1550);
/* BTS_Tests.ttcn, line 1550 */
f__init(f__init_trx__nr_defval);
{
current_location.update_lineno(1552);
/* BTS_Tests.ttcn, line 1552 */
INTEGER i(0);
current_location.update_lineno(1552);
/* BTS_Tests.ttcn, line 1552 */
for ( ; ; ) {
current_location.update_lineno(1552);
/* BTS_Tests.ttcn, line 1552 */
if (!(i < test__CT_component_g__AllChanTypes.size_of())) break;
current_location.update_lineno(1553);
/* BTS_Tests.ttcn, line 1553 */
pars = t__Pars(GSM__Types::RslChannelNr_template(const_cast< const ChannelNrs&>(test__CT_component_g__AllChanTypes)[i]), RSL__Types::ts__RSL__ChanMode__SIGN(RSL__Types::ts__RSL__ChanMode__SIGN_t_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxd_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxu_defval), t__Pars_spec_defval, t__Pars_trx__nr_defval, t__Pars_t__guard_defval).valueof();
current_location.update_lineno(1554);
/* BTS_Tests.ttcn, line 1554 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("TC_sacch_chan_act_ho_async: Starting for ");
const_cast< const ChannelNrs&>(test__CT_component_g__AllChanTypes)[i].log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(1555);
/* BTS_Tests.ttcn, line 1555 */
vc__conn = f__start__handler(&f__TC__sacch__chan__act__ho__async, pars, f__start__handler_pcu__comp_defval, f__start__handler_trxc__comp_defval, f__start__handler_l1ctl_defval);
current_location.update_lineno(1556);
/* BTS_Tests.ttcn, line 1556 */
{
tmp_180:
alt_status alt_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (alt_flag != ALT_NO) {
alt_flag = vc__conn.done(NULL, NULL);
if (alt_flag == ALT_YES) break;
else if (alt_flag == ALT_REPEAT) goto tmp_180;
}
if (default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps(first_run);
if (default_flag == ALT_YES || default_flag == ALT_BREAK) break;
else if (default_flag == ALT_REPEAT) goto tmp_180;
}
current_location.update_lineno(1556);
/* BTS_Tests.ttcn, line 1556 */
if (alt_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("Stand-alone done statement failed in file BTS_Tests.ttcn, line 1556.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(1552);
/* BTS_Tests.ttcn, line 1552 */
{
INTEGER tmp_181;
++i;
}
}
}
current_location.update_lineno(1559);
/* BTS_Tests.ttcn, line 1559 */
Misc__Helpers::f__shutdown(cs_4, 1559, Misc__Helpers::f__shutdown_verdict_defval, Misc__Helpers::f__shutdown_text_defval);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_sacch_chan_act_ho_async was stopped.");
}
return TTCN_Runtime::end_testcase();
}

void f__TC__sacch__chan__act__ho__sync(const CHARSTRING& )
{
TTCN_Location current_location("BTS_Tests.ttcn", 1564, TTCN_Location::LOCATION_FUNCTION, "f_TC_sacch_chan_act_ho_sync");
current_location.update_lineno(1565);
/* BTS_Tests.ttcn, line 1565 */
OCTETSTRING si5(Osmocom__Types::f__rnd__octstring(19));
current_location.update_lineno(1566);
/* BTS_Tests.ttcn, line 1566 */
RSL__Emulation::RSL__DchanHdlr_component_RSL.send(RSL__Types::ts__RSL__SACCH__FILL(RSL__Types::RSL__IE__SysinfoType::RSL__SYSTEM__INFO__5, si5), FALSE, NULL);
current_location.update_lineno(1568);
/* BTS_Tests.ttcn, line 1568 */
RSL__Types::RSL__IE__List addl__ies;
current_location.update_lineno(1570);
/* BTS_Tests.ttcn, line 1570 */
f__l1__tune(ConnHdlr_component_L1CTL, f__l1__tune_ccch__mode_defval);
current_location.update_lineno(1571);
/* BTS_Tests.ttcn, line 1571 */
RSL__Emulation::RSL__DchanHdlr_component_RSL.clear();
current_location.update_lineno(1575);
/* BTS_Tests.ttcn, line 1575 */
INTEGER ho__ref(oct2int(Osmocom__Types::f__rnd__octstring(1)));
current_location.update_lineno(1576);
/* BTS_Tests.ttcn, line 1576 */
RSL__Types::RSL__IE ho__ref__ie;
{
RSL__Types::RSL__IE__Body_template tmp_182;
tmp_182.handover__ref() = ho__ref;
ho__ref__ie = RSL__Types::t__RSL__IE(RSL__Types::RSL__IE__Type::RSL__IE__HANDO__REF, tmp_182).valueof();
}
current_location.update_lineno(1578);
/* BTS_Tests.ttcn, line 1578 */
addl__ies.set_size(1);
addl__ies[0] = ho__ref__ie;
current_location.update_lineno(1583);
/* BTS_Tests.ttcn, line 1583 */
f__rsl__chan__act(RSL__Types::RSL__IE__ChannelMode(const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).chan__mode()), f__rsl__chan__act_encr__enable_defval, addl__ies, RSL__Types::c__RSL__IE__ActType__HO__SYNC);
current_location.update_lineno(1586);
/* BTS_Tests.ttcn, line 1586 */
f__l1ctl__est__dchan(ConnHdlr_component_L1CTL, ConnHdlr_component_g__pars);
current_location.update_lineno(1589);
/* BTS_Tests.ttcn, line 1589 */
f__sacch__missing(OCTETSTRING_template(ANY_VALUE));
current_location.update_lineno(1592);
/* BTS_Tests.ttcn, line 1592 */
L1CTL__PortType::f__L1CTL__RACH(ConnHdlr_component_L1CTL, ho__ref, L1CTL__PortType::f__L1CTL__RACH_combined_defval, L1CTL__PortType::f__L1CTL__RACH_offset_defval, GSM__Types::RslChannelNr_template(const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).chan__nr()), L1CTL__PortType::f__L1CTL__RACH_link__id_defval);
current_location.update_lineno(1594);
/* BTS_Tests.ttcn, line 1594 */
f__sacch__present(OCTETSTRING_template(si5), f__sacch__present_do__fail_defval);
current_location.update_lineno(1596);
/* BTS_Tests.ttcn, line 1596 */
f__rsl__chan__deact();
current_location.update_lineno(1597);
/* BTS_Tests.ttcn, line 1597 */
L1CTL__PortType::f__L1CTL__DM__REL__REQ(ConnHdlr_component_L1CTL, RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr);
current_location.update_lineno(1598);
/* BTS_Tests.ttcn, line 1598 */
L1CTL__PortType::f__L1CTL__RESET(ConnHdlr_component_L1CTL, L1CTL__PortType::f__L1CTL__RESET_res__type_defval);
current_location.update_lineno(1601);
/* BTS_Tests.ttcn, line 1601 */
f__l1__tune(ConnHdlr_component_L1CTL, f__l1__tune_ccch__mode_defval);
current_location.update_lineno(1607);
/* BTS_Tests.ttcn, line 1607 */
addl__ies.set_size(2);
addl__ies[0] = ho__ref__ie;
{
RSL__Types::RSL__IE__Body_template tmp_185;
tmp_185.ms__power() = RSL__Types::ts__RSL__IE__MS__Power(0, RSL__Types::ts__RSL__IE__MS__Power_fpc__epc_defval);
addl__ies[1] = RSL__Types::t__RSL__IE(RSL__Types::RSL__IE__Type::RSL__IE__MS__POWER, tmp_185).valueof();
}
current_location.update_lineno(1611);
/* BTS_Tests.ttcn, line 1611 */
f__rsl__chan__act(RSL__Types::RSL__IE__ChannelMode(const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).chan__mode()), f__rsl__chan__act_encr__enable_defval, addl__ies, RSL__Types::c__RSL__IE__ActType__HO__SYNC);
current_location.update_lineno(1614);
/* BTS_Tests.ttcn, line 1614 */
f__l1ctl__est__dchan(ConnHdlr_component_L1CTL, ConnHdlr_component_g__pars);
current_location.update_lineno(1618);
/* BTS_Tests.ttcn, line 1618 */
f__sacch__present(OCTETSTRING_template(si5), FALSE);
current_location.update_lineno(1621);
/* BTS_Tests.ttcn, line 1621 */
L1CTL__PortType::f__L1CTL__RACH(ConnHdlr_component_L1CTL, ho__ref, L1CTL__PortType::f__L1CTL__RACH_combined_defval, L1CTL__PortType::f__L1CTL__RACH_offset_defval, GSM__Types::RslChannelNr_template(const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).chan__nr()), L1CTL__PortType::f__L1CTL__RACH_link__id_defval);
current_location.update_lineno(1623);
/* BTS_Tests.ttcn, line 1623 */
f__sacch__present(OCTETSTRING_template(si5), f__sacch__present_do__fail_defval);
current_location.update_lineno(1625);
/* BTS_Tests.ttcn, line 1625 */
f__rsl__chan__deact();
current_location.update_lineno(1626);
/* BTS_Tests.ttcn, line 1626 */
L1CTL__PortType::f__L1CTL__DM__REL__REQ(ConnHdlr_component_L1CTL, RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr);
current_location.update_lineno(1627);
/* BTS_Tests.ttcn, line 1627 */
L1CTL__PortType::f__L1CTL__RESET(ConnHdlr_component_L1CTL, L1CTL__PortType::f__L1CTL__RESET_res__type_defval);
current_location.update_lineno(1630);
/* BTS_Tests.ttcn, line 1630 */
f__l1__tune(ConnHdlr_component_L1CTL, f__l1__tune_ccch__mode_defval);
current_location.update_lineno(1636);
/* BTS_Tests.ttcn, line 1636 */
addl__ies.set_size(2);
addl__ies[0] = ho__ref__ie;
{
RSL__Types::RSL__IE__Body_template tmp_187;
tmp_187.timing__adv() = 0;
addl__ies[1] = RSL__Types::t__RSL__IE(RSL__Types::RSL__IE__Type::RSL__IE__TIMING__ADVANCE, tmp_187).valueof();
}
current_location.update_lineno(1640);
/* BTS_Tests.ttcn, line 1640 */
f__rsl__chan__act(RSL__Types::RSL__IE__ChannelMode(const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).chan__mode()), f__rsl__chan__act_encr__enable_defval, addl__ies, RSL__Types::c__RSL__IE__ActType__HO__SYNC);
current_location.update_lineno(1643);
/* BTS_Tests.ttcn, line 1643 */
f__l1ctl__est__dchan(ConnHdlr_component_L1CTL, ConnHdlr_component_g__pars);
current_location.update_lineno(1646);
/* BTS_Tests.ttcn, line 1646 */
f__sacch__missing(OCTETSTRING_template(ANY_VALUE));
current_location.update_lineno(1649);
/* BTS_Tests.ttcn, line 1649 */
L1CTL__PortType::f__L1CTL__RACH(ConnHdlr_component_L1CTL, ho__ref, L1CTL__PortType::f__L1CTL__RACH_combined_defval, L1CTL__PortType::f__L1CTL__RACH_offset_defval, GSM__Types::RslChannelNr_template(const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).chan__nr()), L1CTL__PortType::f__L1CTL__RACH_link__id_defval);
current_location.update_lineno(1651);
/* BTS_Tests.ttcn, line 1651 */
f__sacch__present(OCTETSTRING_template(si5), f__sacch__present_do__fail_defval);
current_location.update_lineno(1653);
/* BTS_Tests.ttcn, line 1653 */
f__rsl__chan__deact();
current_location.update_lineno(1654);
/* BTS_Tests.ttcn, line 1654 */
L1CTL__PortType::f__L1CTL__DM__REL__REQ(ConnHdlr_component_L1CTL, RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr);
current_location.update_lineno(1655);
/* BTS_Tests.ttcn, line 1655 */
L1CTL__PortType::f__L1CTL__RESET(ConnHdlr_component_L1CTL, L1CTL__PortType::f__L1CTL__RESET_res__type_defval);
current_location.update_lineno(1658);
/* BTS_Tests.ttcn, line 1658 */
f__l1__tune(ConnHdlr_component_L1CTL, f__l1__tune_ccch__mode_defval);
current_location.update_lineno(1664);
/* BTS_Tests.ttcn, line 1664 */
addl__ies.set_size(3);
addl__ies[0] = ho__ref__ie;
{
RSL__Types::RSL__IE__Body_template tmp_189;
tmp_189.timing__adv() = 0;
addl__ies[1] = RSL__Types::t__RSL__IE(RSL__Types::RSL__IE__Type::RSL__IE__TIMING__ADVANCE, tmp_189).valueof();
}
{
RSL__Types::RSL__IE__Body_template tmp_190;
tmp_190.ms__power() = RSL__Types::ts__RSL__IE__MS__Power(0, RSL__Types::ts__RSL__IE__MS__Power_fpc__epc_defval);
addl__ies[2] = RSL__Types::t__RSL__IE(RSL__Types::RSL__IE__Type::RSL__IE__MS__POWER, tmp_190).valueof();
}
current_location.update_lineno(1669);
/* BTS_Tests.ttcn, line 1669 */
f__rsl__chan__act(RSL__Types::RSL__IE__ChannelMode(const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).chan__mode()), f__rsl__chan__act_encr__enable_defval, addl__ies, RSL__Types::c__RSL__IE__ActType__HO__SYNC);
current_location.update_lineno(1672);
/* BTS_Tests.ttcn, line 1672 */
f__l1ctl__est__dchan(ConnHdlr_component_L1CTL, ConnHdlr_component_g__pars);
current_location.update_lineno(1675);
/* BTS_Tests.ttcn, line 1675 */
f__sacch__present(OCTETSTRING_template(si5), f__sacch__present_do__fail_defval);
current_location.update_lineno(1678);
/* BTS_Tests.ttcn, line 1678 */
L1CTL__PortType::f__L1CTL__RACH(ConnHdlr_component_L1CTL, ho__ref, L1CTL__PortType::f__L1CTL__RACH_combined_defval, L1CTL__PortType::f__L1CTL__RACH_offset_defval, GSM__Types::RslChannelNr_template(const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).chan__nr()), L1CTL__PortType::f__L1CTL__RACH_link__id_defval);
current_location.update_lineno(1680);
/* BTS_Tests.ttcn, line 1680 */
f__sacch__present(OCTETSTRING_template(si5), f__sacch__present_do__fail_defval);
current_location.update_lineno(1682);
/* BTS_Tests.ttcn, line 1682 */
f__rsl__chan__deact();
current_location.update_lineno(1683);
/* BTS_Tests.ttcn, line 1683 */
L1CTL__PortType::f__L1CTL__DM__REL__REQ(ConnHdlr_component_L1CTL, RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr);
}

void start_f__TC__sacch__chan__act__ho__sync(const COMPONENT& component_reference, const CHARSTRING& id)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_TC_sacch_chan_act_ho_sync(");
id.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_TC_sacch_chan_act_ho_sync", text_buf);
id.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

verdicttype testcase_TC__sacch__chan__act__ho__sync(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests.ttcn", 1685, TTCN_Location::LOCATION_TESTCASE, "TC_sacch_chan_act_ho_sync");
try {
TTCN_Runtime::begin_testcase("BTS_Tests", "TC_sacch_chan_act_ho_sync", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(1686);
/* BTS_Tests.ttcn, line 1686 */
COMPONENT vc__conn;
current_location.update_lineno(1687);
/* BTS_Tests.ttcn, line 1687 */
ConnHdlrPars pars;
current_location.update_lineno(1688);
/* BTS_Tests.ttcn, line 1688 */
f__init(f__init_trx__nr_defval);
{
current_location.update_lineno(1690);
/* BTS_Tests.ttcn, line 1690 */
INTEGER i(0);
current_location.update_lineno(1690);
/* BTS_Tests.ttcn, line 1690 */
for ( ; ; ) {
current_location.update_lineno(1690);
/* BTS_Tests.ttcn, line 1690 */
if (!(i < test__CT_component_g__AllChanTypes.size_of())) break;
current_location.update_lineno(1691);
/* BTS_Tests.ttcn, line 1691 */
pars = t__Pars(GSM__Types::RslChannelNr_template(const_cast< const ChannelNrs&>(test__CT_component_g__AllChanTypes)[i]), RSL__Types::ts__RSL__ChanMode__SIGN(RSL__Types::ts__RSL__ChanMode__SIGN_t_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxd_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxu_defval), t__Pars_spec_defval, t__Pars_trx__nr_defval, t__Pars_t__guard_defval).valueof();
current_location.update_lineno(1692);
/* BTS_Tests.ttcn, line 1692 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("TC_sacch_chan_act_ho_sync: Starting for ");
const_cast< const ChannelNrs&>(test__CT_component_g__AllChanTypes)[i].log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(1693);
/* BTS_Tests.ttcn, line 1693 */
vc__conn = f__start__handler(&f__TC__sacch__chan__act__ho__sync, pars, f__start__handler_pcu__comp_defval, f__start__handler_trxc__comp_defval, f__start__handler_l1ctl_defval);
current_location.update_lineno(1694);
/* BTS_Tests.ttcn, line 1694 */
{
tmp_193:
alt_status alt_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (alt_flag != ALT_NO) {
alt_flag = vc__conn.done(NULL, NULL);
if (alt_flag == ALT_YES) break;
else if (alt_flag == ALT_REPEAT) goto tmp_193;
}
if (default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps(first_run);
if (default_flag == ALT_YES || default_flag == ALT_BREAK) break;
else if (default_flag == ALT_REPEAT) goto tmp_193;
}
current_location.update_lineno(1694);
/* BTS_Tests.ttcn, line 1694 */
if (alt_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("Stand-alone done statement failed in file BTS_Tests.ttcn, line 1694.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(1690);
/* BTS_Tests.ttcn, line 1690 */
{
INTEGER tmp_194;
++i;
}
}
}
current_location.update_lineno(1697);
/* BTS_Tests.ttcn, line 1697 */
Misc__Helpers::f__shutdown(cs_4, 1697, Misc__Helpers::f__shutdown_verdict_defval, Misc__Helpers::f__shutdown_text_defval);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_sacch_chan_act_ho_sync was stopped.");
}
return TTCN_Runtime::end_testcase();
}

void f__TC__rach__content(const BOOLEAN& emerg)
{
TTCN_Location current_location("BTS_Tests.ttcn", 1706, TTCN_Location::LOCATION_FUNCTION, "f_TC_rach_content");
current_location.update_lineno(1707);
/* BTS_Tests.ttcn, line 1707 */
f__init(f__init_trx__nr_defval);
current_location.update_lineno(1708);
/* BTS_Tests.ttcn, line 1708 */
f__init__l1ctl();
current_location.update_lineno(1709);
/* BTS_Tests.ttcn, line 1709 */
f__l1__tune(test__CT_component_L1CTL, f__l1__tune_ccch__mode_defval);
current_location.update_lineno(1711);
/* BTS_Tests.ttcn, line 1711 */
INTEGER fn__last(0);
current_location.update_lineno(1712);
/* BTS_Tests.ttcn, line 1712 */
BOOLEAN test__failed(FALSE);
{
current_location.update_lineno(1713);
/* BTS_Tests.ttcn, line 1713 */
INTEGER i(0);
current_location.update_lineno(1713);
/* BTS_Tests.ttcn, line 1713 */
for ( ; ; ) {
current_location.update_lineno(1713);
/* BTS_Tests.ttcn, line 1713 */
if (!(i < 1000)) break;
current_location.update_lineno(1714);
/* BTS_Tests.ttcn, line 1714 */
OCTETSTRING ra;
current_location.update_lineno(1715);
/* BTS_Tests.ttcn, line 1715 */
if ((emerg == TRUE)) {
current_location.update_lineno(1716);
/* BTS_Tests.ttcn, line 1716 */
ra = Osmocom__Types::f__rnd__ra__emerg();
}
else {
current_location.update_lineno(1718);
/* BTS_Tests.ttcn, line 1718 */
ra = Osmocom__Types::f__rnd__ra__cs();
}
current_location.update_lineno(1720);
/* BTS_Tests.ttcn, line 1720 */
INTEGER fn(L1CTL__PortType::f__L1CTL__RACH(test__CT_component_L1CTL, oct2int(ra), L1CTL__PortType::f__L1CTL__RACH_combined_defval, L1CTL__PortType::f__L1CTL__RACH_offset_defval, L1CTL__PortType::f__L1CTL__RACH_chan__nr_defval, L1CTL__PortType::f__L1CTL__RACH_link__id_defval));
current_location.update_lineno(1721);
/* BTS_Tests.ttcn, line 1721 */
if ((fn == fn__last)) {
current_location.update_lineno(1722);
/* BTS_Tests.ttcn, line 1722 */
Misc__Helpers::f__shutdown(cs_4, 1722, FAIL, cs_33);
}
current_location.update_lineno(1724);
/* BTS_Tests.ttcn, line 1724 */
fn__last = fn;
current_location.update_lineno(1726);
/* BTS_Tests.ttcn, line 1726 */
TIMER T("T", 5.0);
current_location.update_lineno(1727);
/* BTS_Tests.ttcn, line 1727 */
T.start();
current_location.update_lineno(1728);
/* BTS_Tests.ttcn, line 1728 */
{
tmp_198:
alt_status tmp_198_alt_flag_0 = ALT_MAYBE;
alt_status tmp_198_alt_flag_1 = ALT_MAYBE;
alt_status tmp_198_alt_flag_2 = ALT_MAYBE;
alt_status tmp_198_alt_flag_3 = ALT_MAYBE;
alt_status tmp_198_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_198_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(1729);
/* BTS_Tests.ttcn, line 1729 */
tmp_198_alt_flag_0 = test__CT_component_RSL__CCHAN.receive(IPA__Emulation::tr__ASP__RSL__UD(RSL__Types::tr__RSL__CHAN__RQD(OCTETSTRING_template(ra), INTEGER_template(fn), GSM__Types::t__RslChanNr__RACH(INTEGER_template(0)), RSL__Types::tr__RSL__CHAN__RQD_acc__del_defval), IPA__Emulation::tr__ASP__RSL__UD_sid_defval, IPA__Emulation::tr__ASP__RSL__UD_conn__id_defval), NULL, any_compref, NULL, NULL, NULL);
if (tmp_198_alt_flag_0 == ALT_YES) {
current_location.update_lineno(1730);
/* BTS_Tests.ttcn, line 1730 */
T.stop();
break;
}
}
if (tmp_198_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(1732);
/* BTS_Tests.ttcn, line 1732 */
tmp_198_alt_flag_1 = test__CT_component_RSL__CCHAN.receive(IPA__Emulation::tr__ASP__RSL__UD(RSL__Types::tr__RSL__CHAN__RQD(OCTETSTRING_template(ANY_VALUE), INTEGER_template(ANY_VALUE), GSM__Types::RslChannelNr_template(ANY_VALUE), INTEGER_template(ANY_VALUE)), IPA__Emulation::tr__ASP__RSL__UD_sid_defval, IPA__Emulation::tr__ASP__RSL__UD_conn__id_defval), NULL, any_compref, NULL, NULL, NULL);
if (tmp_198_alt_flag_1 == ALT_YES) {
current_location.update_lineno(1733);
/* BTS_Tests.ttcn, line 1733 */
Misc__Helpers::f__shutdown(cs_4, 1733, FAIL, cs_34);
break;
}
}
if (tmp_198_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(1735);
/* BTS_Tests.ttcn, line 1735 */
tmp_198_alt_flag_2 = test__CT_component_RSL__CCHAN.receive(any_compref, NULL, NULL, NULL);
if (tmp_198_alt_flag_2 == ALT_YES) {
current_location.update_lineno(1735);
/* BTS_Tests.ttcn, line 1735 */
goto tmp_198;
}
}
if (tmp_198_alt_flag_3 == ALT_MAYBE) {
current_location.update_lineno(1736);
/* BTS_Tests.ttcn, line 1736 */
tmp_198_alt_flag_3 = T.timeout(NULL);
if (tmp_198_alt_flag_3 == ALT_YES) {
current_location.update_lineno(1737);
/* BTS_Tests.ttcn, line 1737 */
test__failed = TRUE;
current_location.update_lineno(1738);
/* BTS_Tests.ttcn, line 1738 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_char('[');
i.log();
TTCN_Logger::log_event_str("] Timeout waiting for CHAN RQD FN=");
fn.log();
TTCN_Logger::log_event_str(" RA=");
ra.log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
break;
}
}
if (tmp_198_default_flag == ALT_MAYBE) {
tmp_198_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_198_default_flag == ALT_YES || tmp_198_default_flag == ALT_BREAK) break;
else if (tmp_198_default_flag == ALT_REPEAT) goto tmp_198;
}
current_location.update_lineno(1728);
/* BTS_Tests.ttcn, line 1728 */
if (tmp_198_alt_flag_0 == ALT_NO && tmp_198_alt_flag_1 == ALT_NO && tmp_198_alt_flag_2 == ALT_NO && tmp_198_alt_flag_3 == ALT_NO && tmp_198_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file BTS_Tests.ttcn between lines 1728 and 1740.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(1713);
/* BTS_Tests.ttcn, line 1713 */
{
INTEGER tmp_200;
++i;
}
}
}
current_location.update_lineno(1742);
/* BTS_Tests.ttcn, line 1742 */
if (test__failed) {
current_location.update_lineno(1743);
/* BTS_Tests.ttcn, line 1743 */
Misc__Helpers::f__shutdown(cs_4, 1743, FAIL, (TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Some out of 1000 RACH requests timed out"),TTCN_Logger::end_event_log2str()));
}
current_location.update_lineno(1745);
/* BTS_Tests.ttcn, line 1745 */
TTCN_Runtime::setverdict(PASS);
current_location.update_lineno(1746);
/* BTS_Tests.ttcn, line 1746 */
Misc__Helpers::f__shutdown(cs_4, 1746, Misc__Helpers::f__shutdown_verdict_defval, Misc__Helpers::f__shutdown_text_defval);
}

void start_f__TC__rach__content(const COMPONENT& component_reference, const BOOLEAN& emerg)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_TC_rach_content(");
emerg.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_TC_rach_content", text_buf);
emerg.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

verdicttype testcase_TC__rach__content(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests.ttcn", 1750, TTCN_Location::LOCATION_TESTCASE, "TC_rach_content");
try {
TTCN_Runtime::begin_testcase("BTS_Tests", "TC_rach_content", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(1751);
/* BTS_Tests.ttcn, line 1751 */
f__TC__rach__content(FALSE);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_rach_content was stopped.");
}
return TTCN_Runtime::end_testcase();
}

verdicttype testcase_TC__rach__content__emerg(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests.ttcn", 1755, TTCN_Location::LOCATION_TESTCASE, "TC_rach_content_emerg");
try {
TTCN_Runtime::begin_testcase("BTS_Tests", "TC_rach_content_emerg", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(1756);
/* BTS_Tests.ttcn, line 1756 */
f__TC__rach__content(TRUE);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_rach_content_emerg was stopped.");
}
return TTCN_Runtime::end_testcase();
}

verdicttype testcase_TC__rach__count(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests.ttcn", 1760, TTCN_Location::LOCATION_TESTCASE, "TC_rach_count");
try {
TTCN_Runtime::begin_testcase("BTS_Tests", "TC_rach_count", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(1761);
/* BTS_Tests.ttcn, line 1761 */
f__init(f__init_trx__nr_defval);
current_location.update_lineno(1762);
/* BTS_Tests.ttcn, line 1762 */
f__init__l1ctl();
current_location.update_lineno(1763);
/* BTS_Tests.ttcn, line 1763 */
Osmocom__Types::f__sleep(1.0);
current_location.update_lineno(1764);
/* BTS_Tests.ttcn, line 1764 */
f__l1__tune(test__CT_component_L1CTL, f__l1__tune_ccch__mode_defval);
current_location.update_lineno(1766);
/* BTS_Tests.ttcn, line 1766 */
INTEGER fn__last(0);
{
current_location.update_lineno(1767);
/* BTS_Tests.ttcn, line 1767 */
INTEGER i(0);
current_location.update_lineno(1767);
/* BTS_Tests.ttcn, line 1767 */
for ( ; ; ) {
current_location.update_lineno(1767);
/* BTS_Tests.ttcn, line 1767 */
if (!(i < 1000)) break;
current_location.update_lineno(1768);
/* BTS_Tests.ttcn, line 1768 */
OCTETSTRING ra(Osmocom__Types::f__rnd__ra__cs());
current_location.update_lineno(1769);
/* BTS_Tests.ttcn, line 1769 */
INTEGER fn(L1CTL__PortType::f__L1CTL__RACH(test__CT_component_L1CTL, oct2int(ra), L1CTL__PortType::f__L1CTL__RACH_combined_defval, L1CTL__PortType::f__L1CTL__RACH_offset_defval, L1CTL__PortType::f__L1CTL__RACH_chan__nr_defval, L1CTL__PortType::f__L1CTL__RACH_link__id_defval));
current_location.update_lineno(1770);
/* BTS_Tests.ttcn, line 1770 */
if ((fn == fn__last)) {
current_location.update_lineno(1771);
/* BTS_Tests.ttcn, line 1771 */
Misc__Helpers::f__shutdown(cs_4, 1771, FAIL, cs_33);
}
current_location.update_lineno(1773);
/* BTS_Tests.ttcn, line 1773 */
fn__last = fn;
current_location.update_lineno(1767);
/* BTS_Tests.ttcn, line 1767 */
{
INTEGER tmp_202;
++i;
}
}
}
current_location.update_lineno(1775);
/* BTS_Tests.ttcn, line 1775 */
INTEGER rsl__chrqd(0);
current_location.update_lineno(1776);
/* BTS_Tests.ttcn, line 1776 */
TIMER T("T", 3.0);
current_location.update_lineno(1777);
/* BTS_Tests.ttcn, line 1777 */
T.start();
current_location.update_lineno(1778);
/* BTS_Tests.ttcn, line 1778 */
{
tmp_203:
alt_status tmp_203_alt_flag_0 = ALT_MAYBE;
alt_status tmp_203_alt_flag_1 = ALT_MAYBE;
alt_status tmp_203_alt_flag_2 = ALT_MAYBE;
alt_status tmp_203_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_203_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(1779);
/* BTS_Tests.ttcn, line 1779 */
tmp_203_alt_flag_0 = test__CT_component_RSL__CCHAN.receive(IPA__Emulation::tr__ASP__RSL__UD(RSL__Types::tr__RSL__CHAN__RQD(OCTETSTRING_template(ANY_VALUE), INTEGER_template(ANY_VALUE), RSL__Types::tr__RSL__CHAN__RQD_chan__nr_defval, RSL__Types::tr__RSL__CHAN__RQD_acc__del_defval), IPA__Emulation::tr__ASP__RSL__UD_sid_defval, IPA__Emulation::tr__ASP__RSL__UD_conn__id_defval), NULL, any_compref, NULL, NULL, NULL);
if (tmp_203_alt_flag_0 == ALT_YES) {
current_location.update_lineno(1780);
/* BTS_Tests.ttcn, line 1780 */
{
INTEGER tmp_204;
++rsl__chrqd;
}
current_location.update_lineno(1781);
/* BTS_Tests.ttcn, line 1781 */
Osmocom__Types::f__timer__safe__restart(T);
current_location.update_lineno(1782);
/* BTS_Tests.ttcn, line 1782 */
goto tmp_203;
}
}
if (tmp_203_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(1784);
/* BTS_Tests.ttcn, line 1784 */
tmp_203_alt_flag_1 = test__CT_component_RSL__CCHAN.receive(any_compref, NULL, NULL, NULL);
if (tmp_203_alt_flag_1 == ALT_YES) {
current_location.update_lineno(1784);
/* BTS_Tests.ttcn, line 1784 */
goto tmp_203;
}
}
if (tmp_203_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(1785);
/* BTS_Tests.ttcn, line 1785 */
tmp_203_alt_flag_2 = T.timeout(NULL);
if (tmp_203_alt_flag_2 == ALT_YES) break;
}
if (tmp_203_default_flag == ALT_MAYBE) {
tmp_203_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_203_default_flag == ALT_YES || tmp_203_default_flag == ALT_BREAK) break;
else if (tmp_203_default_flag == ALT_REPEAT) goto tmp_203;
}
current_location.update_lineno(1778);
/* BTS_Tests.ttcn, line 1778 */
if (tmp_203_alt_flag_0 == ALT_NO && tmp_203_alt_flag_1 == ALT_NO && tmp_203_alt_flag_2 == ALT_NO && tmp_203_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file BTS_Tests.ttcn between lines 1778 and 1786.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(1787);
/* BTS_Tests.ttcn, line 1787 */
if ((rsl__chrqd == 1000)) {
current_location.update_lineno(1788);
/* BTS_Tests.ttcn, line 1788 */
TTCN_Runtime::setverdict(PASS);
}
else {
current_location.update_lineno(1790);
/* BTS_Tests.ttcn, line 1790 */
Misc__Helpers::f__shutdown(cs_4, 1790, FAIL, (TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Received only "),rsl__chrqd.log(),TTCN_Logger::log_event_str(" out of 1000 RACH"),TTCN_Logger::end_event_log2str()));
}
current_location.update_lineno(1792);
/* BTS_Tests.ttcn, line 1792 */
Misc__Helpers::f__shutdown(cs_4, 1792, Misc__Helpers::f__shutdown_verdict_defval, Misc__Helpers::f__shutdown_text_defval);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_rach_count was stopped.");
}
return TTCN_Runtime::end_testcase();
}

void f__vty__load__ind__thresh(const INTEGER& period, const INTEGER& bts__nr)
{
TTCN_Location current_location("BTS_Tests.ttcn", 1795, TTCN_Location::LOCATION_FUNCTION, "f_vty_load_ind_thresh");
current_location.update_lineno(1796);
/* BTS_Tests.ttcn, line 1796 */
CHARSTRING bts__str((cs_35 + int2str(bts__nr)));
current_location.update_lineno(1797);
/* BTS_Tests.ttcn, line 1797 */
{
Osmocom__VTY__Functions::rof__charstring tmp_205;
tmp_205.set_size(2);
tmp_205[0] = cs_36;
tmp_205[1] = bts__str;
Osmocom__VTY__Functions::f__vty__config2(test__CT_component_BSCVTY, tmp_205, (cs_37 + int2str(period)));
}
}

void start_f__vty__load__ind__thresh(const COMPONENT& component_reference, const INTEGER& period, const INTEGER& bts__nr)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_vty_load_ind_thresh(");
period.log();
TTCN_Logger::log_event_str(", ");
bts__nr.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_vty_load_ind_thresh", text_buf);
period.encode_text(text_buf);
bts__nr.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

verdicttype testcase_TC__rach__load__idle__thresh0(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests.ttcn", 1804, TTCN_Location::LOCATION_TESTCASE, "TC_rach_load_idle_thresh0");
try {
TTCN_Runtime::begin_testcase("BTS_Tests", "TC_rach_load_idle_thresh0", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(1805);
/* BTS_Tests.ttcn, line 1805 */
IPA__Emulation::ASP__RSL__Unitdata rx__ud;
current_location.update_lineno(1807);
/* BTS_Tests.ttcn, line 1807 */
f__init__vty__bsc();
current_location.update_lineno(1809);
/* BTS_Tests.ttcn, line 1809 */
f__vty__load__ind__thresh(0, f__vty__load__ind__thresh_bts__nr_defval);
current_location.update_lineno(1810);
/* BTS_Tests.ttcn, line 1810 */
Osmocom__VTY__Functions::f__vty__transceive(test__CT_component_BSCVTY, cs_38, Osmocom__VTY__Functions::f__vty__transceive_strict_defval);
current_location.update_lineno(1811);
/* BTS_Tests.ttcn, line 1811 */
Osmocom__Types::f__sleep(2.0);
current_location.update_lineno(1813);
/* BTS_Tests.ttcn, line 1813 */
f__init(f__init_trx__nr_defval);
current_location.update_lineno(1816);
/* BTS_Tests.ttcn, line 1816 */
{
tmp_206:
alt_status tmp_206_alt_flag_0 = ALT_MAYBE;
alt_status tmp_206_alt_flag_1 = ALT_MAYBE;
alt_status tmp_206_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_206_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(1817);
/* BTS_Tests.ttcn, line 1817 */
tmp_206_alt_flag_0 = test__CT_component_RSL__CCHAN.receive(IPA__Emulation::tr__ASP__RSL__UD(RSL__Types::tr__RSL__RACH__LOAD__IND(INTEGER_template(ANY_VALUE), INTEGER_template(ANY_VALUE), INTEGER_template(ANY_VALUE)), IPA__Emulation::tr__ASP__RSL__UD_sid_defval, IPA__Emulation::tr__ASP__RSL__UD_conn__id_defval), NULL, any_compref, NULL, NULL, NULL);
if (tmp_206_alt_flag_0 == ALT_YES) break;
}
if (tmp_206_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(1818);
/* BTS_Tests.ttcn, line 1818 */
tmp_206_alt_flag_1 = test__CT_component_RSL__CCHAN.receive(any_compref, NULL, NULL, NULL);
if (tmp_206_alt_flag_1 == ALT_YES) {
current_location.update_lineno(1818);
/* BTS_Tests.ttcn, line 1818 */
goto tmp_206;
}
}
if (tmp_206_default_flag == ALT_MAYBE) {
tmp_206_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_206_default_flag == ALT_YES || tmp_206_default_flag == ALT_BREAK) break;
else if (tmp_206_default_flag == ALT_REPEAT) goto tmp_206;
}
current_location.update_lineno(1816);
/* BTS_Tests.ttcn, line 1816 */
if (tmp_206_alt_flag_0 == ALT_NO && tmp_206_alt_flag_1 == ALT_NO && tmp_206_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file BTS_Tests.ttcn between lines 1816 and 1819.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(1821);
/* BTS_Tests.ttcn, line 1821 */
TIMER T("T", 5.0);
current_location.update_lineno(1822);
/* BTS_Tests.ttcn, line 1822 */
T.start();
current_location.update_lineno(1823);
/* BTS_Tests.ttcn, line 1823 */
{
tmp_207:
alt_status tmp_207_alt_flag_0 = ALT_MAYBE;
alt_status tmp_207_alt_flag_1 = ALT_MAYBE;
alt_status tmp_207_alt_flag_2 = ALT_MAYBE;
alt_status tmp_207_alt_flag_3 = ALT_MAYBE;
alt_status tmp_207_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_207_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(1824);
/* BTS_Tests.ttcn, line 1824 */
tmp_207_alt_flag_0 = test__CT_component_RSL__CCHAN.receive(IPA__Emulation::tr__ASP__RSL__UD(RSL__Types::tr__RSL__RACH__LOAD__IND(tr__rach__slots__per__interval, INTEGER_template(0), INTEGER_template(0)), IPA__Emulation::tr__ASP__RSL__UD_sid_defval, IPA__Emulation::tr__ASP__RSL__UD_conn__id_defval), NULL, any_compref, NULL, NULL, NULL);
if (tmp_207_alt_flag_0 == ALT_YES) {
current_location.update_lineno(1825);
/* BTS_Tests.ttcn, line 1825 */
TTCN_Runtime::setverdict(PASS);
current_location.update_lineno(1826);
/* BTS_Tests.ttcn, line 1826 */
goto tmp_207;
}
}
if (tmp_207_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(1828);
/* BTS_Tests.ttcn, line 1828 */
tmp_207_alt_flag_1 = test__CT_component_RSL__CCHAN.receive(IPA__Emulation::tr__ASP__RSL__UD(RSL__Types::tr__RSL__RACH__LOAD__IND(INTEGER_template(ANY_VALUE), INTEGER_template(ANY_VALUE), INTEGER_template(ANY_VALUE)), IPA__Emulation::tr__ASP__RSL__UD_sid_defval, IPA__Emulation::tr__ASP__RSL__UD_conn__id_defval), &(rx__ud), any_compref, NULL, NULL, NULL);
if (tmp_207_alt_flag_1 == ALT_YES) {
current_location.update_lineno(1829);
/* BTS_Tests.ttcn, line 1829 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Unexpected RACH LOAD IND: "),rx__ud.log(),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(1830);
/* BTS_Tests.ttcn, line 1830 */
goto tmp_207;
}
}
if (tmp_207_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(1832);
/* BTS_Tests.ttcn, line 1832 */
tmp_207_alt_flag_2 = test__CT_component_RSL__CCHAN.receive(any_compref, NULL, NULL, NULL);
if (tmp_207_alt_flag_2 == ALT_YES) {
current_location.update_lineno(1833);
/* BTS_Tests.ttcn, line 1833 */
goto tmp_207;
}
}
if (tmp_207_alt_flag_3 == ALT_MAYBE) {
current_location.update_lineno(1835);
/* BTS_Tests.ttcn, line 1835 */
tmp_207_alt_flag_3 = T.timeout(NULL);
if (tmp_207_alt_flag_3 == ALT_YES) break;
}
if (tmp_207_default_flag == ALT_MAYBE) {
tmp_207_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_207_default_flag == ALT_YES || tmp_207_default_flag == ALT_BREAK) break;
else if (tmp_207_default_flag == ALT_REPEAT) goto tmp_207;
}
current_location.update_lineno(1823);
/* BTS_Tests.ttcn, line 1823 */
if (tmp_207_alt_flag_0 == ALT_NO && tmp_207_alt_flag_1 == ALT_NO && tmp_207_alt_flag_2 == ALT_NO && tmp_207_alt_flag_3 == ALT_NO && tmp_207_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file BTS_Tests.ttcn between lines 1823 and 1836.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(1838);
/* BTS_Tests.ttcn, line 1838 */
f__vty__load__ind__thresh(10, f__vty__load__ind__thresh_bts__nr_defval);
current_location.update_lineno(1839);
/* BTS_Tests.ttcn, line 1839 */
Misc__Helpers::f__shutdown(cs_4, 1839, Misc__Helpers::f__shutdown_verdict_defval, Misc__Helpers::f__shutdown_text_defval);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_rach_load_idle_thresh0 was stopped.");
}
return TTCN_Runtime::end_testcase();
}

verdicttype testcase_TC__rach__load__idle__below__thresh(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests.ttcn", 1843, TTCN_Location::LOCATION_TESTCASE, "TC_rach_load_idle_below_thresh");
try {
TTCN_Runtime::begin_testcase("BTS_Tests", "TC_rach_load_idle_below_thresh", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(1844);
/* BTS_Tests.ttcn, line 1844 */
IPA__Emulation::ASP__RSL__Unitdata rx__ud;
current_location.update_lineno(1846);
/* BTS_Tests.ttcn, line 1846 */
f__init__vty__bsc();
current_location.update_lineno(1847);
/* BTS_Tests.ttcn, line 1847 */
f__init(f__init_trx__nr_defval);
current_location.update_lineno(1849);
/* BTS_Tests.ttcn, line 1849 */
TIMER T("T", 5.0);
current_location.update_lineno(1850);
/* BTS_Tests.ttcn, line 1850 */
T.start();
current_location.update_lineno(1851);
/* BTS_Tests.ttcn, line 1851 */
{
tmp_208:
alt_status tmp_208_alt_flag_0 = ALT_MAYBE;
alt_status tmp_208_alt_flag_1 = ALT_MAYBE;
alt_status tmp_208_alt_flag_2 = ALT_MAYBE;
alt_status tmp_208_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_208_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(1852);
/* BTS_Tests.ttcn, line 1852 */
tmp_208_alt_flag_0 = test__CT_component_RSL__CCHAN.receive(IPA__Emulation::tr__ASP__RSL__UD(RSL__Types::tr__RSL__RACH__LOAD__IND(INTEGER_template(ANY_VALUE), INTEGER_template(ANY_VALUE), INTEGER_template(ANY_VALUE)), IPA__Emulation::tr__ASP__RSL__UD_sid_defval, IPA__Emulation::tr__ASP__RSL__UD_conn__id_defval), &(rx__ud), any_compref, NULL, NULL, NULL);
if (tmp_208_alt_flag_0 == ALT_YES) {
current_location.update_lineno(1853);
/* BTS_Tests.ttcn, line 1853 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Unexpected RACH LOAD IND: "),rx__ud.log(),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(1854);
/* BTS_Tests.ttcn, line 1854 */
goto tmp_208;
}
}
if (tmp_208_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(1856);
/* BTS_Tests.ttcn, line 1856 */
tmp_208_alt_flag_1 = test__CT_component_RSL__CCHAN.receive(any_compref, NULL, NULL, NULL);
if (tmp_208_alt_flag_1 == ALT_YES) {
current_location.update_lineno(1857);
/* BTS_Tests.ttcn, line 1857 */
goto tmp_208;
}
}
if (tmp_208_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(1859);
/* BTS_Tests.ttcn, line 1859 */
tmp_208_alt_flag_2 = T.timeout(NULL);
if (tmp_208_alt_flag_2 == ALT_YES) {
current_location.update_lineno(1860);
/* BTS_Tests.ttcn, line 1860 */
TTCN_Runtime::setverdict(PASS);
break;
}
}
if (tmp_208_default_flag == ALT_MAYBE) {
tmp_208_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_208_default_flag == ALT_YES || tmp_208_default_flag == ALT_BREAK) break;
else if (tmp_208_default_flag == ALT_REPEAT) goto tmp_208;
}
current_location.update_lineno(1851);
/* BTS_Tests.ttcn, line 1851 */
if (tmp_208_alt_flag_0 == ALT_NO && tmp_208_alt_flag_1 == ALT_NO && tmp_208_alt_flag_2 == ALT_NO && tmp_208_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file BTS_Tests.ttcn between lines 1851 and 1862.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(1864);
/* BTS_Tests.ttcn, line 1864 */
Misc__Helpers::f__shutdown(cs_4, 1864, Misc__Helpers::f__shutdown_verdict_defval, Misc__Helpers::f__shutdown_text_defval);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_rach_load_idle_below_thresh was stopped.");
}
return TTCN_Runtime::end_testcase();
}

verdicttype testcase_TC__rach__load__count(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests.ttcn", 1868, TTCN_Location::LOCATION_TESTCASE, "TC_rach_load_count");
try {
TTCN_Runtime::begin_testcase("BTS_Tests", "TC_rach_load_count", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(1869);
/* BTS_Tests.ttcn, line 1869 */
IPA__Emulation::ASP__RSL__Unitdata rx__ud;
current_location.update_lineno(1870);
/* BTS_Tests.ttcn, line 1870 */
INTEGER load__access__count(0);
current_location.update_lineno(1872);
/* BTS_Tests.ttcn, line 1872 */
f__init__vty__bsc();
current_location.update_lineno(1874);
/* BTS_Tests.ttcn, line 1874 */
f__vty__load__ind__thresh(0, f__vty__load__ind__thresh_bts__nr_defval);
current_location.update_lineno(1875);
/* BTS_Tests.ttcn, line 1875 */
Osmocom__VTY__Functions::f__vty__transceive(test__CT_component_BSCVTY, cs_38, Osmocom__VTY__Functions::f__vty__transceive_strict_defval);
current_location.update_lineno(1876);
/* BTS_Tests.ttcn, line 1876 */
Osmocom__Types::f__sleep(2.0);
current_location.update_lineno(1877);
/* BTS_Tests.ttcn, line 1877 */
f__init(f__init_trx__nr_defval);
current_location.update_lineno(1879);
/* BTS_Tests.ttcn, line 1879 */
f__init__l1ctl();
current_location.update_lineno(1880);
/* BTS_Tests.ttcn, line 1880 */
Osmocom__Types::f__sleep(1.0);
current_location.update_lineno(1881);
/* BTS_Tests.ttcn, line 1881 */
f__l1__tune(test__CT_component_L1CTL, f__l1__tune_ccch__mode_defval);
current_location.update_lineno(1884);
/* BTS_Tests.ttcn, line 1884 */
{
tmp_209:
alt_status tmp_209_alt_flag_0 = ALT_MAYBE;
alt_status tmp_209_alt_flag_1 = ALT_MAYBE;
alt_status tmp_209_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_209_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(1885);
/* BTS_Tests.ttcn, line 1885 */
tmp_209_alt_flag_0 = test__CT_component_RSL__CCHAN.receive(IPA__Emulation::tr__ASP__RSL__UD(RSL__Types::tr__RSL__RACH__LOAD__IND(INTEGER_template(ANY_VALUE), INTEGER_template(ANY_VALUE), INTEGER_template(ANY_VALUE)), IPA__Emulation::tr__ASP__RSL__UD_sid_defval, IPA__Emulation::tr__ASP__RSL__UD_conn__id_defval), NULL, any_compref, NULL, NULL, NULL);
if (tmp_209_alt_flag_0 == ALT_YES) break;
}
if (tmp_209_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(1886);
/* BTS_Tests.ttcn, line 1886 */
tmp_209_alt_flag_1 = test__CT_component_RSL__CCHAN.receive(any_compref, NULL, NULL, NULL);
if (tmp_209_alt_flag_1 == ALT_YES) {
current_location.update_lineno(1886);
/* BTS_Tests.ttcn, line 1886 */
goto tmp_209;
}
}
if (tmp_209_default_flag == ALT_MAYBE) {
tmp_209_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_209_default_flag == ALT_YES || tmp_209_default_flag == ALT_BREAK) break;
else if (tmp_209_default_flag == ALT_REPEAT) goto tmp_209;
}
current_location.update_lineno(1884);
/* BTS_Tests.ttcn, line 1884 */
if (tmp_209_alt_flag_0 == ALT_NO && tmp_209_alt_flag_1 == ALT_NO && tmp_209_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file BTS_Tests.ttcn between lines 1884 and 1887.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(1889);
/* BTS_Tests.ttcn, line 1889 */
INTEGER fn__last(0);
{
current_location.update_lineno(1890);
/* BTS_Tests.ttcn, line 1890 */
INTEGER i(0);
current_location.update_lineno(1890);
/* BTS_Tests.ttcn, line 1890 */
for ( ; ; ) {
current_location.update_lineno(1890);
/* BTS_Tests.ttcn, line 1890 */
if (!(i < 1000)) break;
current_location.update_lineno(1891);
/* BTS_Tests.ttcn, line 1891 */
OCTETSTRING ra(Osmocom__Types::f__rnd__ra__cs());
current_location.update_lineno(1892);
/* BTS_Tests.ttcn, line 1892 */
INTEGER fn(L1CTL__PortType::f__L1CTL__RACH(test__CT_component_L1CTL, oct2int(ra), L1CTL__PortType::f__L1CTL__RACH_combined_defval, L1CTL__PortType::f__L1CTL__RACH_offset_defval, L1CTL__PortType::f__L1CTL__RACH_chan__nr_defval, L1CTL__PortType::f__L1CTL__RACH_link__id_defval));
current_location.update_lineno(1893);
/* BTS_Tests.ttcn, line 1893 */
if ((fn == fn__last)) {
current_location.update_lineno(1894);
/* BTS_Tests.ttcn, line 1894 */
Misc__Helpers::f__shutdown(cs_4, 1894, FAIL, cs_33);
}
current_location.update_lineno(1896);
/* BTS_Tests.ttcn, line 1896 */
fn__last = fn;
current_location.update_lineno(1890);
/* BTS_Tests.ttcn, line 1890 */
{
INTEGER tmp_211;
++i;
}
}
}
current_location.update_lineno(1899);
/* BTS_Tests.ttcn, line 1899 */
TIMER T("T", 5.0);
current_location.update_lineno(1900);
/* BTS_Tests.ttcn, line 1900 */
T.start();
current_location.update_lineno(1901);
/* BTS_Tests.ttcn, line 1901 */
{
tmp_212:
alt_status tmp_212_alt_flag_0 = ALT_MAYBE;
alt_status tmp_212_alt_flag_1 = ALT_MAYBE;
alt_status tmp_212_alt_flag_2 = ALT_MAYBE;
alt_status tmp_212_alt_flag_3 = ALT_MAYBE;
alt_status tmp_212_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_212_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(1902);
/* BTS_Tests.ttcn, line 1902 */
tmp_212_alt_flag_0 = test__CT_component_RSL__CCHAN.receive(IPA__Emulation::tr__ASP__RSL__UD(RSL__Types::tr__RSL__RACH__LOAD__IND(tr__rach__slots__per__interval, INTEGER_template(ANY_VALUE), INTEGER_template(ANY_VALUE)), IPA__Emulation::tr__ASP__RSL__UD_sid_defval, IPA__Emulation::tr__ASP__RSL__UD_conn__id_defval), &(rx__ud), any_compref, NULL, NULL, NULL);
if (tmp_212_alt_flag_0 == ALT_YES) {
current_location.update_lineno(1904);
/* BTS_Tests.ttcn, line 1904 */
RSL__Types::RSL__IE__Body ie;
current_location.update_lineno(1905);
/* BTS_Tests.ttcn, line 1905 */
{
RSL__Types::RSL__IE__Body tmp_213;
RSL__Types::f__rsl__find__ie(const_cast< const IPA__Emulation::ASP__RSL__Unitdata&>(rx__ud).rsl(), RSL__Types::RSL__IE__Type::RSL__IE__RACH__LOAD, tmp_213);
if (tmp_213.is_bound()) ie = tmp_213;
}
current_location.update_lineno(1906);
/* BTS_Tests.ttcn, line 1906 */
{
INTEGER tmp_214;
tmp_214 = (load__access__count + const_cast< const RSL__Types::RSL__IE__Body&>(ie).rach__load().access__count());
load__access__count = tmp_214;
}
current_location.update_lineno(1907);
/* BTS_Tests.ttcn, line 1907 */
if ((const_cast< const RSL__Types::RSL__IE__Body&>(ie).rach__load().busy__count() < const_cast< const RSL__Types::RSL__IE__Body&>(ie).rach__load().access__count())) {
current_location.update_lineno(1908);
/* BTS_Tests.ttcn, line 1908 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Access count cannot be < Busy count"),TTCN_Logger::end_event_log2str()));
}
current_location.update_lineno(1910);
/* BTS_Tests.ttcn, line 1910 */
goto tmp_212;
}
}
if (tmp_212_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(1912);
/* BTS_Tests.ttcn, line 1912 */
tmp_212_alt_flag_1 = test__CT_component_RSL__CCHAN.receive(IPA__Emulation::tr__ASP__RSL__UD(RSL__Types::tr__RSL__RACH__LOAD__IND(INTEGER_template(ANY_VALUE), INTEGER_template(ANY_VALUE), INTEGER_template(ANY_VALUE)), IPA__Emulation::tr__ASP__RSL__UD_sid_defval, IPA__Emulation::tr__ASP__RSL__UD_conn__id_defval), &(rx__ud), any_compref, NULL, NULL, NULL);
if (tmp_212_alt_flag_1 == ALT_YES) {
current_location.update_lineno(1913);
/* BTS_Tests.ttcn, line 1913 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Unexpected RACH LOAD IND: "),rx__ud.log(),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(1914);
/* BTS_Tests.ttcn, line 1914 */
goto tmp_212;
}
}
if (tmp_212_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(1916);
/* BTS_Tests.ttcn, line 1916 */
tmp_212_alt_flag_2 = test__CT_component_RSL__CCHAN.receive(any_compref, NULL, NULL, NULL);
if (tmp_212_alt_flag_2 == ALT_YES) {
current_location.update_lineno(1917);
/* BTS_Tests.ttcn, line 1917 */
goto tmp_212;
}
}
if (tmp_212_alt_flag_3 == ALT_MAYBE) {
current_location.update_lineno(1919);
/* BTS_Tests.ttcn, line 1919 */
tmp_212_alt_flag_3 = T.timeout(NULL);
if (tmp_212_alt_flag_3 == ALT_YES) break;
}
if (tmp_212_default_flag == ALT_MAYBE) {
tmp_212_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_212_default_flag == ALT_YES || tmp_212_default_flag == ALT_BREAK) break;
else if (tmp_212_default_flag == ALT_REPEAT) goto tmp_212;
}
current_location.update_lineno(1901);
/* BTS_Tests.ttcn, line 1901 */
if (tmp_212_alt_flag_0 == ALT_NO && tmp_212_alt_flag_1 == ALT_NO && tmp_212_alt_flag_2 == ALT_NO && tmp_212_alt_flag_3 == ALT_NO && tmp_212_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file BTS_Tests.ttcn between lines 1901 and 1920.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(1921);
/* BTS_Tests.ttcn, line 1921 */
if ((load__access__count == 1000)) {
current_location.update_lineno(1922);
/* BTS_Tests.ttcn, line 1922 */
TTCN_Runtime::setverdict(PASS);
}
else {
current_location.update_lineno(1924);
/* BTS_Tests.ttcn, line 1924 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Load reports state "),load__access__count.log(),TTCN_Logger::log_event_str(" RACH, but we sent 1000"),TTCN_Logger::end_event_log2str()));
}
current_location.update_lineno(1927);
/* BTS_Tests.ttcn, line 1927 */
f__vty__load__ind__thresh(10, f__vty__load__ind__thresh_bts__nr_defval);
current_location.update_lineno(1928);
/* BTS_Tests.ttcn, line 1928 */
Misc__Helpers::f__shutdown(cs_4, 1928, Misc__Helpers::f__shutdown_verdict_defval, Misc__Helpers::f__shutdown_text_defval);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_rach_load_count was stopped.");
}
return TTCN_Runtime::end_testcase();
}

void f__rach__toffs(const INTEGER& toffs256, const BOOLEAN& expect__pass)
{
TTCN_Location current_location("BTS_Tests.ttcn", 1931, TTCN_Location::LOCATION_FUNCTION, "f_rach_toffs");
current_location.update_lineno(1932);
/* BTS_Tests.ttcn, line 1932 */
TRXC__Types::TrxcMessage ret;
current_location.update_lineno(1934);
/* BTS_Tests.ttcn, line 1934 */
ret = TRXC__CodecPort::f__TRXC__transceive(test__CT_component_BTS__TRXC, test__CT_component_g__bts__trxc__conn__id, TRXC__Types::ts__TRXC__FAKE__TIMING(toffs256, TRXC__Types::ts__TRXC__FAKE__TIMING_thresh_defval), TRXC__CodecPort::f__TRXC__transceive_tr_defval);
current_location.update_lineno(1935);
/* BTS_Tests.ttcn, line 1935 */
Osmocom__Types::f__sleep(5.0e-1);
current_location.update_lineno(1938);
/* BTS_Tests.ttcn, line 1938 */
OCTETSTRING ra(Osmocom__Types::f__rnd__ra__cs());
current_location.update_lineno(1939);
/* BTS_Tests.ttcn, line 1939 */
INTEGER fn(L1CTL__PortType::f__L1CTL__RACH(test__CT_component_L1CTL, oct2int(ra), L1CTL__PortType::f__L1CTL__RACH_combined_defval, L1CTL__PortType::f__L1CTL__RACH_offset_defval, L1CTL__PortType::f__L1CTL__RACH_chan__nr_defval, L1CTL__PortType::f__L1CTL__RACH_link__id_defval));
current_location.update_lineno(1942);
/* BTS_Tests.ttcn, line 1942 */
TIMER T("T", 1.5);
current_location.update_lineno(1943);
/* BTS_Tests.ttcn, line 1943 */
T.start();
current_location.update_lineno(1944);
/* BTS_Tests.ttcn, line 1944 */
{
tmp_216:
alt_status tmp_216_alt_flag_0 = ALT_UNCHECKED;
alt_status tmp_216_alt_flag_1 = ALT_UNCHECKED;
alt_status tmp_216_alt_flag_2 = ALT_MAYBE;
alt_status tmp_216_alt_flag_3 = ALT_UNCHECKED;
alt_status tmp_216_alt_flag_4 = ALT_UNCHECKED;
alt_status tmp_216_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_216_alt_flag_0 == ALT_UNCHECKED) {
current_location.update_lineno(1945);
/* BTS_Tests.ttcn, line 1945 */
if (expect__pass) tmp_216_alt_flag_0 = ALT_MAYBE;
else tmp_216_alt_flag_0 = ALT_NO;
}
if (tmp_216_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(1945);
/* BTS_Tests.ttcn, line 1945 */
tmp_216_alt_flag_0 = test__CT_component_RSL__CCHAN.receive(IPA__Emulation::tr__ASP__RSL__UD(RSL__Types::tr__RSL__CHAN__RQD(OCTETSTRING_template(ra), INTEGER_template(fn), RSL__Types::tr__RSL__CHAN__RQD_chan__nr_defval, RSL__Types::tr__RSL__CHAN__RQD_acc__del_defval), IPA__Emulation::tr__ASP__RSL__UD_sid_defval, IPA__Emulation::tr__ASP__RSL__UD_conn__id_defval), NULL, any_compref, NULL, NULL, NULL);
if (tmp_216_alt_flag_0 == ALT_YES) {
current_location.update_lineno(1946);
/* BTS_Tests.ttcn, line 1946 */
TTCN_Runtime::setverdict(PASS);
break;
}
}
if (tmp_216_alt_flag_1 == ALT_UNCHECKED) {
current_location.update_lineno(1948);
/* BTS_Tests.ttcn, line 1948 */
if ((!(expect__pass))) tmp_216_alt_flag_1 = ALT_MAYBE;
else tmp_216_alt_flag_1 = ALT_NO;
}
if (tmp_216_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(1948);
/* BTS_Tests.ttcn, line 1948 */
tmp_216_alt_flag_1 = test__CT_component_RSL__CCHAN.receive(IPA__Emulation::tr__ASP__RSL__UD(RSL__Types::tr__RSL__CHAN__RQD(OCTETSTRING_template(ra), INTEGER_template(fn), RSL__Types::tr__RSL__CHAN__RQD_chan__nr_defval, RSL__Types::tr__RSL__CHAN__RQD_acc__del_defval), IPA__Emulation::tr__ASP__RSL__UD_sid_defval, IPA__Emulation::tr__ASP__RSL__UD_conn__id_defval), NULL, any_compref, NULL, NULL, NULL);
if (tmp_216_alt_flag_1 == ALT_YES) {
current_location.update_lineno(1949);
/* BTS_Tests.ttcn, line 1949 */
Misc__Helpers::f__shutdown(cs_4, 1949, FAIL, (TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("RACH passed but was expected to be dropped: "),toffs256.log(),TTCN_Logger::end_event_log2str()));
break;
}
}
if (tmp_216_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(1951);
/* BTS_Tests.ttcn, line 1951 */
tmp_216_alt_flag_2 = test__CT_component_RSL__CCHAN.receive(any_compref, NULL, NULL, NULL);
if (tmp_216_alt_flag_2 == ALT_YES) {
current_location.update_lineno(1951);
/* BTS_Tests.ttcn, line 1951 */
goto tmp_216;
}
}
if (tmp_216_alt_flag_3 == ALT_UNCHECKED) {
current_location.update_lineno(1952);
/* BTS_Tests.ttcn, line 1952 */
if ((!(expect__pass))) tmp_216_alt_flag_3 = ALT_MAYBE;
else tmp_216_alt_flag_3 = ALT_NO;
}
if (tmp_216_alt_flag_3 == ALT_MAYBE) {
current_location.update_lineno(1952);
/* BTS_Tests.ttcn, line 1952 */
tmp_216_alt_flag_3 = T.timeout(NULL);
if (tmp_216_alt_flag_3 == ALT_YES) {
current_location.update_lineno(1953);
/* BTS_Tests.ttcn, line 1953 */
TTCN_Runtime::setverdict(PASS);
break;
}
}
if (tmp_216_alt_flag_4 == ALT_UNCHECKED) {
current_location.update_lineno(1955);
/* BTS_Tests.ttcn, line 1955 */
if (expect__pass) tmp_216_alt_flag_4 = ALT_MAYBE;
else tmp_216_alt_flag_4 = ALT_NO;
}
if (tmp_216_alt_flag_4 == ALT_MAYBE) {
current_location.update_lineno(1955);
/* BTS_Tests.ttcn, line 1955 */
tmp_216_alt_flag_4 = T.timeout(NULL);
if (tmp_216_alt_flag_4 == ALT_YES) {
current_location.update_lineno(1956);
/* BTS_Tests.ttcn, line 1956 */
Misc__Helpers::f__shutdown(cs_4, 1956, FAIL, (TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Timeout waiting for CHAN RQD: FN="),fn.log(),TTCN_Logger::log_event_str(" RA="),ra.log(),TTCN_Logger::end_event_log2str()));
break;
}
}
if (tmp_216_default_flag == ALT_MAYBE) {
tmp_216_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_216_default_flag == ALT_YES || tmp_216_default_flag == ALT_BREAK) break;
else if (tmp_216_default_flag == ALT_REPEAT) goto tmp_216;
}
current_location.update_lineno(1944);
/* BTS_Tests.ttcn, line 1944 */
if (tmp_216_alt_flag_0 == ALT_NO && tmp_216_alt_flag_1 == ALT_NO && tmp_216_alt_flag_2 == ALT_NO && tmp_216_alt_flag_3 == ALT_NO && tmp_216_alt_flag_4 == ALT_NO && tmp_216_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file BTS_Tests.ttcn between lines 1944 and 1958.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
}

void start_f__rach__toffs(const COMPONENT& component_reference, const INTEGER& toffs256, const BOOLEAN& expect__pass)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_rach_toffs(");
toffs256.log();
TTCN_Logger::log_event_str(", ");
expect__pass.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_rach_toffs", text_buf);
toffs256.encode_text(text_buf);
expect__pass.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

verdicttype testcase_TC__rach__max__ta(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests.ttcn", 1962, TTCN_Location::LOCATION_TESTCASE, "TC_rach_max_ta");
try {
TTCN_Runtime::begin_testcase("BTS_Tests", "TC_rach_max_ta", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(1963);
/* BTS_Tests.ttcn, line 1963 */
f__init(f__init_trx__nr_defval);
current_location.update_lineno(1964);
/* BTS_Tests.ttcn, line 1964 */
f__init__l1ctl();
current_location.update_lineno(1965);
/* BTS_Tests.ttcn, line 1965 */
f__l1__tune(test__CT_component_L1CTL, f__l1__tune_ccch__mode_defval);
current_location.update_lineno(1966);
/* BTS_Tests.ttcn, line 1966 */
Osmocom__Types::f__sleep(1.0);
current_location.update_lineno(1971);
/* BTS_Tests.ttcn, line 1971 */
f__rach__toffs(-256, TRUE);
current_location.update_lineno(1972);
/* BTS_Tests.ttcn, line 1972 */
f__rach__toffs(-512, TRUE);
current_location.update_lineno(1973);
/* BTS_Tests.ttcn, line 1973 */
f__rach__toffs(-2560, FALSE);
current_location.update_lineno(1976);
/* BTS_Tests.ttcn, line 1976 */
f__rach__toffs(0, TRUE);
current_location.update_lineno(1977);
/* BTS_Tests.ttcn, line 1977 */
f__rach__toffs(8192, TRUE);
current_location.update_lineno(1978);
/* BTS_Tests.ttcn, line 1978 */
f__rach__toffs(16128, TRUE);
current_location.update_lineno(1981);
/* BTS_Tests.ttcn, line 1981 */
f__rach__toffs(16384, FALSE);
current_location.update_lineno(1982);
/* BTS_Tests.ttcn, line 1982 */
f__rach__toffs(32512, FALSE);
current_location.update_lineno(1983);
/* BTS_Tests.ttcn, line 1983 */
Misc__Helpers::f__shutdown(cs_4, 1983, Misc__Helpers::f__shutdown_verdict_defval, Misc__Helpers::f__shutdown_text_defval);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_rach_max_ta was stopped.");
}
return TTCN_Runtime::end_testcase();
}

void f__TC__ho__rach(const CHARSTRING& )
{
TTCN_Location current_location("BTS_Tests.ttcn", 1986, TTCN_Location::LOCATION_FUNCTION, "f_TC_ho_rach");
current_location.update_lineno(1987);
/* BTS_Tests.ttcn, line 1987 */
INTEGER fn;
current_location.update_lineno(1988);
/* BTS_Tests.ttcn, line 1988 */
RSL__Types::RSL__Message rm;
current_location.update_lineno(1990);
/* BTS_Tests.ttcn, line 1990 */
f__l1__tune(ConnHdlr_component_L1CTL, f__l1__tune_ccch__mode_defval);
current_location.update_lineno(1991);
/* BTS_Tests.ttcn, line 1991 */
RSL__Emulation::RSL__DchanHdlr_component_RSL.clear();
current_location.update_lineno(1994);
/* BTS_Tests.ttcn, line 1994 */
INTEGER ho__ref(oct2int(Osmocom__Types::f__rnd__octstring(1)));
current_location.update_lineno(1997);
/* BTS_Tests.ttcn, line 1997 */
RSL__Types::RSL__IE ho__ref__ie;
{
RSL__Types::RSL__IE__Body_template tmp_217;
tmp_217.handover__ref() = ho__ref;
ho__ref__ie = RSL__Types::t__RSL__IE(RSL__Types::RSL__IE__Type::RSL__IE__HANDO__REF, tmp_217).valueof();
}
current_location.update_lineno(2001);
/* BTS_Tests.ttcn, line 2001 */
{
RSL__Types::RSL__IE__List tmp_218;
tmp_218.set_size(1);
tmp_218[0] = ho__ref__ie;
f__rsl__chan__act(RSL__Types::RSL__IE__ChannelMode(const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).chan__mode()), f__rsl__chan__act_encr__enable_defval, tmp_218, RSL__Types::c__RSL__IE__ActType__HO__SYNC);
}
current_location.update_lineno(2006);
/* BTS_Tests.ttcn, line 2006 */
f__l1ctl__est__dchan(ConnHdlr_component_L1CTL, ConnHdlr_component_g__pars);
current_location.update_lineno(2009);
/* BTS_Tests.ttcn, line 2009 */
fn = L1CTL__PortType::f__L1CTL__RACH(ConnHdlr_component_L1CTL, ho__ref, L1CTL__PortType::f__L1CTL__RACH_combined_defval, L1CTL__PortType::f__L1CTL__RACH_offset_defval, GSM__Types::RslChannelNr_template(const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).chan__nr()), L1CTL__PortType::f__L1CTL__RACH_link__id_defval);
current_location.update_lineno(2014);
/* BTS_Tests.ttcn, line 2014 */
TIMER T("T", 3.0);
current_location.update_lineno(2015);
/* BTS_Tests.ttcn, line 2015 */
T.start();
current_location.update_lineno(2016);
/* BTS_Tests.ttcn, line 2016 */
{
tmp_220:
alt_status tmp_220_alt_flag_0 = ALT_MAYBE;
alt_status tmp_220_alt_flag_1 = ALT_MAYBE;
alt_status tmp_220_alt_flag_2 = ALT_MAYBE;
alt_status tmp_220_alt_flag_3 = ALT_MAYBE;
alt_status tmp_220_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_220_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(2017);
/* BTS_Tests.ttcn, line 2017 */
tmp_220_alt_flag_0 = RSL__Emulation::RSL__DchanHdlr_component_RSL.receive(RSL__Types::tr__RSL__HANDO__DET(GSM__Types::RslChannelNr_template(const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).chan__nr()), RSL__Types::tr__RSL__HANDO__DET_acc__delay_defval), &(rm), any_compref, NULL, NULL, NULL);
if (tmp_220_alt_flag_0 == ALT_YES) {
current_location.update_lineno(2018);
/* BTS_Tests.ttcn, line 2018 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("Handover RACH has been detected: ");
rm.log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(2019);
/* BTS_Tests.ttcn, line 2019 */
TTCN_Runtime::setverdict(PASS);
break;
}
}
if (tmp_220_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(2021);
/* BTS_Tests.ttcn, line 2021 */
tmp_220_alt_flag_1 = RSL__Emulation::RSL__DchanHdlr_component_RSL.receive(RSL__Types::tr__RSL__CHAN__RQD(OCTETSTRING_template(ANY_VALUE), INTEGER_template(ANY_VALUE), GSM__Types::RslChannelNr_template(ANY_VALUE), INTEGER_template(ANY_VALUE)), &(rm), any_compref, NULL, NULL, NULL);
if (tmp_220_alt_flag_1 == ALT_YES) {
current_location.update_lineno(2022);
/* BTS_Tests.ttcn, line 2022 */
Misc__Helpers::f__shutdown(cs_4, 2022, FAIL, (TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("RSL_CHAN_RQD was not expected: "),rm.log(),TTCN_Logger::end_event_log2str()));
break;
}
}
if (tmp_220_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(2025);
/* BTS_Tests.ttcn, line 2025 */
tmp_220_alt_flag_2 = RSL__Emulation::RSL__DchanHdlr_component_RSL.receive(any_compref, NULL, NULL, NULL);
if (tmp_220_alt_flag_2 == ALT_YES) {
current_location.update_lineno(2025);
/* BTS_Tests.ttcn, line 2025 */
goto tmp_220;
}
}
if (tmp_220_alt_flag_3 == ALT_MAYBE) {
current_location.update_lineno(2026);
/* BTS_Tests.ttcn, line 2026 */
tmp_220_alt_flag_3 = T.timeout(NULL);
if (tmp_220_alt_flag_3 == ALT_YES) {
current_location.update_lineno(2027);
/* BTS_Tests.ttcn, line 2027 */
Misc__Helpers::f__shutdown(cs_4, 2027, FAIL, (TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Timeout waiting for handover RACH: FN="),fn.log(),TTCN_Logger::log_event_str(" RA="),ho__ref.log(),TTCN_Logger::end_event_log2str()));
break;
}
}
if (tmp_220_default_flag == ALT_MAYBE) {
tmp_220_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_220_default_flag == ALT_YES || tmp_220_default_flag == ALT_BREAK) break;
else if (tmp_220_default_flag == ALT_REPEAT) goto tmp_220;
}
current_location.update_lineno(2016);
/* BTS_Tests.ttcn, line 2016 */
if (tmp_220_alt_flag_0 == ALT_NO && tmp_220_alt_flag_1 == ALT_NO && tmp_220_alt_flag_2 == ALT_NO && tmp_220_alt_flag_3 == ALT_NO && tmp_220_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file BTS_Tests.ttcn between lines 2016 and 2030.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(2033);
/* BTS_Tests.ttcn, line 2033 */
f__rsl__chan__deact();
current_location.update_lineno(2034);
/* BTS_Tests.ttcn, line 2034 */
L1CTL__PortType::f__L1CTL__DM__REL__REQ(ConnHdlr_component_L1CTL, RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr);
}

void start_f__TC__ho__rach(const COMPONENT& component_reference, const CHARSTRING& id)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_TC_ho_rach(");
id.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_TC_ho_rach", text_buf);
id.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

verdicttype testcase_TC__ho__rach(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests.ttcn", 2038, TTCN_Location::LOCATION_TESTCASE, "TC_ho_rach");
try {
TTCN_Runtime::begin_testcase("BTS_Tests", "TC_ho_rach", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(2039);
/* BTS_Tests.ttcn, line 2039 */
ConnHdlrPars pars;
current_location.update_lineno(2040);
/* BTS_Tests.ttcn, line 2040 */
COMPONENT vc__conn;
current_location.update_lineno(2042);
/* BTS_Tests.ttcn, line 2042 */
f__init(f__init_trx__nr_defval);
{
current_location.update_lineno(2044);
/* BTS_Tests.ttcn, line 2044 */
INTEGER i(0);
current_location.update_lineno(2044);
/* BTS_Tests.ttcn, line 2044 */
for ( ; ; ) {
current_location.update_lineno(2044);
/* BTS_Tests.ttcn, line 2044 */
if (!(i < test__CT_component_g__AllChannels.size_of())) break;
current_location.update_lineno(2045);
/* BTS_Tests.ttcn, line 2045 */
pars = t__Pars(GSM__Types::RslChannelNr_template(const_cast< const ChannelNrs&>(test__CT_component_g__AllChannels)[i]), RSL__Types::ts__RSL__ChanMode__SIGN(RSL__Types::ts__RSL__ChanMode__SIGN_t_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxd_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxu_defval), t__Pars_spec_defval, t__Pars_trx__nr_defval, t__Pars_t__guard_defval).valueof();
current_location.update_lineno(2046);
/* BTS_Tests.ttcn, line 2046 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("TC_ho_rach: Starting for ");
const_cast< const ChannelNrs&>(test__CT_component_g__AllChannels)[i].log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(2047);
/* BTS_Tests.ttcn, line 2047 */
vc__conn = f__start__handler(&f__TC__ho__rach, pars, f__start__handler_pcu__comp_defval, f__start__handler_trxc__comp_defval, f__start__handler_l1ctl_defval);
current_location.update_lineno(2048);
/* BTS_Tests.ttcn, line 2048 */
{
tmp_223:
alt_status alt_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (alt_flag != ALT_NO) {
alt_flag = vc__conn.done(NULL, NULL);
if (alt_flag == ALT_YES) break;
else if (alt_flag == ALT_REPEAT) goto tmp_223;
}
if (default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps(first_run);
if (default_flag == ALT_YES || default_flag == ALT_BREAK) break;
else if (default_flag == ALT_REPEAT) goto tmp_223;
}
current_location.update_lineno(2048);
/* BTS_Tests.ttcn, line 2048 */
if (alt_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("Stand-alone done statement failed in file BTS_Tests.ttcn, line 2048.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(2044);
/* BTS_Tests.ttcn, line 2044 */
{
INTEGER tmp_224;
++i;
}
}
}
current_location.update_lineno(2052);
/* BTS_Tests.ttcn, line 2052 */
Misc__Helpers::f__shutdown(cs_4, 2052, Misc__Helpers::f__shutdown_verdict_defval, Misc__Helpers::f__shutdown_text_defval);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_ho_rach was stopped.");
}
return TTCN_Runtime::end_testcase();
}

void f__TC__ho__physical__info(const CHARSTRING& )
{
TTCN_Location current_location("BTS_Tests.ttcn", 2056, TTCN_Location::LOCATION_FUNCTION, "f_TC_ho_physical_info");
current_location.update_lineno(2057);
/* BTS_Tests.ttcn, line 2057 */
MobileL3__Types::PDU__ML3__NW__MS dcch__pdu;
current_location.update_lineno(2058);
/* BTS_Tests.ttcn, line 2058 */
INTEGER count(0);
current_location.update_lineno(2059);
/* BTS_Tests.ttcn, line 2059 */
L1CTL__Types::L1ctlMessage dl;
current_location.update_lineno(2060);
/* BTS_Tests.ttcn, line 2060 */
TIMER T("T");
current_location.update_lineno(2062);
/* BTS_Tests.ttcn, line 2062 */
f__l1__tune(ConnHdlr_component_L1CTL, f__l1__tune_ccch__mode_defval);
current_location.update_lineno(2063);
/* BTS_Tests.ttcn, line 2063 */
RSL__Emulation::RSL__DchanHdlr_component_RSL.clear();
current_location.update_lineno(2066);
/* BTS_Tests.ttcn, line 2066 */
INTEGER ho__ref(oct2int(Osmocom__Types::f__rnd__octstring(1)));
current_location.update_lineno(2069);
/* BTS_Tests.ttcn, line 2069 */
RSL__Types::RSL__IE ho__ref__ie;
{
RSL__Types::RSL__IE__Body_template tmp_225;
tmp_225.handover__ref() = ho__ref;
ho__ref__ie = RSL__Types::t__RSL__IE(RSL__Types::RSL__IE__Type::RSL__IE__HANDO__REF, tmp_225).valueof();
}
current_location.update_lineno(2073);
/* BTS_Tests.ttcn, line 2073 */
{
RSL__Types::RSL__IE__List tmp_226;
tmp_226.set_size(1);
tmp_226[0] = ho__ref__ie;
f__rsl__chan__act(RSL__Types::RSL__IE__ChannelMode(const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).chan__mode()), f__rsl__chan__act_encr__enable_defval, tmp_226, RSL__Types::c__RSL__IE__ActType__HO__SYNC);
}
current_location.update_lineno(2078);
/* BTS_Tests.ttcn, line 2078 */
f__l1ctl__est__dchan(ConnHdlr_component_L1CTL, ConnHdlr_component_g__pars);
current_location.update_lineno(2082);
/* BTS_Tests.ttcn, line 2082 */
T.start(2.0);
current_location.update_lineno(2083);
/* BTS_Tests.ttcn, line 2083 */
ConnHdlr_component_L1CTL.clear();
current_location.update_lineno(2084);
/* BTS_Tests.ttcn, line 2084 */
{
tmp_227:
alt_status tmp_227_alt_flag_0 = ALT_MAYBE;
alt_status tmp_227_alt_flag_1 = ALT_MAYBE;
alt_status tmp_227_alt_flag_2 = ALT_MAYBE;
alt_status tmp_227_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_227_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(2085);
/* BTS_Tests.ttcn, line 2085 */
tmp_227_alt_flag_0 = ConnHdlr_component_L1CTL.receive(L1CTL__Types::tr__L1CTL__DATA__IND(GSM__Types::RslChannelNr_template(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr), GSM__Types::tr__RslLinkID__DCCH(INTEGER_template(ANY_VALUE)), L1CTL__Types::tr__L1CTL__DATA__IND_l2__data_defval, L1CTL__Types::tr__L1CTL__DATA__IND_num__biterr_defval, L1CTL__Types::tr__L1CTL__DATA__IND_fire__crc_defval), &(dl), any_compref, NULL, NULL, NULL);
if (tmp_227_alt_flag_0 == ALT_YES) {
current_location.update_lineno(2086);
/* BTS_Tests.ttcn, line 2086 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Rx unexpected Downlink DCCH (before handover RACH): "),dl.log(),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(2087);
/* BTS_Tests.ttcn, line 2087 */
T.stop();
break;
}
}
if (tmp_227_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(2089);
/* BTS_Tests.ttcn, line 2089 */
tmp_227_alt_flag_1 = ConnHdlr_component_L1CTL.receive(any_compref, NULL, NULL, NULL);
if (tmp_227_alt_flag_1 == ALT_YES) {
current_location.update_lineno(2089);
/* BTS_Tests.ttcn, line 2089 */
goto tmp_227;
}
}
if (tmp_227_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(2090);
/* BTS_Tests.ttcn, line 2090 */
tmp_227_alt_flag_2 = T.timeout(NULL);
if (tmp_227_alt_flag_2 == ALT_YES) {
current_location.update_lineno(2090);
/* BTS_Tests.ttcn, line 2090 */
TTCN_Runtime::setverdict(PASS);
break;
}
}
if (tmp_227_default_flag == ALT_MAYBE) {
tmp_227_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_227_default_flag == ALT_YES || tmp_227_default_flag == ALT_BREAK) break;
else if (tmp_227_default_flag == ALT_REPEAT) goto tmp_227;
}
current_location.update_lineno(2084);
/* BTS_Tests.ttcn, line 2084 */
if (tmp_227_alt_flag_0 == ALT_NO && tmp_227_alt_flag_1 == ALT_NO && tmp_227_alt_flag_2 == ALT_NO && tmp_227_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file BTS_Tests.ttcn between lines 2084 and 2091.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(2094);
/* BTS_Tests.ttcn, line 2094 */
TTCN_Logger::log_str(TTCN_USER, "Sending handover Access Burst");
current_location.update_lineno(2095);
/* BTS_Tests.ttcn, line 2095 */
L1CTL__PortType::f__L1CTL__RACH(ConnHdlr_component_L1CTL, ho__ref, L1CTL__PortType::f__L1CTL__RACH_combined_defval, L1CTL__PortType::f__L1CTL__RACH_offset_defval, GSM__Types::RslChannelNr_template(const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).chan__nr()), L1CTL__PortType::f__L1CTL__RACH_link__id_defval);
current_location.update_lineno(2098);
/* BTS_Tests.ttcn, line 2098 */
T.start(((int2float((mp__ho__t3105__ms * mp__ho__ny1)) / 1.0e3) + 1.0));
current_location.update_lineno(2099);
/* BTS_Tests.ttcn, line 2099 */
ConnHdlr_component_L1CTL.clear();
current_location.update_lineno(2100);
/* BTS_Tests.ttcn, line 2100 */
{
tmp_228:
alt_status tmp_228_alt_flag_0 = ALT_MAYBE;
alt_status tmp_228_alt_flag_1 = ALT_MAYBE;
alt_status tmp_228_alt_flag_2 = ALT_MAYBE;
alt_status tmp_228_alt_flag_3 = ALT_MAYBE;
alt_status tmp_228_alt_flag_4 = ALT_MAYBE;
alt_status tmp_228_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_228_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(2101);
/* BTS_Tests.ttcn, line 2101 */
tmp_228_alt_flag_0 = as__dl__lapdm__dummy_instance(as__dl__lapdm__dummy_chan__nr_defval, as__dl__lapdm__dummy_link__id_defval, as__dl__lapdm__dummy_sapi_defval, as__dl__lapdm__dummy_do__repeat_defval, first_run);
if (tmp_228_alt_flag_0 == ALT_REPEAT) goto tmp_228;
if (tmp_228_alt_flag_0 == ALT_BREAK) break;
if (tmp_228_alt_flag_0 == ALT_YES) break;
}
if (tmp_228_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(2102);
/* BTS_Tests.ttcn, line 2102 */
{
MobileL3__Types::PDU__ML3__NW__MS tmp_229;
tmp_228_alt_flag_1 = as__dl__dcch__pdu_instance(tmp_229, L3__Templates::tr__RRM__PhysicalInfo(L3__Templates::tr__RRM__PhysicalInfo_ta_defval), as__dl__dcch__pdu_sapi_defval, first_run);
if (tmp_229.is_bound()) dcch__pdu = tmp_229;
}
if (tmp_228_alt_flag_1 == ALT_REPEAT) goto tmp_228;
if (tmp_228_alt_flag_1 == ALT_BREAK) break;
if (tmp_228_alt_flag_1 == ALT_YES) {
current_location.update_lineno(2103);
/* BTS_Tests.ttcn, line 2103 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("Rx RR Physical Information: ");
dcch__pdu.log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(2105);
/* BTS_Tests.ttcn, line 2105 */
{
INTEGER tmp_230;
++count;
}
current_location.update_lineno(2106);
/* BTS_Tests.ttcn, line 2106 */
if ((count < mp__ho__ny1)) {
current_location.update_lineno(2107);
/* BTS_Tests.ttcn, line 2107 */
goto tmp_228;
}
current_location.update_lineno(2108);
/* BTS_Tests.ttcn, line 2108 */
TTCN_Runtime::setverdict(PASS);
break;
}
}
if (tmp_228_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(2110);
/* BTS_Tests.ttcn, line 2110 */
{
MobileL3__Types::PDU__ML3__NW__MS tmp_231;
tmp_228_alt_flag_2 = as__dl__dcch__pdu_instance(tmp_231, MobileL3__Types::PDU__ML3__NW__MS_template(ANY_VALUE), as__dl__dcch__pdu_sapi_defval, first_run);
if (tmp_231.is_bound()) dcch__pdu = tmp_231;
}
if (tmp_228_alt_flag_2 == ALT_REPEAT) goto tmp_228;
if (tmp_228_alt_flag_2 == ALT_BREAK) break;
if (tmp_228_alt_flag_2 == ALT_YES) {
current_location.update_lineno(2111);
/* BTS_Tests.ttcn, line 2111 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Rx unexpected DCCH PDU: "),dcch__pdu.log(),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(2112);
/* BTS_Tests.ttcn, line 2112 */
Misc__Helpers::f__shutdown(cs_4, 2112, Misc__Helpers::f__shutdown_verdict_defval, Misc__Helpers::f__shutdown_text_defval);
break;
}
}
if (tmp_228_alt_flag_3 == ALT_MAYBE) {
current_location.update_lineno(2114);
/* BTS_Tests.ttcn, line 2114 */
tmp_228_alt_flag_3 = ConnHdlr_component_L1CTL.receive(any_compref, NULL, NULL, NULL);
if (tmp_228_alt_flag_3 == ALT_YES) {
current_location.update_lineno(2114);
/* BTS_Tests.ttcn, line 2114 */
goto tmp_228;
}
}
if (tmp_228_alt_flag_4 == ALT_MAYBE) {
current_location.update_lineno(2115);
/* BTS_Tests.ttcn, line 2115 */
tmp_228_alt_flag_4 = T.timeout(NULL);
if (tmp_228_alt_flag_4 == ALT_YES) {
current_location.update_lineno(2116);
/* BTS_Tests.ttcn, line 2116 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Timeout waiting for RR Physical Information"),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(2117);
/* BTS_Tests.ttcn, line 2117 */
Misc__Helpers::f__shutdown(cs_4, 2117, Misc__Helpers::f__shutdown_verdict_defval, Misc__Helpers::f__shutdown_text_defval);
break;
}
}
if (tmp_228_default_flag == ALT_MAYBE) {
tmp_228_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_228_default_flag == ALT_YES || tmp_228_default_flag == ALT_BREAK) break;
else if (tmp_228_default_flag == ALT_REPEAT) goto tmp_228;
}
current_location.update_lineno(2100);
/* BTS_Tests.ttcn, line 2100 */
if (tmp_228_alt_flag_0 == ALT_NO && tmp_228_alt_flag_1 == ALT_NO && tmp_228_alt_flag_2 == ALT_NO && tmp_228_alt_flag_3 == ALT_NO && tmp_228_alt_flag_4 == ALT_NO && tmp_228_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file BTS_Tests.ttcn between lines 2100 and 2119.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(2122);
/* BTS_Tests.ttcn, line 2122 */
f__rsl__chan__deact();
current_location.update_lineno(2123);
/* BTS_Tests.ttcn, line 2123 */
L1CTL__PortType::f__L1CTL__DM__REL__REQ(ConnHdlr_component_L1CTL, RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr);
}

void start_f__TC__ho__physical__info(const COMPONENT& component_reference, const CHARSTRING& id)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_TC_ho_physical_info(");
id.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_TC_ho_physical_info", text_buf);
id.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

verdicttype testcase_TC__ho__physical__info(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests.ttcn", 2125, TTCN_Location::LOCATION_TESTCASE, "TC_ho_physical_info");
try {
TTCN_Runtime::begin_testcase("BTS_Tests", "TC_ho_physical_info", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(2126);
/* BTS_Tests.ttcn, line 2126 */
ConnHdlrPars pars;
current_location.update_lineno(2127);
/* BTS_Tests.ttcn, line 2127 */
COMPONENT vc__conn;
current_location.update_lineno(2129);
/* BTS_Tests.ttcn, line 2129 */
f__init(f__init_trx__nr_defval);
{
current_location.update_lineno(2131);
/* BTS_Tests.ttcn, line 2131 */
INTEGER i(0);
current_location.update_lineno(2131);
/* BTS_Tests.ttcn, line 2131 */
for ( ; ; ) {
current_location.update_lineno(2131);
/* BTS_Tests.ttcn, line 2131 */
if (!(i < test__CT_component_g__AllChanTypes.size_of())) break;
current_location.update_lineno(2132);
/* BTS_Tests.ttcn, line 2132 */
pars = t__Pars(GSM__Types::RslChannelNr_template(const_cast< const ChannelNrs&>(test__CT_component_g__AllChanTypes)[i]), RSL__Types::ts__RSL__ChanMode__SIGN(RSL__Types::ts__RSL__ChanMode__SIGN_t_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxd_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxu_defval), t__Pars_spec_defval, t__Pars_trx__nr_defval, t__Pars_t__guard_defval).valueof();
current_location.update_lineno(2133);
/* BTS_Tests.ttcn, line 2133 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("TC_ho_physical_info: Starting for ");
const_cast< const ChannelNrs&>(test__CT_component_g__AllChanTypes)[i].log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(2134);
/* BTS_Tests.ttcn, line 2134 */
vc__conn = f__start__handler(&f__TC__ho__physical__info, pars, f__start__handler_pcu__comp_defval, f__start__handler_trxc__comp_defval, f__start__handler_l1ctl_defval);
current_location.update_lineno(2135);
/* BTS_Tests.ttcn, line 2135 */
{
tmp_234:
alt_status alt_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (alt_flag != ALT_NO) {
alt_flag = vc__conn.done(NULL, NULL);
if (alt_flag == ALT_YES) break;
else if (alt_flag == ALT_REPEAT) goto tmp_234;
}
if (default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps(first_run);
if (default_flag == ALT_YES || default_flag == ALT_BREAK) break;
else if (default_flag == ALT_REPEAT) goto tmp_234;
}
current_location.update_lineno(2135);
/* BTS_Tests.ttcn, line 2135 */
if (alt_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("Stand-alone done statement failed in file BTS_Tests.ttcn, line 2135.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(2131);
/* BTS_Tests.ttcn, line 2131 */
{
INTEGER tmp_235;
++i;
}
}
}
current_location.update_lineno(2139);
/* BTS_Tests.ttcn, line 2139 */
Misc__Helpers::f__shutdown(cs_4, 2139, Misc__Helpers::f__shutdown_verdict_defval, Misc__Helpers::f__shutdown_text_defval);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_ho_physical_info was stopped.");
}
return TTCN_Runtime::end_testcase();
}

LAPDm__Types::LapdmAddressField_template ts__LapdmAddr(const INTEGER_template& sapi, const BOOLEAN_template& c__r)
{
TTCN_Location current_location("BTS_Tests.ttcn", 2146, TTCN_Location::LOCATION_TEMPLATE, "ts_LapdmAddr");
LAPDm__Types::LapdmAddressField_template ret_val;
ret_val.spare() = bs_2;
ret_val.lpd() = 0;
ret_val.sapi() = sapi;
ret_val.c__r() = c__r;
ret_val.ea() = TRUE;
return ret_val;
}

LAPDm__Types::LapdmFrameAB_template ts__LAPDm__AB(const INTEGER_template& sapi, const GSM__RR__Types::GsmRrL3Message_template& l3, const BOOLEAN_template& c__r, const BOOLEAN_template& p)
{
TTCN_Location current_location("BTS_Tests.ttcn", 2156, TTCN_Location::LOCATION_TEMPLATE, "ts_LAPDm_AB");
LAPDm__Types::LapdmFrameAB_template ret_val;
ret_val.addr() = ts__LapdmAddr(sapi, c__r);
ret_val.ctrl() = LAPDm__Types::ts__LapdmCtrlUI(p.valueof());
ret_val.len() = 0;
ret_val.m() = FALSE;
ret_val.el() = 1;
ret_val.payload() = GSM__RR__Types::enc__GsmRrL3Message(l3.valueof());
ret_val.padding() = os_2;
return ret_val;
}

alt_status as__l1__sacch__loop_instance(boolean first_alt_run)
{
TTCN_Location current_location("BTS_Tests.ttcn", 2171, TTCN_Location::LOCATION_ALTSTEP, "as_l1_sacch_loop");
current_location.update_lineno(2172);
/* BTS_Tests.ttcn, line 2172 */
LAPDm__Types::LapdmFrameAB_template lb;
current_location.update_lineno(2173);
/* BTS_Tests.ttcn, line 2173 */
L1CTL__Types::L1ctlMessage l1__dl;
alt_status ret_val = ALT_NO;
current_location.update_lineno(2175);
/* BTS_Tests.ttcn, line 2175 */
switch (ConnHdlr_component_L1CTL.receive(L1CTL__Types::tr__L1CTL__DATA__IND(GSM__Types::RslChannelNr_template(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr), GSM__Types::tr__RslLinkID__SACCH(INTEGER_template(ANY_VALUE)), L1CTL__Types::tr__L1CTL__DATA__IND_l2__data_defval, L1CTL__Types::tr__L1CTL__DATA__IND_num__biterr_defval, L1CTL__Types::tr__L1CTL__DATA__IND_fire__crc_defval), &(l1__dl), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(2176);
/* BTS_Tests.ttcn, line 2176 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("SACCH received: ");
const_cast< const L1CTL__Types::L1ctlMessage&>(l1__dl).payload()().data__ind().payload().log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(2178);
/* BTS_Tests.ttcn, line 2178 */
lb = ts__LAPDm__AB(INTEGER_template(0), GSM__RR__Types::ts__MEAS__REP(const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).l1__pars().meas__valid(), INTEGER_template(const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).l1__pars().meas__ul().full().rxlev()), INTEGER_template(const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).l1__pars().meas__ul().sub().rxlev()), INTEGER_template(const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).l1__pars().meas__ul().full().rxqual()), INTEGER_template(const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).l1__pars().meas__ul().sub().rxqual()), GSM__RR__Types::ts__MEAS__REP_reps_defval), ts__LAPDm__AB_c__r_defval, ts__LAPDm__AB_p_defval);
current_location.update_lineno(2183);
/* BTS_Tests.ttcn, line 2183 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("LAPDm: ");
lb.log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(2185);
/* BTS_Tests.ttcn, line 2185 */
GSM__RR__Types::SacchL1Header_template l1h(GSM__RR__Types::ts__SacchL1Header(const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).l1__pars().ms__power__level(), const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).l1__pars().ms__actual__ta(), GSM__RR__Types::ts__SacchL1Header_fpc_defval));
current_location.update_lineno(2189);
/* BTS_Tests.ttcn, line 2189 */
OCTETSTRING l2(Osmocom__Types::f__pad__oct(LAPDm__Types::enc__LapdmFrameAB(lb.valueof()), 21, os_1));
current_location.update_lineno(2191);
/* BTS_Tests.ttcn, line 2191 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("Sending Measurement Report: ");
l1h.log();
l2.log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(2192);
/* BTS_Tests.ttcn, line 2192 */
ConnHdlr_component_L1CTL.send(L1CTL__Types::ts__L1CTL__DATA__REQ__SACCH(GSM__Types::RslChannelNr_template(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr), GSM__Types::ts__RslLinkID__SACCH(0), l1h, l2), FALSE, NULL);
current_location.update_lineno(2193);
/* BTS_Tests.ttcn, line 2193 */
return ALT_REPEAT;
}
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
current_location.update_lineno(2196);
/* BTS_Tests.ttcn, line 2196 */
switch (ConnHdlr_component_L1CTL.receive(L1CTL__Types::tr__L1CTL__DATA__CONF(GSM__Types::RslChannelNr_template(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr), GSM__Types::tr__RslLinkID__SACCH(INTEGER_template(0)), L1CTL__Types::tr__L1CTL__DATA__CONF_arfcn_defval, L1CTL__Types::tr__L1CTL__DATA__CONF_fn_defval), NULL, any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(2196);
/* BTS_Tests.ttcn, line 2196 */
return ALT_REPEAT;
}
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
return ret_val;
}

void as__l1__sacch__loop(boolean nodefault_modifier)
{
altstep_begin:
boolean block_flag = FALSE;
alt_status altstep_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED;
for ( ; ; ) {
TTCN_Snapshot::take_new(block_flag);
if (altstep_flag != ALT_NO) {
altstep_flag = as__l1__sacch__loop_instance(!block_flag);
if (altstep_flag == ALT_YES || altstep_flag == ALT_BREAK) return;
else if (altstep_flag == ALT_REPEAT) goto altstep_begin;
}
if (!nodefault_modifier && default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps(!block_flag);
if (default_flag == ALT_YES || default_flag == ALT_BREAK) return;
else if (default_flag == ALT_REPEAT) goto altstep_begin;
}
if (altstep_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in altstep as_l1_sacch_loop.");
else block_flag = TRUE;
}
}

Default_Base *activate_as__l1__sacch__loop()
{
return new as__l1__sacch__loop_Default();
}

alt_status as__l1__sacch__l1h_instance(GSM__RR__Types::SacchL1Header& l1h, const BOOLEAN& do__apply, boolean first_alt_run)
{
TTCN_Location current_location("BTS_Tests.ttcn", 2200, TTCN_Location::LOCATION_ALTSTEP, "as_l1_sacch_l1h");
current_location.update_lineno(2204);
/* BTS_Tests.ttcn, line 2204 */
L1CTL__Types::L1ctlMessage l1__dl;
alt_status ret_val = ALT_NO;
current_location.update_lineno(2206);
/* BTS_Tests.ttcn, line 2206 */
switch (ConnHdlr_component_L1CTL.receive(L1CTL__Types::tr__L1CTL__DATA__IND(GSM__Types::RslChannelNr_template(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr), GSM__Types::tr__RslLinkID__SACCH(INTEGER_template(ANY_VALUE)), L1CTL__Types::tr__L1CTL__DATA__IND_l2__data_defval, L1CTL__Types::tr__L1CTL__DATA__IND_num__biterr_defval, L1CTL__Types::tr__L1CTL__DATA__IND_fire__crc_defval), &(l1__dl), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(2208);
/* BTS_Tests.ttcn, line 2208 */
l1h = GSM__RR__Types::dec__SacchL1Header(substr(const_cast< const L1CTL__Types::L1ctlMessage&>(l1__dl).payload()().data__ind().payload(), 0, 2));
current_location.update_lineno(2209);
/* BTS_Tests.ttcn, line 2209 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("as_l1_sacch_l1h(): Rx SACCH L1 header: ");
l1h.log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(2211);
/* BTS_Tests.ttcn, line 2211 */
if (do__apply) {
current_location.update_lineno(2213);
/* BTS_Tests.ttcn, line 2213 */
L1CTL__PortType::f__L1CTL__PARAM(ConnHdlr_component_L1CTL, const_cast< const GSM__RR__Types::SacchL1Header&>(l1h).actual__ta(), const_cast< const GSM__RR__Types::SacchL1Header&>(l1h).ms__power__lvl());
}
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
return ret_val;
}

void as__l1__sacch__l1h(boolean nodefault_modifier, GSM__RR__Types::SacchL1Header& l1h, const BOOLEAN& do__apply)
{
altstep_begin:
boolean block_flag = FALSE;
alt_status altstep_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED;
for ( ; ; ) {
TTCN_Snapshot::take_new(block_flag);
if (altstep_flag != ALT_NO) {
altstep_flag = as__l1__sacch__l1h_instance(l1h, do__apply, !block_flag);
if (altstep_flag == ALT_YES || altstep_flag == ALT_BREAK) return;
else if (altstep_flag == ALT_REPEAT) goto altstep_begin;
}
if (!nodefault_modifier && default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps(!block_flag);
if (default_flag == ALT_YES || default_flag == ALT_BREAK) return;
else if (default_flag == ALT_REPEAT) goto altstep_begin;
}
if (altstep_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in altstep as_l1_sacch_l1h.");
else block_flag = TRUE;
}
}

Default_Base *activate_as__l1__sacch__l1h(GSM__RR__Types::SacchL1Header& l1h, const BOOLEAN& do__apply)
{
return new as__l1__sacch__l1h_Default(l1h, do__apply);
}

alt_status as__l1__dcch__loop_instance(boolean first_alt_run)
{
TTCN_Location current_location("BTS_Tests.ttcn", 2218, TTCN_Location::LOCATION_ALTSTEP, "as_l1_dcch_loop");
current_location.update_lineno(2219);
/* BTS_Tests.ttcn, line 2219 */
L1CTL__Types::L1ctlMessage l1__dl;
alt_status ret_val = ALT_NO;
current_location.update_lineno(2220);
/* BTS_Tests.ttcn, line 2220 */
switch (ConnHdlr_component_L1CTL.receive(L1CTL__Types::tr__L1CTL__DATA__IND(GSM__Types::RslChannelNr_template(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr), GSM__Types::tr__RslLinkID__DCCH(INTEGER_template(ANY_VALUE)), L1CTL__Types::tr__L1CTL__DATA__IND_l2__data_defval, L1CTL__Types::tr__L1CTL__DATA__IND_num__biterr_defval, L1CTL__Types::tr__L1CTL__DATA__IND_fire__crc_defval), &(l1__dl), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(2221);
/* BTS_Tests.ttcn, line 2221 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("DCCH received: ");
const_cast< const L1CTL__Types::L1ctlMessage&>(l1__dl).payload()().data__ind().payload().log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(2222);
/* BTS_Tests.ttcn, line 2222 */
OCTETSTRING pl(os_3);
current_location.update_lineno(2223);
/* BTS_Tests.ttcn, line 2223 */
ConnHdlr_component_L1CTL.send(L1CTL__Types::ts__L1CTL__DATA__REQ(GSM__Types::RslChannelNr_template(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr), GSM__Types::ts__RslLinkID__DCCH(0), Osmocom__Types::f__pad__oct(pl, 23, os_4)), FALSE, NULL);
current_location.update_lineno(2225);
/* BTS_Tests.ttcn, line 2225 */
return ALT_REPEAT;
}
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
current_location.update_lineno(2228);
/* BTS_Tests.ttcn, line 2228 */
switch (ConnHdlr_component_L1CTL.receive(L1CTL__Types::tr__L1CTL__DATA__CONF(GSM__Types::RslChannelNr_template(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr), GSM__Types::tr__RslLinkID__DCCH(INTEGER_template(0)), L1CTL__Types::tr__L1CTL__DATA__CONF_arfcn_defval, L1CTL__Types::tr__L1CTL__DATA__CONF_fn_defval), NULL, any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(2228);
/* BTS_Tests.ttcn, line 2228 */
return ALT_REPEAT;
}
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
return ret_val;
}

void as__l1__dcch__loop(boolean nodefault_modifier)
{
altstep_begin:
boolean block_flag = FALSE;
alt_status altstep_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED;
for ( ; ; ) {
TTCN_Snapshot::take_new(block_flag);
if (altstep_flag != ALT_NO) {
altstep_flag = as__l1__dcch__loop_instance(!block_flag);
if (altstep_flag == ALT_YES || altstep_flag == ALT_BREAK) return;
else if (altstep_flag == ALT_REPEAT) goto altstep_begin;
}
if (!nodefault_modifier && default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps(!block_flag);
if (default_flag == ALT_YES || default_flag == ALT_BREAK) return;
else if (default_flag == ALT_REPEAT) goto altstep_begin;
}
if (altstep_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in altstep as_l1_dcch_loop.");
else block_flag = TRUE;
}
}

Default_Base *activate_as__l1__dcch__loop()
{
return new as__l1__dcch__loop_Default();
}

alt_status as__l1__tch__loop_instance(boolean first_alt_run)
{
TTCN_Location current_location("BTS_Tests.ttcn", 2231, TTCN_Location::LOCATION_ALTSTEP, "as_l1_tch_loop");
current_location.update_lineno(2232);
/* BTS_Tests.ttcn, line 2232 */
L1CTL__Types::L1ctlMessage l1__dl;
alt_status ret_val = ALT_NO;
current_location.update_lineno(2233);
/* BTS_Tests.ttcn, line 2233 */
switch (ConnHdlr_component_L1CTL.receive(L1CTL__Types::tr__L1CTL__TRAFFIC__IND(GSM__Types::RslChannelNr_template(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr), L1CTL__Types::tr__L1CTL__TRAFFIC__IND_link__id_defval, L1CTL__Types::tr__L1CTL__TRAFFIC__IND_frame_defval, L1CTL__Types::tr__L1CTL__TRAFFIC__IND_num__biterr_defval, L1CTL__Types::tr__L1CTL__TRAFFIC__IND_fire__crc_defval), &(l1__dl), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(2234);
/* BTS_Tests.ttcn, line 2234 */
OCTETSTRING data(const_cast< const L1CTL__Types::L1ctlMessage&>(l1__dl).payload()().traffic__ind().data());
current_location.update_lineno(2235);
/* BTS_Tests.ttcn, line 2235 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("TCH received (len=");
{
INTEGER tmp_238(data.lengthof());
tmp_238.log();
}
TTCN_Logger::log_event_str("): ");
data.log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(2238);
/* BTS_Tests.ttcn, line 2238 */
{
boolean tmp_239;
tmp_239 = (const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).l1__pars().facch__enabled() == TRUE);
if (tmp_239) tmp_239 = (mod(const_cast< const L1CTL__Types::L1ctlMessage&>(l1__dl).dl__info()().frame__nr(), 5) == 0);
if (tmp_239) {
current_location.update_lineno(2239);
/* BTS_Tests.ttcn, line 2239 */
OCTETSTRING pl(os_3);
current_location.update_lineno(2240);
/* BTS_Tests.ttcn, line 2240 */
ConnHdlr_component_L1CTL.send(L1CTL__Types::ts__L1CTL__DATA__REQ(GSM__Types::RslChannelNr_template(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr), GSM__Types::ts__RslLinkID__DCCH(0), Osmocom__Types::f__pad__oct(pl, 23, os_4)), FALSE, NULL);
}
else {
current_location.update_lineno(2243);
/* BTS_Tests.ttcn, line 2243 */
ConnHdlr_component_L1CTL.send(L1CTL__Types::ts__L1CTL__TRAFFIC__REQ(GSM__Types::RslChannelNr_template(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr), GSM__Types::RslLinkId_template(const_cast< const L1CTL__Types::L1ctlMessage&>(l1__dl).dl__info()().link__id()), const_cast< const L1CTL__Types::L1ctlMessage&>(l1__dl).payload()().traffic__ind().data()), FALSE, NULL);
}
}
current_location.update_lineno(2247);
/* BTS_Tests.ttcn, line 2247 */
return ALT_REPEAT;
}
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
current_location.update_lineno(2250);
/* BTS_Tests.ttcn, line 2250 */
switch (ConnHdlr_component_L1CTL.receive(L1CTL__Types::tr__L1CTL__TRAFFIC__CONF(GSM__Types::RslChannelNr_template(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr), GSM__Types::tr__RslLinkID__DCCH(INTEGER_template(0)), L1CTL__Types::tr__L1CTL__TRAFFIC__CONF_arfcn_defval, L1CTL__Types::tr__L1CTL__TRAFFIC__CONF_fn_defval), NULL, any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(2250);
/* BTS_Tests.ttcn, line 2250 */
return ALT_REPEAT;
}
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
return ret_val;
}

void as__l1__tch__loop(boolean nodefault_modifier)
{
altstep_begin:
boolean block_flag = FALSE;
alt_status altstep_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED;
for ( ; ; ) {
TTCN_Snapshot::take_new(block_flag);
if (altstep_flag != ALT_NO) {
altstep_flag = as__l1__tch__loop_instance(!block_flag);
if (altstep_flag == ALT_YES || altstep_flag == ALT_BREAK) return;
else if (altstep_flag == ALT_REPEAT) goto altstep_begin;
}
if (!nodefault_modifier && default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps(!block_flag);
if (default_flag == ALT_YES || default_flag == ALT_BREAK) return;
else if (default_flag == ALT_REPEAT) goto altstep_begin;
}
if (altstep_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in altstep as_l1_tch_loop.");
else block_flag = TRUE;
}
}

Default_Base *activate_as__l1__tch__loop()
{
return new as__l1__tch__loop_Default();
}

INTEGER toffs256s__to__rsl(const INTEGER& toffs256s)
{
TTCN_Location current_location("BTS_Tests.ttcn", 2276, TTCN_Location::LOCATION_FUNCTION, "toffs256s_to_rsl");
current_location.update_lineno(2277);
/* BTS_Tests.ttcn, line 2277 */
return (63 + (toffs256s / 256));
}

INTEGER f__max(const INTEGER& a, const INTEGER& b)
{
TTCN_Location current_location("BTS_Tests.ttcn", 2280, TTCN_Location::LOCATION_FUNCTION, "f_max");
current_location.update_lineno(2281);
/* BTS_Tests.ttcn, line 2281 */
if ((a > b)) {
current_location.update_lineno(2282);
/* BTS_Tests.ttcn, line 2282 */
return a;
}
else {
current_location.update_lineno(2284);
/* BTS_Tests.ttcn, line 2284 */
return b;
}
}

INTEGER f__min(const INTEGER& a, const INTEGER& b)
{
TTCN_Location current_location("BTS_Tests.ttcn", 2288, TTCN_Location::LOCATION_FUNCTION, "f_min");
current_location.update_lineno(2289);
/* BTS_Tests.ttcn, line 2289 */
if ((a < b)) {
current_location.update_lineno(2290);
/* BTS_Tests.ttcn, line 2290 */
return a;
}
else {
current_location.update_lineno(2292);
/* BTS_Tests.ttcn, line 2292 */
return b;
}
}

INTEGER f__tolerance__neg(const INTEGER& val, const INTEGER& min, const INTEGER& tolerance)
{
INTEGER val_shadow(val);
TTCN_Location current_location("BTS_Tests.ttcn", 2297, TTCN_Location::LOCATION_FUNCTION, "f_tolerance_neg");
current_location.update_lineno(2298);
/* BTS_Tests.ttcn, line 2298 */
{
INTEGER tmp_240;
tmp_240 = (val_shadow - tolerance);
val_shadow = tmp_240;
}
current_location.update_lineno(2299);
/* BTS_Tests.ttcn, line 2299 */
return f__max(val_shadow, min);
}

INTEGER f__tolerance__pos(const INTEGER& val, const INTEGER& max, const INTEGER& tolerance)
{
INTEGER val_shadow(val);
TTCN_Location current_location("BTS_Tests.ttcn", 2303, TTCN_Location::LOCATION_FUNCTION, "f_tolerance_pos");
current_location.update_lineno(2304);
/* BTS_Tests.ttcn, line 2304 */
{
INTEGER tmp_241;
tmp_241 = (val_shadow + tolerance);
val_shadow = tmp_241;
}
current_location.update_lineno(2305);
/* BTS_Tests.ttcn, line 2305 */
return f__min(val_shadow, max);
}

INTEGER_template f__tolerance(const INTEGER& val, const INTEGER& min, const INTEGER& max, const INTEGER& tolerance)
{
TTCN_Location current_location("BTS_Tests.ttcn", 2309, TTCN_Location::LOCATION_FUNCTION, "f_tolerance");
current_location.update_lineno(2311);
/* BTS_Tests.ttcn, line 2311 */
INTEGER_template ret;
current_location.update_lineno(2312);
/* BTS_Tests.ttcn, line 2312 */
ret.set_type(VALUE_RANGE);
ret.set_min(f__tolerance__neg(val, min, tolerance));
ret.set_max(f__tolerance__pos(val, max, tolerance));
current_location.update_lineno(2313);
/* BTS_Tests.ttcn, line 2313 */
return ret;
}

RSL__Types::RSL__Message_template f__build__meas__res__tmpl()
{
TTCN_Location current_location("BTS_Tests.ttcn", 2318, TTCN_Location::LOCATION_FUNCTION, "f_build_meas_res_tmpl");
current_location.update_lineno(2319);
/* BTS_Tests.ttcn, line 2319 */
ConnL1Pars l1p(const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).l1__pars());
current_location.update_lineno(2320);
/* BTS_Tests.ttcn, line 2320 */
RSL__Types::RSL__IE__UplinkMeas_template ul__meas;
ul__meas.len() = 3;
ul__meas.rfu() = bs_2;
ul__meas.dtx__d() = const_cast< const ConnL1Pars&>(l1p).dtx__enabled();
ul__meas.rxlev__f__u() = f__tolerance(const_cast< const ConnL1Pars&>(l1p).meas__ul().full().rxlev(), 0, 63, mp__tolerance__rxlev);
ul__meas.reserved1() = bs_5;
ul__meas.rxlev__s__u() = f__tolerance(const_cast< const ConnL1Pars&>(l1p).meas__ul().sub().rxlev(), 0, 63, mp__tolerance__rxlev);
ul__meas.reserved2() = bs_5;
ul__meas.rxq__f__u() = f__tolerance(const_cast< const ConnL1Pars&>(l1p).meas__ul().full().rxqual(), 0, 7, mp__tolerance__rxqual);
ul__meas.rxq__s__u() = f__tolerance(const_cast< const ConnL1Pars&>(l1p).meas__ul().sub().rxqual(), 0, 7, mp__tolerance__rxqual);
ul__meas.supp__meas__info() = OMIT_VALUE;
current_location.update_lineno(2332);
/* BTS_Tests.ttcn, line 2332 */
if (const_cast< const ConnL1Pars&>(l1p).toa256__enabled()) {
current_location.update_lineno(2333);
/* BTS_Tests.ttcn, line 2333 */
ul__meas.len() = 11;
current_location.update_lineno(2334);
/* BTS_Tests.ttcn, line 2334 */
{
RSL__Types::RSL__IE__UplinkMeasSuppMeasInfo_template& tmp_245 = ul__meas.supp__meas__info();
tmp_245.toa256__mean() = f__tolerance(const_cast< const ConnL1Pars&>(l1p).timing__offset__256syms(), -16128, 49152, mp__tolerance__timing__offset__256syms);
tmp_245.toa256__min() = ANY_VALUE;
tmp_245.toa256__max() = ANY_VALUE;
tmp_245.toa256__std__dev() = ANY_VALUE;
}
}
current_location.update_lineno(2341);
/* BTS_Tests.ttcn, line 2341 */
RSL__Types::RSL__IE__BS__Power_template bs__power;
bs__power.reserved() = 0;
bs__power.epc() = FALSE;
bs__power.fpc() = FALSE;
bs__power.power__level() = const_cast< const ConnL1Pars&>(l1p).bs__power__level();
current_location.update_lineno(2347);
/* BTS_Tests.ttcn, line 2347 */
RSL__Types::RSL__IE__L1Info_template l1__info;
l1__info.ms__power__lvl() = const_cast< const ConnL1Pars&>(l1p).ms__power__level();
l1__info.fpc() = FALSE;
l1__info.reserved() = 0;
l1__info.actual__ta() = f__tolerance(const_cast< const ConnL1Pars&>(l1p).ms__actual__ta(), 0, 63, (mp__tolerance__timing__offset__256syms / 256));
current_location.update_lineno(2353);
/* BTS_Tests.ttcn, line 2353 */
INTEGER offs(toffs256s__to__rsl(const_cast< const ConnL1Pars&>(l1p).timing__offset__256syms()));
current_location.update_lineno(2354);
/* BTS_Tests.ttcn, line 2354 */
INTEGER_template t__toffs(f__tolerance(offs, 0, 255, (mp__tolerance__timing__offset__256syms / 256)));
current_location.update_lineno(2355);
/* BTS_Tests.ttcn, line 2355 */
return RSL__Types::tr__RSL__MEAS__RES__OSMO(GSM__Types::RslChannelNr_template(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr), INTEGER_template(ConnHdlr_component_g__next__meas__res__nr), ul__meas, bs__power, l1__info, OCTETSTRING_template(ANY_VALUE), t__toffs);
}

void start_f__build__meas__res__tmpl(const COMPONENT& component_reference)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_build_meas_res_tmpl(");
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_build_meas_res_tmpl", text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

RSL__Types::RSL__Message_template f__build__meas__res__tmpl__empty()
{
TTCN_Location current_location("BTS_Tests.ttcn", 2361, TTCN_Location::LOCATION_FUNCTION, "f_build_meas_res_tmpl_empty");
current_location.update_lineno(2362);
/* BTS_Tests.ttcn, line 2362 */
ConnL1Pars l1p(const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).l1__pars());
current_location.update_lineno(2363);
/* BTS_Tests.ttcn, line 2363 */
RSL__Types::RSL__IE__UplinkMeas_template ul__meas;
ul__meas.len() = 3;
ul__meas.rfu() = bs_2;
ul__meas.dtx__d() = const_cast< const ConnL1Pars&>(l1p).dtx__enabled();
ul__meas.rxlev__f__u() = ANY_VALUE;
ul__meas.reserved1() = bs_5;
ul__meas.rxlev__s__u() = ANY_VALUE;
ul__meas.reserved2() = bs_5;
ul__meas.rxq__f__u() = ANY_VALUE;
ul__meas.rxq__s__u() = ANY_VALUE;
ul__meas.supp__meas__info() = OMIT_VALUE;
current_location.update_lineno(2375);
/* BTS_Tests.ttcn, line 2375 */
if (const_cast< const ConnL1Pars&>(l1p).toa256__enabled()) {
current_location.update_lineno(2376);
/* BTS_Tests.ttcn, line 2376 */
ul__meas.len() = 11;
current_location.update_lineno(2377);
/* BTS_Tests.ttcn, line 2377 */
{
RSL__Types::RSL__IE__UplinkMeasSuppMeasInfo_template& tmp_248 = ul__meas.supp__meas__info();
tmp_248.toa256__mean() = f__tolerance(const_cast< const ConnL1Pars&>(l1p).timing__offset__256syms(), -16128, 49152, mp__tolerance__timing__offset__256syms);
tmp_248.toa256__min() = ANY_VALUE;
tmp_248.toa256__max() = ANY_VALUE;
tmp_248.toa256__std__dev() = ANY_VALUE;
}
}
current_location.update_lineno(2384);
/* BTS_Tests.ttcn, line 2384 */
RSL__Types::RSL__IE__BS__Power_template bs__power;
bs__power.reserved() = 0;
bs__power.epc() = FALSE;
bs__power.fpc() = FALSE;
bs__power.power__level() = const_cast< const ConnL1Pars&>(l1p).bs__power__level();
current_location.update_lineno(2391);
/* BTS_Tests.ttcn, line 2391 */
return RSL__Types::tr__RSL__MEAS__RES__EMPTY(GSM__Types::RslChannelNr_template(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr), INTEGER_template(ConnHdlr_component_g__next__meas__res__nr), ul__meas, bs__power);
}

void start_f__build__meas__res__tmpl__empty(const COMPONENT& component_reference)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_build_meas_res_tmpl_empty(");
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_build_meas_res_tmpl_empty", text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

alt_status as__meas__res_instance(const BOOLEAN& verify__meas, boolean first_alt_run)
{
TTCN_Location current_location("BTS_Tests.ttcn", 2395, TTCN_Location::LOCATION_ALTSTEP, "as_meas_res");
current_location.update_lineno(2396);
/* BTS_Tests.ttcn, line 2396 */
RSL__Types::RSL__Message rsl;
current_location.update_lineno(2397);
/* BTS_Tests.ttcn, line 2397 */
BOOLEAN chan__est;
static BOOLEAN chan__est_init;
if (first_alt_run) {
chan__est_init = FALSE;
}
chan__est = chan__est_init;
alt_status ret_val = ALT_NO;
current_location.update_lineno(2399);
/* BTS_Tests.ttcn, line 2399 */
static boolean guard_expr_0 = FALSE;
if (first_alt_run) {
guard_expr_0 = (!(verify__meas));
}
if (guard_expr_0) {
current_location.update_lineno(2399);
/* BTS_Tests.ttcn, line 2399 */
switch (RSL__Emulation::RSL__DchanHdlr_component_RSL.receive(RSL__Types::tr__RSL__MEAS__RES(GSM__Types::RslChannelNr_template(ANY_VALUE), RSL__Types::tr__RSL__MEAS__RES_meas__res__nr_defval, RSL__Types::tr__RSL__MEAS__RES_ul__meas_defval, RSL__Types::tr__RSL__MEAS__RES_bs__power_defval), NULL, any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(2399);
/* BTS_Tests.ttcn, line 2399 */
return ALT_REPEAT;
}
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
}
current_location.update_lineno(2404);
/* BTS_Tests.ttcn, line 2404 */
switch (RSL__Emulation::RSL__DchanHdlr_component_RSL.receive(f__build__meas__res__tmpl(), &(rsl), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(2406);
/* BTS_Tests.ttcn, line 2406 */
{
INTEGER tmp_249;
tmp_249 = mod((ConnHdlr_component_g__next__meas__res__nr + 1), 256);
ConnHdlr_component_g__next__meas__res__nr = tmp_249;
}
current_location.update_lineno(2408);
/* BTS_Tests.ttcn, line 2408 */
Osmocom__Types::f__timer__safe__restart(ConnHdlr_component_g__Tmeas__exp);
current_location.update_lineno(2415);
/* BTS_Tests.ttcn, line 2415 */
chan__est = TRUE;
current_location.update_lineno(2417);
/* BTS_Tests.ttcn, line 2417 */
return ALT_REPEAT;
}
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
current_location.update_lineno(2424);
/* BTS_Tests.ttcn, line 2424 */
static boolean guard_expr_2 = FALSE;
if (first_alt_run) {
guard_expr_2 = (chan__est == FALSE);
}
if (guard_expr_2) {
current_location.update_lineno(2424);
/* BTS_Tests.ttcn, line 2424 */
switch (RSL__Emulation::RSL__DchanHdlr_component_RSL.receive(f__build__meas__res__tmpl__empty(), &(rsl), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(2426);
/* BTS_Tests.ttcn, line 2426 */
{
INTEGER tmp_251;
tmp_251 = mod((ConnHdlr_component_g__next__meas__res__nr + 1), 256);
ConnHdlr_component_g__next__meas__res__nr = tmp_251;
}
current_location.update_lineno(2428);
/* BTS_Tests.ttcn, line 2428 */
Osmocom__Types::f__timer__safe__restart(ConnHdlr_component_g__Tmeas__exp);
current_location.update_lineno(2429);
/* BTS_Tests.ttcn, line 2429 */
return ALT_REPEAT;
}
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
}
current_location.update_lineno(2438);
/* BTS_Tests.ttcn, line 2438 */
static boolean guard_expr_3 = FALSE;
if (first_alt_run) {
guard_expr_3 = (chan__est == FALSE);
}
if (guard_expr_3) {
current_location.update_lineno(2438);
/* BTS_Tests.ttcn, line 2438 */
switch (RSL__Emulation::RSL__DchanHdlr_component_RSL.receive(RSL__Types::tr__RSL__MEAS__RES(GSM__Types::RslChannelNr_template(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr), INTEGER_template(ConnHdlr_component_g__next__meas__res__nr), RSL__Types::tr__RSL__MEAS__RES_ul__meas_defval, RSL__Types::tr__RSL__MEAS__RES_bs__power_defval), &(rsl), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(2440);
/* BTS_Tests.ttcn, line 2440 */
{
INTEGER tmp_252;
tmp_252 = mod((ConnHdlr_component_g__next__meas__res__nr + 1), 256);
ConnHdlr_component_g__next__meas__res__nr = tmp_252;
}
current_location.update_lineno(2441);
/* BTS_Tests.ttcn, line 2441 */
if (ConnHdlr_component_g__first__meas__res) {
current_location.update_lineno(2442);
/* BTS_Tests.ttcn, line 2442 */
ConnHdlr_component_g__first__meas__res = FALSE;
current_location.update_lineno(2443);
/* BTS_Tests.ttcn, line 2443 */
return ALT_REPEAT;
}
else {
current_location.update_lineno(2445);
/* BTS_Tests.ttcn, line 2445 */
Misc__Helpers::f__shutdown(cs_4, 2445, FAIL, (TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Received unspecific MEAS RES "),rsl.log(),TTCN_Logger::end_event_log2str()));
}
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
}
current_location.update_lineno(2448);
/* BTS_Tests.ttcn, line 2448 */
switch (RSL__Emulation::RSL__DchanHdlr_component_RSL.receive(RSL__Types::tr__RSL__MEAS__RES(GSM__Types::RslChannelNr_template(ANY_VALUE), RSL__Types::tr__RSL__MEAS__RES_meas__res__nr_defval, RSL__Types::tr__RSL__MEAS__RES_ul__meas_defval, RSL__Types::tr__RSL__MEAS__RES_bs__power_defval), &(rsl), any_compref, NULL, NULL, NULL)) {
case ALT_YES:
{
current_location.update_lineno(2449);
/* BTS_Tests.ttcn, line 2449 */
Misc__Helpers::f__shutdown(cs_4, 2449, FAIL, (TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Received unexpected MEAS RES "),rsl.log(),TTCN_Logger::end_event_log2str()));
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
current_location.update_lineno(2451);
/* BTS_Tests.ttcn, line 2451 */
static boolean guard_expr_5 = FALSE;
if (first_alt_run) {
guard_expr_5 = ConnHdlr_component_g__Tmeas__exp.running(NULL);
}
if (guard_expr_5) {
current_location.update_lineno(2451);
/* BTS_Tests.ttcn, line 2451 */
switch (ConnHdlr_component_g__Tmeas__exp.timeout(NULL)) {
case ALT_YES:
{
current_location.update_lineno(2452);
/* BTS_Tests.ttcn, line 2452 */
Misc__Helpers::f__shutdown(cs_4, 2452, FAIL, cs_39);
}
return ALT_YES;
case ALT_MAYBE:
ret_val = ALT_MAYBE;
default:
break;
}
}
return ret_val;
}

void as__meas__res(boolean nodefault_modifier, const BOOLEAN& verify__meas)
{
altstep_begin:
boolean block_flag = FALSE;
alt_status altstep_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED;
for ( ; ; ) {
TTCN_Snapshot::take_new(block_flag);
if (altstep_flag != ALT_NO) {
altstep_flag = as__meas__res_instance(verify__meas, !block_flag);
if (altstep_flag == ALT_YES || altstep_flag == ALT_BREAK) return;
else if (altstep_flag == ALT_REPEAT) goto altstep_begin;
}
if (!nodefault_modifier && default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps(!block_flag);
if (default_flag == ALT_YES || default_flag == ALT_BREAK) return;
else if (default_flag == ALT_REPEAT) goto altstep_begin;
}
if (altstep_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in altstep as_meas_res.");
else block_flag = TRUE;
}
}

Default_Base *activate_as__meas__res(const BOOLEAN& verify__meas)
{
return new as__meas__res_Default(verify__meas);
}

INTEGER f__alg__id__to__l1ctl(const RSL__Types::RSL__AlgId& rsl__alg__id)
{
TTCN_Location current_location("BTS_Tests.ttcn", 2456, TTCN_Location::LOCATION_FUNCTION, "f_alg_id_to_l1ctl");
{
const RSL__Types::RSL__AlgId &tmp_255 = rsl__alg__id;
current_location.update_lineno(2458);
/* BTS_Tests.ttcn, line 2458 */
if(tmp_255 == RSL__Types::RSL__AlgId::RSL__ALG__ID__A5__0) goto tmp_254_0;
current_location.update_lineno(2459);
/* BTS_Tests.ttcn, line 2459 */
if(tmp_255 == RSL__Types::RSL__AlgId::RSL__ALG__ID__A5__1) goto tmp_254_1;
current_location.update_lineno(2460);
/* BTS_Tests.ttcn, line 2460 */
if(tmp_255 == RSL__Types::RSL__AlgId::RSL__ALG__ID__A5__2) goto tmp_254_2;
current_location.update_lineno(2461);
/* BTS_Tests.ttcn, line 2461 */
if(tmp_255 == RSL__Types::RSL__AlgId::RSL__ALG__ID__A5__3) goto tmp_254_3;
current_location.update_lineno(2462);
/* BTS_Tests.ttcn, line 2462 */
if(tmp_255 == RSL__Types::RSL__AlgId::RSL__ALG__ID__A5__4) goto tmp_254_4;
current_location.update_lineno(2463);
/* BTS_Tests.ttcn, line 2463 */
if(tmp_255 == RSL__Types::RSL__AlgId::RSL__ALG__ID__A5__5) goto tmp_254_5;
current_location.update_lineno(2464);
/* BTS_Tests.ttcn, line 2464 */
if(tmp_255 == RSL__Types::RSL__AlgId::RSL__ALG__ID__A5__6) goto tmp_254_6;
current_location.update_lineno(2465);
/* BTS_Tests.ttcn, line 2465 */
if(tmp_255 == RSL__Types::RSL__AlgId::RSL__ALG__ID__A5__7) goto tmp_254_7;
goto tmp_254_8;
tmp_254_0:
{
current_location.update_lineno(2458);
/* BTS_Tests.ttcn, line 2458 */
return 0;
}
tmp_254_1:
{
current_location.update_lineno(2459);
/* BTS_Tests.ttcn, line 2459 */
return 1;
}
tmp_254_2:
{
current_location.update_lineno(2460);
/* BTS_Tests.ttcn, line 2460 */
return 2;
}
tmp_254_3:
{
current_location.update_lineno(2461);
/* BTS_Tests.ttcn, line 2461 */
return 3;
}
tmp_254_4:
{
current_location.update_lineno(2462);
/* BTS_Tests.ttcn, line 2462 */
return 4;
}
tmp_254_5:
{
current_location.update_lineno(2463);
/* BTS_Tests.ttcn, line 2463 */
return 5;
}
tmp_254_6:
{
current_location.update_lineno(2464);
/* BTS_Tests.ttcn, line 2464 */
return 6;
}
tmp_254_7:
{
current_location.update_lineno(2465);
/* BTS_Tests.ttcn, line 2465 */
return 7;
}
tmp_254_8:
{
current_location.update_lineno(2467);
/* BTS_Tests.ttcn, line 2467 */
Misc__Helpers::f__shutdown(cs_4, 2467, FAIL, cs_40);
current_location.update_lineno(2470);
/* BTS_Tests.ttcn, line 2470 */
TTCN_Runtime::stop_component(MTC_COMPREF);
}
}
}

BITSTRING f__alg__id__to__l3(const RSL__Types::RSL__AlgId& rsl__alg__id)
{
TTCN_Location current_location("BTS_Tests.ttcn", 2475, TTCN_Location::LOCATION_FUNCTION, "f_alg_id_to_l3");
{
const RSL__Types::RSL__AlgId &tmp_257 = rsl__alg__id;
current_location.update_lineno(2477);
/* BTS_Tests.ttcn, line 2477 */
if(tmp_257 == RSL__Types::RSL__AlgId::RSL__ALG__ID__A5__1) goto tmp_256_0;
current_location.update_lineno(2478);
/* BTS_Tests.ttcn, line 2478 */
if(tmp_257 == RSL__Types::RSL__AlgId::RSL__ALG__ID__A5__2) goto tmp_256_1;
current_location.update_lineno(2479);
/* BTS_Tests.ttcn, line 2479 */
if(tmp_257 == RSL__Types::RSL__AlgId::RSL__ALG__ID__A5__3) goto tmp_256_2;
current_location.update_lineno(2480);
/* BTS_Tests.ttcn, line 2480 */
if(tmp_257 == RSL__Types::RSL__AlgId::RSL__ALG__ID__A5__4) goto tmp_256_3;
current_location.update_lineno(2481);
/* BTS_Tests.ttcn, line 2481 */
if(tmp_257 == RSL__Types::RSL__AlgId::RSL__ALG__ID__A5__5) goto tmp_256_4;
current_location.update_lineno(2482);
/* BTS_Tests.ttcn, line 2482 */
if(tmp_257 == RSL__Types::RSL__AlgId::RSL__ALG__ID__A5__6) goto tmp_256_5;
current_location.update_lineno(2483);
/* BTS_Tests.ttcn, line 2483 */
if(tmp_257 == RSL__Types::RSL__AlgId::RSL__ALG__ID__A5__7) goto tmp_256_6;
goto tmp_256_7;
tmp_256_0:
{
current_location.update_lineno(2477);
/* BTS_Tests.ttcn, line 2477 */
return bs_7;
}
tmp_256_1:
{
current_location.update_lineno(2478);
/* BTS_Tests.ttcn, line 2478 */
return bs_8;
}
tmp_256_2:
{
current_location.update_lineno(2479);
/* BTS_Tests.ttcn, line 2479 */
return bs_9;
}
tmp_256_3:
{
current_location.update_lineno(2480);
/* BTS_Tests.ttcn, line 2480 */
return bs_10;
}
tmp_256_4:
{
current_location.update_lineno(2481);
/* BTS_Tests.ttcn, line 2481 */
return bs_11;
}
tmp_256_5:
{
current_location.update_lineno(2482);
/* BTS_Tests.ttcn, line 2482 */
return bs_12;
}
tmp_256_6:
{
current_location.update_lineno(2483);
/* BTS_Tests.ttcn, line 2483 */
return bs_13;
}
tmp_256_7:
{
current_location.update_lineno(2485);
/* BTS_Tests.ttcn, line 2485 */
Misc__Helpers::f__shutdown(cs_4, 2485, FAIL, cs_40);
current_location.update_lineno(2488);
/* BTS_Tests.ttcn, line 2488 */
TTCN_Runtime::stop_component(MTC_COMPREF);
}
}
}

INTEGER f__rach__req__wait__chan__rqd(const INTEGER& ra)
{
TTCN_Location current_location("BTS_Tests.ttcn", 2494, TTCN_Location::LOCATION_FUNCTION, "f_rach_req_wait_chan_rqd");
current_location.update_lineno(2495);
/* BTS_Tests.ttcn, line 2495 */
INTEGER fn;
current_location.update_lineno(2496);
/* BTS_Tests.ttcn, line 2496 */
TIMER T("T", 8.0);
current_location.update_lineno(2499);
/* BTS_Tests.ttcn, line 2499 */
RSL__Emulation::RSL__DchanHdlr_component_RSL.send(RSL__Emulation::ts__RSLDC__ChanRqd__anyFN(int2oct(ra, 1)), FALSE, NULL);
current_location.update_lineno(2501);
/* BTS_Tests.ttcn, line 2501 */
L1CTL__PortType::f__L1CTL__PARAM(ConnHdlr_component_L1CTL, const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).l1__pars().ms__actual__ta(), const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).l1__pars().ms__power__level());
current_location.update_lineno(2503);
/* BTS_Tests.ttcn, line 2503 */
fn = L1CTL__PortType::f__L1CTL__RACH(ConnHdlr_component_L1CTL, ra, L1CTL__PortType::f__L1CTL__RACH_combined_defval, L1CTL__PortType::f__L1CTL__RACH_offset_defval, L1CTL__PortType::f__L1CTL__RACH_chan__nr_defval, L1CTL__PortType::f__L1CTL__RACH_link__id_defval);
current_location.update_lineno(2505);
/* BTS_Tests.ttcn, line 2505 */
T.start();
current_location.update_lineno(2506);
/* BTS_Tests.ttcn, line 2506 */
{
tmp_259:
alt_status tmp_259_alt_flag_0 = ALT_MAYBE;
alt_status tmp_259_alt_flag_1 = ALT_MAYBE;
alt_status tmp_259_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_259_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(2507);
/* BTS_Tests.ttcn, line 2507 */
tmp_259_alt_flag_0 = RSL__Emulation::RSL__DchanHdlr_component_RSL.receive(RSL__Types::tr__RSL__CHAN__RQD(OCTETSTRING_template(int2oct(ra, 1)), INTEGER_template(fn), RSL__Types::tr__RSL__CHAN__RQD_chan__nr_defval, RSL__Types::tr__RSL__CHAN__RQD_acc__del_defval), NULL, any_compref, NULL, NULL, NULL);
if (tmp_259_alt_flag_0 == ALT_YES) {
current_location.update_lineno(2507);
/* BTS_Tests.ttcn, line 2507 */
TTCN_Runtime::setverdict(PASS,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Received CHAN-RQD from RACH REQ"),TTCN_Logger::end_event_log2str()));
break;
}
}
if (tmp_259_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(2508);
/* BTS_Tests.ttcn, line 2508 */
tmp_259_alt_flag_1 = T.timeout(NULL);
if (tmp_259_alt_flag_1 == ALT_YES) {
current_location.update_lineno(2509);
/* BTS_Tests.ttcn, line 2509 */
Misc__Helpers::f__shutdown(cs_4, 2509, FAIL, (TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Timeout waiting for CHAN-RQD from RACH REQ <"),ra.log(),TTCN_Logger::log_event_str(", "),fn.log(),TTCN_Logger::log_char('>'),TTCN_Logger::end_event_log2str()));
break;
}
}
if (tmp_259_default_flag == ALT_MAYBE) {
tmp_259_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_259_default_flag == ALT_YES || tmp_259_default_flag == ALT_BREAK) break;
else if (tmp_259_default_flag == ALT_REPEAT) goto tmp_259;
}
current_location.update_lineno(2506);
/* BTS_Tests.ttcn, line 2506 */
if (tmp_259_alt_flag_0 == ALT_NO && tmp_259_alt_flag_1 == ALT_NO && tmp_259_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file BTS_Tests.ttcn between lines 2506 and 2511.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(2512);
/* BTS_Tests.ttcn, line 2512 */
T.stop();
current_location.update_lineno(2513);
/* BTS_Tests.ttcn, line 2513 */
return fn;
}

void start_f__rach__req__wait__chan__rqd(const COMPONENT& component_reference, const INTEGER& ra)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_rach_req_wait_chan_rqd(");
ra.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_rach_req_wait_chan_rqd", text_buf);
ra.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__l1ctl__est__dchan(L1CTL__PortType::L1CTL__PT& pt, const ConnHdlrPars& pars)
{
TTCN_Location current_location("BTS_Tests.ttcn", 2517, TTCN_Location::LOCATION_FUNCTION, "f_l1ctl_est_dchan");
current_location.update_lineno(2518);
/* BTS_Tests.ttcn, line 2518 */
if ((!(const_cast< const ConnHdlrPars&>(pars).fhp().enabled()))) {
current_location.update_lineno(2519);
/* BTS_Tests.ttcn, line 2519 */
TrxParsItem trx__pars(const_cast< const TrxPars&>(mp__trx__pars)[const_cast< const ConnHdlrPars&>(pars).trx__nr()]);
current_location.update_lineno(2520);
/* BTS_Tests.ttcn, line 2520 */
pt.send(L1CTL__Types::ts__L1CTL__DM__EST__REQ__H0(GSM__Types::RslChannelNr_template(const_cast< const ConnHdlrPars&>(pars).chan__nr()), INTEGER_template(const_cast< const ConnHdlrPars&>(pars).tsc()), INTEGER_template(const_cast< const TrxParsItem&>(trx__pars).arfcn())), FALSE, NULL);
}
else {
current_location.update_lineno(2523);
/* BTS_Tests.ttcn, line 2523 */
pt.send(L1CTL__Types::ts__L1CTL__DM__EST__REQ__H1(GSM__Types::RslChannelNr_template(const_cast< const ConnHdlrPars&>(pars).chan__nr()), INTEGER_template(const_cast< const ConnHdlrPars&>(pars).tsc()), INTEGER_template(const_cast< const ConnHdlrPars&>(pars).fhp().maio__hsn().hsn()), INTEGER_template(const_cast< const ConnHdlrPars&>(pars).fhp().maio__hsn().maio()), L1CTL__Types::L1ctlMA_template(const_cast< const ConnHdlrPars&>(pars).fhp().ma())), FALSE, NULL);
}
}

void f__est__dchan(const BOOLEAN& encr__enable, const RSL__Types::RSL__IE__List& more__ies, const RSL__Types::RSL__IE__ActivationType& act__type)
{
TTCN_Location current_location("BTS_Tests.ttcn", 2531, TTCN_Location::LOCATION_FUNCTION, "f_est_dchan");
current_location.update_lineno(2533);
/* BTS_Tests.ttcn, line 2533 */
GSM__RR__Types::ChannelDescription ch__desc;
current_location.update_lineno(2536);
/* BTS_Tests.ttcn, line 2536 */
f__rsl__chan__act(RSL__Types::RSL__IE__ChannelMode(const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).chan__mode()), encr__enable, more__ies, act__type);
current_location.update_lineno(2539);
/* BTS_Tests.ttcn, line 2539 */
if (const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).fhp().enabled()) {
current_location.update_lineno(2540);
/* BTS_Tests.ttcn, line 2540 */
ch__desc = GSM__RR__Types::ts__ChanDescH1(GSM__Types::RslChannelNr_template(const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).chan__nr()), GSM__RR__Types::MaioHsn_template(const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).fhp().maio__hsn()), INTEGER_template(const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).tsc())).valueof();
}
else {
current_location.update_lineno(2542);
/* BTS_Tests.ttcn, line 2542 */
TrxParsItem trx__pars(const_cast< const TrxPars&>(mp__trx__pars)[const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).trx__nr()]);
current_location.update_lineno(2543);
/* BTS_Tests.ttcn, line 2543 */
ch__desc = GSM__RR__Types::ts__ChanDescH0(GSM__Types::RslChannelNr_template(const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).chan__nr()), INTEGER_template(const_cast< const TrxParsItem&>(trx__pars).arfcn()), INTEGER_template(const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).tsc())).valueof();
}
current_location.update_lineno(2547);
/* BTS_Tests.ttcn, line 2547 */
f__l1ctl__est__dchan(ConnHdlr_component_L1CTL, ConnHdlr_component_g__pars);
current_location.update_lineno(2550);
/* BTS_Tests.ttcn, line 2550 */
if (encr__enable) {
current_location.update_lineno(2551);
/* BTS_Tests.ttcn, line 2551 */
INTEGER alg__id(f__alg__id__to__l1ctl(const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).encr()().alg__id()));
current_location.update_lineno(2552);
/* BTS_Tests.ttcn, line 2552 */
L1CTL__PortType::f__L1CTL__CRYPTO__REQ(ConnHdlr_component_L1CTL, const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).chan__nr(), alg__id, const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).encr()().key());
}
current_location.update_lineno(2556);
/* BTS_Tests.ttcn, line 2556 */
{
boolean tmp_263;
{
RSL__Types::RSL__SpeechDataInd_template tmp_262;
tmp_262.set_type(VALUE_LIST, 2);
tmp_262.list_item(0) = RSL__Types::RSL__SpeechDataInd::RSL__SPDI__SPEECH;
tmp_262.list_item(1) = RSL__Types::RSL__SpeechDataInd::RSL__SPDI__DATA;
tmp_263 = tmp_262.match(const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).chan__mode().spd__ind());
}
if (tmp_263) {
current_location.update_lineno(2557);
/* BTS_Tests.ttcn, line 2557 */
L1CTL__Types::L1ctlTchMode tch__mode;
current_location.update_lineno(2558);
/* BTS_Tests.ttcn, line 2558 */
INTEGER amr__start__codec(0);
current_location.update_lineno(2559);
/* BTS_Tests.ttcn, line 2559 */
BITSTRING amr__codecs__bitmask(bs_0);
{
const RSL__Types::RSL__IE__ChannelMode &tmp_265 = const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).chan__mode();
current_location.update_lineno(2562);
/* BTS_Tests.ttcn, line 2562 */
if(RSL__Types::tr__RSL__ChanMode__SIGN(RSL__Types::tr__RSL__ChanMode__SIGN_t_defval, RSL__Types::tr__RSL__ChanMode__SIGN_dtxd_defval, RSL__Types::tr__RSL__ChanMode__SIGN_dtxu_defval).match(tmp_265)) goto tmp_264_0;
current_location.update_lineno(2565);
/* BTS_Tests.ttcn, line 2565 */
{
boolean tmp_264_1b;
{
RSL__Types::RSL__ChanRateType_template tmp_266;
tmp_266.set_type(VALUE_LIST, 2);
tmp_266.list_item(0) = RSL__Types::RSL__ChanRateType::RSL__CHRT__TCH__F;
tmp_266.list_item(1) = RSL__Types::RSL__ChanRateType::RSL__CHRT__TCH__H;
tmp_264_1b = RSL__Types::tr__RSL__ChanMode(tmp_266, RSL__Types::RSL__ChanModeOct6SpeechAlgo_template(RSL__Types::RSL__ChanModeOct6SpeechAlgo::RSL__CMOD__SP__GSM1)).match(tmp_265);
}
if(tmp_264_1b) goto tmp_264_1;
}
current_location.update_lineno(2567);
/* BTS_Tests.ttcn, line 2567 */
{
boolean tmp_264_2b;
{
RSL__Types::RSL__ChanRateType_template tmp_267;
tmp_267.set_type(VALUE_LIST, 2);
tmp_267.list_item(0) = RSL__Types::RSL__ChanRateType::RSL__CHRT__TCH__F;
tmp_267.list_item(1) = RSL__Types::RSL__ChanRateType::RSL__CHRT__TCH__H;
tmp_264_2b = RSL__Types::tr__RSL__ChanMode(tmp_267, RSL__Types::RSL__ChanModeOct6SpeechAlgo_template(RSL__Types::RSL__ChanModeOct6SpeechAlgo::RSL__CMOD__SP__GSM2)).match(tmp_265);
}
if(tmp_264_2b) goto tmp_264_2;
}
current_location.update_lineno(2569);
/* BTS_Tests.ttcn, line 2569 */
{
boolean tmp_264_3b;
{
RSL__Types::RSL__ChanRateType_template tmp_268;
tmp_268.set_type(VALUE_LIST, 2);
tmp_268.list_item(0) = RSL__Types::RSL__ChanRateType::RSL__CHRT__TCH__F;
tmp_268.list_item(1) = RSL__Types::RSL__ChanRateType::RSL__CHRT__TCH__H;
tmp_264_3b = RSL__Types::tr__RSL__ChanMode(tmp_268, RSL__Types::RSL__ChanModeOct6SpeechAlgo_template(RSL__Types::RSL__ChanModeOct6SpeechAlgo::RSL__CMOD__SP__GSM3)).match(tmp_265);
}
if(tmp_264_3b) goto tmp_264_3;
}
current_location.update_lineno(2573);
/* BTS_Tests.ttcn, line 2573 */
{
boolean tmp_264_4b;
{
RSL__Types::RSL__ChanModeOct6DataRate_template tmp_269;
tmp_269.set_type(VALUE_LIST, 2);
tmp_269.list_item(0) = RSL__Types::RSL__ChanModeOct6DataRate::RSL__CMOD__CSD__T__14k4;
tmp_269.list_item(1) = RSL__Types::RSL__ChanModeOct6DataRate::RSL__CMOD__CSD__NT__14k5;
tmp_264_4b = RSL__Types::tr__RSL__ChanMode__DATA(RSL__Types::RSL__ChanRateType_template(RSL__Types::RSL__ChanRateType::RSL__CHRT__TCH__F), tmp_269, RSL__Types::tr__RSL__ChanMode__DATA_dtxd_defval, RSL__Types::tr__RSL__ChanMode__DATA_dtxu_defval).match(tmp_265);
}
if(tmp_264_4b) goto tmp_264_4;
}
current_location.update_lineno(2576);
/* BTS_Tests.ttcn, line 2576 */
{
boolean tmp_264_5b;
{
RSL__Types::RSL__ChanModeOct6DataRate_template tmp_270;
tmp_270.set_type(VALUE_LIST, 2);
tmp_270.list_item(0) = RSL__Types::RSL__ChanModeOct6DataRate::RSL__CMOD__CSD__T__9k6;
tmp_270.list_item(1) = RSL__Types::RSL__ChanModeOct6DataRate::RSL__CMOD__CSD__NT__12k0;
tmp_264_5b = RSL__Types::tr__RSL__ChanMode__DATA(RSL__Types::RSL__ChanRateType_template(RSL__Types::RSL__ChanRateType::RSL__CHRT__TCH__F), tmp_270, RSL__Types::tr__RSL__ChanMode__DATA_dtxd_defval, RSL__Types::tr__RSL__ChanMode__DATA_dtxu_defval).match(tmp_265);
}
if(tmp_264_5b) goto tmp_264_5;
}
current_location.update_lineno(2579);
/* BTS_Tests.ttcn, line 2579 */
{
boolean tmp_264_6b;
{
RSL__Types::RSL__ChanRateType_template tmp_271;
tmp_271.set_type(VALUE_LIST, 2);
tmp_271.list_item(0) = RSL__Types::RSL__ChanRateType::RSL__CHRT__TCH__F;
tmp_271.list_item(1) = RSL__Types::RSL__ChanRateType::RSL__CHRT__TCH__H;
RSL__Types::RSL__ChanModeOct6DataRate_template tmp_272;
tmp_272.set_type(VALUE_LIST, 2);
tmp_272.list_item(0) = RSL__Types::RSL__ChanModeOct6DataRate::RSL__CMOD__CSD__T__4k8;
tmp_272.list_item(1) = RSL__Types::RSL__ChanModeOct6DataRate::RSL__CMOD__CSD__NT__6k0;
tmp_264_6b = RSL__Types::tr__RSL__ChanMode__DATA(tmp_271, tmp_272, RSL__Types::tr__RSL__ChanMode__DATA_dtxd_defval, RSL__Types::tr__RSL__ChanMode__DATA_dtxu_defval).match(tmp_265);
}
if(tmp_264_6b) goto tmp_264_6;
}
current_location.update_lineno(2582);
/* BTS_Tests.ttcn, line 2582 */
{
boolean tmp_264_7b;
{
RSL__Types::RSL__ChanRateType_template tmp_273;
tmp_273.set_type(VALUE_LIST, 2);
tmp_273.list_item(0) = RSL__Types::RSL__ChanRateType::RSL__CHRT__TCH__F;
tmp_273.list_item(1) = RSL__Types::RSL__ChanRateType::RSL__CHRT__TCH__H;
RSL__Types::RSL__ChanModeOct6DataRate_template tmp_274;
tmp_274.set_type(VALUE_LIST, 4);
tmp_274.list_item(0) = RSL__Types::RSL__ChanModeOct6DataRate::RSL__CMOD__CSD__T__2k4;
tmp_274.list_item(1) = RSL__Types::RSL__ChanModeOct6DataRate::RSL__CMOD__CSD__T__1k2;
tmp_274.list_item(2) = RSL__Types::RSL__ChanModeOct6DataRate::RSL__CMOD__CSD__T__600;
tmp_274.list_item(3) = RSL__Types::RSL__ChanModeOct6DataRate::RSL__CMOD__CSD__T__1200__75;
tmp_264_7b = RSL__Types::tr__RSL__ChanMode__DATA(tmp_273, tmp_274, RSL__Types::tr__RSL__ChanMode__DATA_dtxd_defval, RSL__Types::tr__RSL__ChanMode__DATA_dtxu_defval).match(tmp_265);
}
if(tmp_264_7b) goto tmp_264_7;
}
goto tmp_264_8;
tmp_264_0:
{
current_location.update_lineno(2563);
/* BTS_Tests.ttcn, line 2563 */
tch__mode = L1CTL__Types::L1ctlTchMode::L1CTL__CHAN__MODE__SIGN;
goto tmp_264_end;
}
tmp_264_1:
{
current_location.update_lineno(2566);
/* BTS_Tests.ttcn, line 2566 */
tch__mode = L1CTL__Types::L1ctlTchMode::L1CTL__CHAN__MODE__SPEECH__V1;
goto tmp_264_end;
}
tmp_264_2:
{
current_location.update_lineno(2568);
/* BTS_Tests.ttcn, line 2568 */
tch__mode = L1CTL__Types::L1ctlTchMode::L1CTL__CHAN__MODE__SPEECH__V2;
goto tmp_264_end;
}
tmp_264_3:
{
current_location.update_lineno(2570);
/* BTS_Tests.ttcn, line 2570 */
tch__mode = L1CTL__Types::L1ctlTchMode::L1CTL__CHAN__MODE__SPEECH__V3;
current_location.update_lineno(2571);
/* BTS_Tests.ttcn, line 2571 */
amr__codecs__bitmask = const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).mr__conf()().codec__modes();
goto tmp_264_end;
}
tmp_264_4:
{
current_location.update_lineno(2575);
/* BTS_Tests.ttcn, line 2575 */
tch__mode = L1CTL__Types::L1ctlTchMode::L1CTL__CHAN__MODE__DATA__14k5;
goto tmp_264_end;
}
tmp_264_5:
{
current_location.update_lineno(2578);
/* BTS_Tests.ttcn, line 2578 */
tch__mode = L1CTL__Types::L1ctlTchMode::L1CTL__CHAN__MODE__DATA__12k0;
goto tmp_264_end;
}
tmp_264_6:
{
current_location.update_lineno(2581);
/* BTS_Tests.ttcn, line 2581 */
tch__mode = L1CTL__Types::L1ctlTchMode::L1CTL__CHAN__MODE__DATA__6k0;
goto tmp_264_end;
}
tmp_264_7:
{
current_location.update_lineno(2585);
/* BTS_Tests.ttcn, line 2585 */
tch__mode = L1CTL__Types::L1ctlTchMode::L1CTL__CHAN__MODE__DATA__3k6;
goto tmp_264_end;
}
tmp_264_8:
{
current_location.update_lineno(2587);
/* BTS_Tests.ttcn, line 2587 */
TTCN_Logger::log_str(TTCN_USER, "RSL channel mode is not supported by the L1, falling back to signalling");
current_location.update_lineno(2588);
/* BTS_Tests.ttcn, line 2588 */
tch__mode = L1CTL__Types::L1ctlTchMode::L1CTL__CHAN__MODE__SIGN;
goto tmp_264_end;
}
tmp_264_end: /* empty */;
}
current_location.update_lineno(2592);
/* BTS_Tests.ttcn, line 2592 */
L1CTL__PortType::f__L1CTL__TCH__MODE(ConnHdlr_component_L1CTL, L1CTL__Types::ts__L1CTL__TCH__MODE__REQ(L1CTL__Types::L1ctlTchMode_template(tch__mode), L1CTL__Types::ts__L1CTL__TCH__MODE__REQ_audio__mode_defval, L1CTL__Types::ts__L1CTL__TCH__MODE__REQ_loop__mode_defval, INTEGER_template(amr__start__codec), BITSTRING_template(amr__codecs__bitmask)));
}
}
current_location.update_lineno(2598);
/* BTS_Tests.ttcn, line 2598 */
ConnHdlr_component_g__first__meas__res = TRUE;
}

void start_f__est__dchan(const COMPONENT& component_reference, const BOOLEAN& encr__enable, const RSL__Types::RSL__IE__List& more__ies, const RSL__Types::RSL__IE__ActivationType& act__type)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_est_dchan(");
encr__enable.log();
TTCN_Logger::log_event_str(", ");
more__ies.log();
TTCN_Logger::log_event_str(", ");
act__type.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_est_dchan", text_buf);
encr__enable.encode_text(text_buf);
more__ies.encode_text(text_buf);
act__type.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

INTEGER get__start__amr__ft()
{
TTCN_Location current_location("BTS_Tests.ttcn", 2601, TTCN_Location::LOCATION_FUNCTION, "get_start_amr_ft");
current_location.update_lineno(2602);
/* BTS_Tests.ttcn, line 2602 */
INTEGER start__nth;
current_location.update_lineno(2603);
/* BTS_Tests.ttcn, line 2603 */
if (const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).mr__conf()().icmi()) {
current_location.update_lineno(2604);
/* BTS_Tests.ttcn, line 2604 */
start__nth = 0;
}
else {
current_location.update_lineno(2606);
/* BTS_Tests.ttcn, line 2606 */
start__nth = const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).mr__conf()().start__mode();
}
current_location.update_lineno(2609);
/* BTS_Tests.ttcn, line 2609 */
INTEGER n(0);
{
current_location.update_lineno(2610);
/* BTS_Tests.ttcn, line 2610 */
INTEGER i(7);
current_location.update_lineno(2610);
/* BTS_Tests.ttcn, line 2610 */
for ( ; ; ) {
current_location.update_lineno(2610);
/* BTS_Tests.ttcn, line 2610 */
if (!(i >= 0)) break;
current_location.update_lineno(2611);
/* BTS_Tests.ttcn, line 2611 */
if ((const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).mr__conf()().codec__modes()[i] == bs_1)) {
current_location.update_lineno(2612);
/* BTS_Tests.ttcn, line 2612 */
if ((n == start__nth)) {
current_location.update_lineno(2613);
/* BTS_Tests.ttcn, line 2613 */
return (7 - i);
}
current_location.update_lineno(2615);
/* BTS_Tests.ttcn, line 2615 */
{
INTEGER tmp_288;
++n;
}
}
current_location.update_lineno(2610);
/* BTS_Tests.ttcn, line 2610 */
{
INTEGER tmp_289;
--i;
}
}
}
current_location.update_lineno(2618);
/* BTS_Tests.ttcn, line 2618 */
Misc__Helpers::f__shutdown(cs_4, 2618, FAIL, (TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("mr_conf is wrong! "),const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).mr__conf().log(),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(2620);
/* BTS_Tests.ttcn, line 2620 */
return 0;
}

void start_get__start__amr__ft(const COMPONENT& component_reference)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function get_start_amr_ft(");
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "get_start_amr_ft", text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__rtpem__activate(const RTP__Emulation::RtpemConfig& cfg, const RTP__Emulation::RtpemMode& mode, const INTEGER& rtp__pt)
{
TTCN_Location current_location("BTS_Tests.ttcn", 2624, TTCN_Location::LOCATION_FUNCTION, "f_rtpem_activate");
current_location.update_lineno(2629);
/* BTS_Tests.ttcn, line 2629 */
ConnHdlr_component_vc__RTPEM = TTCN_Runtime::create_component("RTP_Emulation", "RTP_Emulation_CT", (TTCN_Runtime::get_testcasename() + cs_41), NULL, FALSE);
current_location.update_lineno(2630);
/* BTS_Tests.ttcn, line 2630 */
{
Map_Params tmp_291(0);
TTCN_Runtime::map_port(ConnHdlr_component_vc__RTPEM, RTP__Emulation::RTP__Emulation__CT_component_RTP.get_name(), SYSTEM_COMPREF, "RTP", tmp_291);
}
current_location.update_lineno(2631);
/* BTS_Tests.ttcn, line 2631 */
{
Map_Params tmp_292(0);
TTCN_Runtime::map_port(ConnHdlr_component_vc__RTPEM, RTP__Emulation::RTP__Emulation__CT_component_RTCP.get_name(), SYSTEM_COMPREF, "RTCP", tmp_292);
}
current_location.update_lineno(2632);
/* BTS_Tests.ttcn, line 2632 */
TTCN_Runtime::connect_port(ConnHdlr_component_vc__RTPEM, RTP__Emulation::RTP__Emulation__CT_component_CTRL.get_name(), self, ConnHdlr_component_RTPEM__CTRL.get_name());
current_location.update_lineno(2633);
/* BTS_Tests.ttcn, line 2633 */
TTCN_Runtime::connect_port(ConnHdlr_component_vc__RTPEM, RTP__Emulation::RTP__Emulation__CT_component_DATA.get_name(), self, ConnHdlr_component_RTPEM__DATA.get_name());
current_location.update_lineno(2634);
/* BTS_Tests.ttcn, line 2634 */
RTP__Emulation::start_f__main(ConnHdlr_component_vc__RTPEM);
current_location.update_lineno(2637);
/* BTS_Tests.ttcn, line 2637 */
RTP__Emulation::f__rtpem__configure(ConnHdlr_component_RTPEM__CTRL, cfg);
current_location.update_lineno(2640);
/* BTS_Tests.ttcn, line 2640 */
INTEGER rtpem__bind__port(mp__rtpem__bind__port);
current_location.update_lineno(2641);
/* BTS_Tests.ttcn, line 2641 */
RTP__Emulation::f__rtpem__bind(ConnHdlr_component_RTPEM__CTRL, mp__rtpem__bind__ip, rtpem__bind__port);
current_location.update_lineno(2644);
/* BTS_Tests.ttcn, line 2644 */
RSL__Types::RSL__Message crcx__ack(f__rsl__transceive__ret(RSL__Types::ts__RSL__IPA__CRCX(GSM__Types::RslChannelNr_template(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr), OCTETSTRING_template(OMIT_VALUE), INTEGER_template(OMIT_VALUE), RSL__Types::ts__RSL__IPA__CRCX_osmux__cid_defval), RSL__Types::tr__RSL__IPA__CRCX__ACK(GSM__Types::RslChannelNr_template(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr), INTEGER_template(ANY_VALUE), OCTETSTRING_template(ANY_VALUE), INTEGER_template(ANY_VALUE), INTEGER_template(OMIT_VALUE)), cs_42, f__rsl__transceive__ret_ignore__other_defval));
current_location.update_lineno(2650);
/* BTS_Tests.ttcn, line 2650 */
INTEGER conn__id(const_cast< const RSL__Types::RSL__Message&>(crcx__ack).ies()()[1].body().ipa__conn__id());
current_location.update_lineno(2653);
/* BTS_Tests.ttcn, line 2653 */
RSL__Types::RSL__Message mdcx__ack(f__rsl__transceive__ret(RSL__Types::ts__RSL__IPA__MDCX(GSM__Types::RslChannelNr_template(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr), conn__id, Native__Functions::f__inet__addr(mp__rtpem__bind__ip), rtpem__bind__port, rtp__pt, RSL__Types::ts__RSL__IPA__MDCX_osmux__cid_defval), RSL__Types::tr__RSL__IPA__MDCX__ACK(GSM__Types::RslChannelNr_template(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr), INTEGER_template(conn__id), OCTETSTRING_template(ANY_VALUE), INTEGER_template(ANY_VALUE), INTEGER_template(ANY_VALUE), RSL__Types::tr__RSL__IPA__MDCX__ACK_osmux__cid_defval), cs_43, f__rsl__transceive__ret_ignore__other_defval));
current_location.update_lineno(2662);
/* BTS_Tests.ttcn, line 2662 */
CHARSTRING bts__bind__ip(Native__Functions::f__inet__ntoa(const_cast< const RSL__Types::RSL__Message&>(mdcx__ack).ies()()[2].body().ipa__local__ip()));
current_location.update_lineno(2663);
/* BTS_Tests.ttcn, line 2663 */
INTEGER bts__bind__port(const_cast< const RSL__Types::RSL__Message&>(mdcx__ack).ies()()[3].body().ipa__local__port());
current_location.update_lineno(2664);
/* BTS_Tests.ttcn, line 2664 */
RTP__Emulation::f__rtpem__connect(ConnHdlr_component_RTPEM__CTRL, bts__bind__ip, bts__bind__port);
current_location.update_lineno(2667);
/* BTS_Tests.ttcn, line 2667 */
RTP__Emulation::f__rtpem__mode(ConnHdlr_component_RTPEM__CTRL, mode);
}

void start_f__rtpem__activate(const COMPONENT& component_reference, const RTP__Emulation::RtpemConfig& cfg, const RTP__Emulation::RtpemMode& mode, const INTEGER& rtp__pt)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_rtpem_activate(");
cfg.log();
TTCN_Logger::log_event_str(", ");
mode.log();
TTCN_Logger::log_event_str(", ");
rtp__pt.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_rtpem_activate", text_buf);
cfg.encode_text(text_buf);
mode.encode_text(text_buf);
rtp__pt.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__osmuxem__activate(OCTETSTRING& payload, const OSMUX__Emulation::OsmuxemConfig& cfg, const OSMUX__Emulation::OsmuxemMode& mode)
{
OSMUX__Emulation::OsmuxemConfig cfg_shadow(cfg);
TTCN_Location current_location("BTS_Tests.ttcn", 2671, TTCN_Location::LOCATION_FUNCTION, "f_osmuxem_activate");
current_location.update_lineno(2675);
/* BTS_Tests.ttcn, line 2675 */
RSL__Types::RSL__IE__Body ie;
current_location.update_lineno(2676);
/* BTS_Tests.ttcn, line 2676 */
OSMUX__Emulation::OsmuxTxHandle tx__hdl;
current_location.update_lineno(2677);
/* BTS_Tests.ttcn, line 2677 */
OSMUX__Emulation::OsmuxRxHandle rx__hdl;
current_location.update_lineno(2679);
/* BTS_Tests.ttcn, line 2679 */
ConnHdlr_component_vc__OsmuxEM = TTCN_Runtime::create_component("OSMUX_Emulation", "OSMUX_Emulation_CT", (TTCN_Runtime::get_testcasename() + cs_44), NULL, FALSE);
current_location.update_lineno(2680);
/* BTS_Tests.ttcn, line 2680 */
{
Map_Params tmp_294(0);
TTCN_Runtime::map_port(ConnHdlr_component_vc__OsmuxEM, OSMUX__Emulation::OSMUX__Emulation__CT_component_OSMUX.get_name(), SYSTEM_COMPREF, "OSMUX", tmp_294);
}
current_location.update_lineno(2681);
/* BTS_Tests.ttcn, line 2681 */
TTCN_Runtime::connect_port(ConnHdlr_component_vc__OsmuxEM, OSMUX__Emulation::OSMUX__Emulation__CT_component_CTRL.get_name(), self, ConnHdlr_component_OsmuxEM__CTRL.get_name());
current_location.update_lineno(2682);
/* BTS_Tests.ttcn, line 2682 */
TTCN_Runtime::connect_port(ConnHdlr_component_vc__OsmuxEM, OSMUX__Emulation::OSMUX__Emulation__CT_component_DATA.get_name(), self, ConnHdlr_component_OsmuxEM__DATA.get_name());
current_location.update_lineno(2683);
/* BTS_Tests.ttcn, line 2683 */
OSMUX__Emulation::start_f__main(ConnHdlr_component_vc__OsmuxEM);
current_location.update_lineno(2686);
/* BTS_Tests.ttcn, line 2686 */
INTEGER payload__len(31);
current_location.update_lineno(2687);
/* BTS_Tests.ttcn, line 2687 */
OCTETSTRING hdr(os_2);
current_location.update_lineno(2690);
/* BTS_Tests.ttcn, line 2690 */
payload = Osmocom__Types::f__pad__oct((hdr + payload), payload__len, os_1);
current_location.update_lineno(2691);
/* BTS_Tests.ttcn, line 2691 */
cfg_shadow.tx__fixed__payload() = payload;
current_location.update_lineno(2692);
/* BTS_Tests.ttcn, line 2692 */
OSMUX__Emulation::f__osmuxem__configure(ConnHdlr_component_OsmuxEM__CTRL, cfg_shadow);
current_location.update_lineno(2695);
/* BTS_Tests.ttcn, line 2695 */
INTEGER osmuxem__bind__port(mp__osmuxem__bind__port);
current_location.update_lineno(2696);
/* BTS_Tests.ttcn, line 2696 */
OSMUX__Emulation::f__osmuxem__bind(ConnHdlr_component_OsmuxEM__CTRL, mp__osmuxem__bind__ip, osmuxem__bind__port);
current_location.update_lineno(2697);
/* BTS_Tests.ttcn, line 2697 */
rx__hdl = OSMUX__Emulation::c__OsmuxemDefaultRxHandle;
current_location.update_lineno(2698);
/* BTS_Tests.ttcn, line 2698 */
rx__hdl.cid() = const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).loc__osmux__cid();
current_location.update_lineno(2699);
/* BTS_Tests.ttcn, line 2699 */
OSMUX__Emulation::f__osmuxem__register__rxhandle(ConnHdlr_component_OsmuxEM__CTRL, rx__hdl);
current_location.update_lineno(2702);
/* BTS_Tests.ttcn, line 2702 */
RSL__Types::RSL__Message crcx__ack(f__rsl__transceive__ret(RSL__Types::ts__RSL__IPA__CRCX(GSM__Types::RslChannelNr_template(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr), OCTETSTRING_template(OMIT_VALUE), INTEGER_template(OMIT_VALUE), INTEGER_template(const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).loc__osmux__cid())), RSL__Types::tr__RSL__IPA__CRCX__ACK(GSM__Types::RslChannelNr_template(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr), INTEGER_template(ANY_VALUE), OCTETSTRING_template(ANY_VALUE), INTEGER_template(ANY_VALUE), INTEGER_template(ANY_VALUE)), cs_42, f__rsl__transceive__ret_ignore__other_defval));
current_location.update_lineno(2708);
/* BTS_Tests.ttcn, line 2708 */
INTEGER conn__id(const_cast< const RSL__Types::RSL__Message&>(crcx__ack).ies()()[1].body().ipa__conn__id());
current_location.update_lineno(2709);
/* BTS_Tests.ttcn, line 2709 */
{
RSL__Types::RSL__IE__Body tmp_299;
RSL__Types::f__rsl__find__ie(crcx__ack, RSL__Types::RSL__IE__Type::RSL__IE__OSMO__OSMUX__CID, tmp_299);
if (tmp_299.is_bound()) ie = tmp_299;
}
current_location.update_lineno(2710);
/* BTS_Tests.ttcn, line 2710 */
ConnHdlr_component_g__pars.rem__osmux__cid() = const_cast< const RSL__Types::RSL__IE__Body&>(ie).osmux__cid().cid();
current_location.update_lineno(2714);
/* BTS_Tests.ttcn, line 2714 */
RSL__Types::RSL__Message mdcx__ack(f__rsl__transceive__ret(RSL__Types::ts__RSL__IPA__MDCX(GSM__Types::RslChannelNr_template(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr), conn__id, Native__Functions::f__inet__addr(mp__osmuxem__bind__ip), osmuxem__bind__port, 0, INTEGER_template(const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).loc__osmux__cid())), RSL__Types::tr__RSL__IPA__MDCX__ACK(GSM__Types::RslChannelNr_template(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr), INTEGER_template(conn__id), OCTETSTRING_template(ANY_VALUE), INTEGER_template(ANY_VALUE), INTEGER_template(ANY_VALUE), INTEGER_template(const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).rem__osmux__cid())), cs_43, f__rsl__transceive__ret_ignore__other_defval));
current_location.update_lineno(2723);
/* BTS_Tests.ttcn, line 2723 */
tx__hdl = OSMUX__Emulation::t__TxHandleAMR590(const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).rem__osmux__cid()).valueof();
current_location.update_lineno(2724);
/* BTS_Tests.ttcn, line 2724 */
OSMUX__Emulation::f__osmuxem__register__txhandle(ConnHdlr_component_OsmuxEM__CTRL, tx__hdl);
current_location.update_lineno(2727);
/* BTS_Tests.ttcn, line 2727 */
CHARSTRING bts__bind__ip(Native__Functions::f__inet__ntoa(const_cast< const RSL__Types::RSL__Message&>(mdcx__ack).ies()()[2].body().ipa__local__ip()));
current_location.update_lineno(2728);
/* BTS_Tests.ttcn, line 2728 */
INTEGER bts__bind__port(const_cast< const RSL__Types::RSL__Message&>(mdcx__ack).ies()()[3].body().ipa__local__port());
current_location.update_lineno(2729);
/* BTS_Tests.ttcn, line 2729 */
OSMUX__Emulation::f__osmuxem__connect(ConnHdlr_component_OsmuxEM__CTRL, bts__bind__ip, bts__bind__port);
current_location.update_lineno(2732);
/* BTS_Tests.ttcn, line 2732 */
OSMUX__Emulation::f__osmuxem__mode(ConnHdlr_component_OsmuxEM__CTRL, mode);
}

void start_f__osmuxem__activate(const COMPONENT& component_reference, OCTETSTRING& payload, const OSMUX__Emulation::OsmuxemConfig& cfg, const OSMUX__Emulation::OsmuxemMode& mode)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_osmuxem_activate(");
payload.log();
TTCN_Logger::log_event_str(", ");
cfg.log();
TTCN_Logger::log_event_str(", ");
mode.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_osmuxem_activate", text_buf);
payload.encode_text(text_buf);
cfg.encode_text(text_buf);
mode.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__TC__meas__res__periodic(const CHARSTRING& )
{
TTCN_Location current_location("BTS_Tests.ttcn", 2736, TTCN_Location::LOCATION_FUNCTION, "f_TC_meas_res_periodic");
current_location.update_lineno(2737);
/* BTS_Tests.ttcn, line 2737 */
f__l1__tune(ConnHdlr_component_L1CTL, f__l1__tune_ccch__mode_defval);
current_location.update_lineno(2738);
/* BTS_Tests.ttcn, line 2738 */
RSL__Emulation::RSL__DchanHdlr_component_RSL.clear();
current_location.update_lineno(2740);
/* BTS_Tests.ttcn, line 2740 */
if ((mp__bts__trxc__port != -1)) {
current_location.update_lineno(2741);
/* BTS_Tests.ttcn, line 2741 */
f__trxc__fake__rssi(GSM__Types::rxlev2dbm(mp__ul__rxlev__exp));
current_location.update_lineno(2742);
/* BTS_Tests.ttcn, line 2742 */
f__trxc__fake__toffs256(INTEGER(const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).l1__pars().timing__offset__256syms()));
}
current_location.update_lineno(2745);
/* BTS_Tests.ttcn, line 2745 */
f__est__dchan(f__est__dchan_encr__enable_defval, f__est__dchan_more__ies_defval, f__est__dchan_act__type_defval);
current_location.update_lineno(2749);
/* BTS_Tests.ttcn, line 2749 */
TIMER T("T", 8.0);
current_location.update_lineno(2750);
/* BTS_Tests.ttcn, line 2750 */
T.start();
current_location.update_lineno(2751);
/* BTS_Tests.ttcn, line 2751 */
{
tmp_302:
alt_status tmp_302_alt_flag_0 = ALT_MAYBE;
alt_status tmp_302_alt_flag_1 = ALT_MAYBE;
alt_status tmp_302_alt_flag_2 = ALT_MAYBE;
alt_status tmp_302_alt_flag_3 = ALT_MAYBE;
alt_status tmp_302_alt_flag_4 = ALT_MAYBE;
alt_status tmp_302_alt_flag_5 = ALT_UNCHECKED;
alt_status tmp_302_alt_flag_6 = ALT_MAYBE;
alt_status tmp_302_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_302_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(2752);
/* BTS_Tests.ttcn, line 2752 */
tmp_302_alt_flag_0 = as__l1__sacch__loop_instance(first_run);
if (tmp_302_alt_flag_0 == ALT_REPEAT) goto tmp_302;
if (tmp_302_alt_flag_0 == ALT_BREAK) break;
if (tmp_302_alt_flag_0 == ALT_YES) break;
}
if (tmp_302_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(2753);
/* BTS_Tests.ttcn, line 2753 */
tmp_302_alt_flag_1 = as__meas__res_instance(as__meas__res_verify__meas_defval, first_run);
if (tmp_302_alt_flag_1 == ALT_REPEAT) goto tmp_302;
if (tmp_302_alt_flag_1 == ALT_BREAK) break;
if (tmp_302_alt_flag_1 == ALT_YES) break;
}
if (tmp_302_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(2754);
/* BTS_Tests.ttcn, line 2754 */
tmp_302_alt_flag_2 = as__l1__dcch__loop_instance(first_run);
if (tmp_302_alt_flag_2 == ALT_REPEAT) goto tmp_302;
if (tmp_302_alt_flag_2 == ALT_BREAK) break;
if (tmp_302_alt_flag_2 == ALT_YES) break;
}
if (tmp_302_alt_flag_3 == ALT_MAYBE) {
current_location.update_lineno(2755);
/* BTS_Tests.ttcn, line 2755 */
tmp_302_alt_flag_3 = as__l1__tch__loop_instance(first_run);
if (tmp_302_alt_flag_3 == ALT_REPEAT) goto tmp_302;
if (tmp_302_alt_flag_3 == ALT_BREAK) break;
if (tmp_302_alt_flag_3 == ALT_YES) break;
}
if (tmp_302_alt_flag_4 == ALT_MAYBE) {
current_location.update_lineno(2756);
/* BTS_Tests.ttcn, line 2756 */
tmp_302_alt_flag_4 = ConnHdlr_component_L1CTL.receive(any_compref, NULL, NULL, NULL);
if (tmp_302_alt_flag_4 == ALT_YES) {
current_location.update_lineno(2756);
/* BTS_Tests.ttcn, line 2756 */
goto tmp_302;
}
}
if (tmp_302_alt_flag_5 == ALT_UNCHECKED) {
current_location.update_lineno(2757);
/* BTS_Tests.ttcn, line 2757 */
if (ConnHdlr_component_g__Tmeas__exp.running(NULL)) tmp_302_alt_flag_5 = ALT_MAYBE;
else tmp_302_alt_flag_5 = ALT_NO;
}
if (tmp_302_alt_flag_5 == ALT_MAYBE) {
current_location.update_lineno(2757);
/* BTS_Tests.ttcn, line 2757 */
tmp_302_alt_flag_5 = T.timeout(NULL);
if (tmp_302_alt_flag_5 == ALT_YES) {
current_location.update_lineno(2760);
/* BTS_Tests.ttcn, line 2760 */
TTCN_Runtime::setverdict(PASS);
break;
}
}
if (tmp_302_alt_flag_6 == ALT_MAYBE) {
current_location.update_lineno(2762);
/* BTS_Tests.ttcn, line 2762 */
tmp_302_alt_flag_6 = T.timeout(NULL);
if (tmp_302_alt_flag_6 == ALT_YES) {
current_location.update_lineno(2763);
/* BTS_Tests.ttcn, line 2763 */
Misc__Helpers::f__shutdown(cs_4, 2763, FAIL, cs_45);
break;
}
}
if (tmp_302_default_flag == ALT_MAYBE) {
tmp_302_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_302_default_flag == ALT_YES || tmp_302_default_flag == ALT_BREAK) break;
else if (tmp_302_default_flag == ALT_REPEAT) goto tmp_302;
}
current_location.update_lineno(2751);
/* BTS_Tests.ttcn, line 2751 */
if (tmp_302_alt_flag_0 == ALT_NO && tmp_302_alt_flag_1 == ALT_NO && tmp_302_alt_flag_2 == ALT_NO && tmp_302_alt_flag_3 == ALT_NO && tmp_302_alt_flag_4 == ALT_NO && tmp_302_alt_flag_5 == ALT_NO && tmp_302_alt_flag_6 == ALT_NO && tmp_302_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file BTS_Tests.ttcn between lines 2751 and 2765.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(2766);
/* BTS_Tests.ttcn, line 2766 */
f__rsl__chan__deact();
current_location.update_lineno(2767);
/* BTS_Tests.ttcn, line 2767 */
L1CTL__PortType::f__L1CTL__DM__REL__REQ(ConnHdlr_component_L1CTL, RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr);
}

void start_f__TC__meas__res__periodic(const COMPONENT& component_reference, const CHARSTRING& id)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_TC_meas_res_periodic(");
id.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_TC_meas_res_periodic", text_buf);
id.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

INTEGER f__wait__ramp__up()
{
TTCN_Location current_location("BTS_Tests.ttcn", 2771, TTCN_Location::LOCATION_FUNCTION, "f_wait_ramp_up");
current_location.update_lineno(2772);
/* BTS_Tests.ttcn, line 2772 */
L1CTL__Types::L1ctlMessage l1__dl;
current_location.update_lineno(2773);
/* BTS_Tests.ttcn, line 2773 */
INTEGER max__rx__lvl((mp__bts__tx__nom__pwr__exp - mp__bts__tx__pwr__att__exp));
current_location.update_lineno(2774);
/* BTS_Tests.ttcn, line 2774 */
TIMER Tup("Tup", 1.0e1);
current_location.update_lineno(2775);
/* BTS_Tests.ttcn, line 2775 */
Tup.start();
current_location.update_lineno(2776);
/* BTS_Tests.ttcn, line 2776 */
{
tmp_303:
alt_status tmp_303_alt_flag_0 = ALT_MAYBE;
alt_status tmp_303_alt_flag_1 = ALT_MAYBE;
alt_status tmp_303_alt_flag_2 = ALT_MAYBE;
alt_status tmp_303_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_303_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(2777);
/* BTS_Tests.ttcn, line 2777 */
tmp_303_alt_flag_0 = ConnHdlr_component_L1CTL.receive(L1CTL__Types::tr__L1CTL__DATA__IND(GSM__Types::t__RslChanNr__BCCH(INTEGER_template(0)), GSM__Types::RslLinkId_template(ANY_VALUE), L1CTL__Types::tr__L1CTL__DATA__IND_l2__data_defval, L1CTL__Types::tr__L1CTL__DATA__IND_num__biterr_defval, L1CTL__Types::tr__L1CTL__DATA__IND_fire__crc_defval), &(l1__dl), any_compref, NULL, NULL, NULL);
if (tmp_303_alt_flag_0 == ALT_YES) {
current_location.update_lineno(2778);
/* BTS_Tests.ttcn, line 2778 */
INTEGER rx__lvl(const_cast< const L1CTL__Types::L1ctlMessage&>(l1__dl).dl__info()().rx__level());
current_location.update_lineno(2779);
/* BTS_Tests.ttcn, line 2779 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("Received rx_level=");
rx__lvl.log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(2781);
/* BTS_Tests.ttcn, line 2781 */
if ((rx__lvl != max__rx__lvl)) {
current_location.update_lineno(2782);
/* BTS_Tests.ttcn, line 2782 */
goto tmp_303;
}
current_location.update_lineno(2784);
/* BTS_Tests.ttcn, line 2784 */
Tup.stop();
break;
}
}
if (tmp_303_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(2786);
/* BTS_Tests.ttcn, line 2786 */
tmp_303_alt_flag_1 = ConnHdlr_component_L1CTL.receive(any_compref, NULL, NULL, NULL);
if (tmp_303_alt_flag_1 == ALT_YES) {
current_location.update_lineno(2786);
/* BTS_Tests.ttcn, line 2786 */
goto tmp_303;
}
}
if (tmp_303_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(2787);
/* BTS_Tests.ttcn, line 2787 */
tmp_303_alt_flag_2 = Tup.timeout(NULL);
if (tmp_303_alt_flag_2 == ALT_YES) {
current_location.update_lineno(2788);
/* BTS_Tests.ttcn, line 2788 */
Misc__Helpers::f__shutdown(cs_4, 2788, FAIL, (TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Didn't reach full power "),max__rx__lvl.log(),TTCN_Logger::end_event_log2str()));
break;
}
}
if (tmp_303_default_flag == ALT_MAYBE) {
tmp_303_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_303_default_flag == ALT_YES || tmp_303_default_flag == ALT_BREAK) break;
else if (tmp_303_default_flag == ALT_REPEAT) goto tmp_303;
}
current_location.update_lineno(2776);
/* BTS_Tests.ttcn, line 2776 */
if (tmp_303_alt_flag_0 == ALT_NO && tmp_303_alt_flag_1 == ALT_NO && tmp_303_alt_flag_2 == ALT_NO && tmp_303_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file BTS_Tests.ttcn between lines 2776 and 2791.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(2792);
/* BTS_Tests.ttcn, line 2792 */
return max__rx__lvl;
}

void start_f__wait__ramp__up(const COMPONENT& component_reference)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_wait_ramp_up(");
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_wait_ramp_up", text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__verify__ramp__up()
{
TTCN_Location current_location("BTS_Tests.ttcn", 2796, TTCN_Location::LOCATION_FUNCTION, "f_verify_ramp_up");
current_location.update_lineno(2797);
/* BTS_Tests.ttcn, line 2797 */
L1CTL__Types::L1ctlMessage l1__dl;
current_location.update_lineno(2798);
/* BTS_Tests.ttcn, line 2798 */
INTEGER initial__rx__lvl(-1);
current_location.update_lineno(2799);
/* BTS_Tests.ttcn, line 2799 */
INTEGER last__rx__lvl(-1);
current_location.update_lineno(2800);
/* BTS_Tests.ttcn, line 2800 */
INTEGER max__rx__lvl((mp__bts__tx__nom__pwr__exp - mp__bts__tx__pwr__att__exp));
current_location.update_lineno(2802);
/* BTS_Tests.ttcn, line 2802 */
TIMER T("T", 2.0);
current_location.update_lineno(2803);
/* BTS_Tests.ttcn, line 2803 */
{
tmp_304:
alt_status tmp_304_alt_flag_0 = ALT_MAYBE;
alt_status tmp_304_alt_flag_1 = ALT_MAYBE;
alt_status tmp_304_alt_flag_2 = ALT_MAYBE;
alt_status tmp_304_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_304_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(2804);
/* BTS_Tests.ttcn, line 2804 */
tmp_304_alt_flag_0 = ConnHdlr_component_L1CTL.receive(L1CTL__Types::tr__L1CTL__DATA__IND(GSM__Types::t__RslChanNr__BCCH(INTEGER_template(0)), GSM__Types::RslLinkId_template(ANY_VALUE), L1CTL__Types::tr__L1CTL__DATA__IND_l2__data_defval, L1CTL__Types::tr__L1CTL__DATA__IND_num__biterr_defval, L1CTL__Types::tr__L1CTL__DATA__IND_fire__crc_defval), &(l1__dl), any_compref, NULL, NULL, NULL);
if (tmp_304_alt_flag_0 == ALT_YES) {
current_location.update_lineno(2805);
/* BTS_Tests.ttcn, line 2805 */
INTEGER rx__lvl(const_cast< const L1CTL__Types::L1ctlMessage&>(l1__dl).dl__info()().rx__level());
current_location.update_lineno(2806);
/* BTS_Tests.ttcn, line 2806 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("Received rx_level=");
rx__lvl.log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(2807);
/* BTS_Tests.ttcn, line 2807 */
if ((initial__rx__lvl == -1)) {
current_location.update_lineno(2808);
/* BTS_Tests.ttcn, line 2808 */
initial__rx__lvl = rx__lvl;
current_location.update_lineno(2809);
/* BTS_Tests.ttcn, line 2809 */
last__rx__lvl = rx__lvl;
current_location.update_lineno(2812);
/* BTS_Tests.ttcn, line 2812 */
if ((initial__rx__lvl >= (max__rx__lvl / 2))) {
current_location.update_lineno(2813);
/* BTS_Tests.ttcn, line 2813 */
Misc__Helpers::f__shutdown(cs_4, 2813, FAIL, (TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Detected high initial tx power during ramp up: "),initial__rx__lvl.log(),TTCN_Logger::log_event_str(", full power is"),max__rx__lvl.log(),TTCN_Logger::end_event_log2str()));
}
}
current_location.update_lineno(2820);
/* BTS_Tests.ttcn, line 2820 */
if ((rx__lvl > max__rx__lvl)) {
current_location.update_lineno(2821);
/* BTS_Tests.ttcn, line 2821 */
Misc__Helpers::f__shutdown(cs_4, 2821, FAIL, (TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Detected Tx power higher than full power: "),rx__lvl.log(),TTCN_Logger::log_event_str(" > "),max__rx__lvl.log(),TTCN_Logger::end_event_log2str()));
}
current_location.update_lineno(2827);
/* BTS_Tests.ttcn, line 2827 */
if ((last__rx__lvl > rx__lvl)) {
current_location.update_lineno(2828);
/* BTS_Tests.ttcn, line 2828 */
Misc__Helpers::f__shutdown(cs_4, 2828, FAIL, (TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Detected Tx power decrease during ramp up: "),last__rx__lvl.log(),TTCN_Logger::log_event_str(" -> "),rx__lvl.log(),TTCN_Logger::end_event_log2str()));
}
current_location.update_lineno(2833);
/* BTS_Tests.ttcn, line 2833 */
{
boolean tmp_307;
tmp_307 = (rx__lvl == max__rx__lvl);
if (tmp_307) tmp_307 = (!(T.running(NULL)));
if (tmp_307) {
current_location.update_lineno(2836);
/* BTS_Tests.ttcn, line 2836 */
TTCN_Logger::log_str(TTCN_USER, "Reached full power, wating a bit more until success");
current_location.update_lineno(2837);
/* BTS_Tests.ttcn, line 2837 */
T.start();
}
}
current_location.update_lineno(2840);
/* BTS_Tests.ttcn, line 2840 */
last__rx__lvl = rx__lvl;
current_location.update_lineno(2841);
/* BTS_Tests.ttcn, line 2841 */
goto tmp_304;
}
}
if (tmp_304_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(2843);
/* BTS_Tests.ttcn, line 2843 */
tmp_304_alt_flag_1 = ConnHdlr_component_L1CTL.receive(any_compref, NULL, NULL, NULL);
if (tmp_304_alt_flag_1 == ALT_YES) {
current_location.update_lineno(2843);
/* BTS_Tests.ttcn, line 2843 */
goto tmp_304;
}
}
if (tmp_304_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(2844);
/* BTS_Tests.ttcn, line 2844 */
tmp_304_alt_flag_2 = T.timeout(NULL);
if (tmp_304_alt_flag_2 == ALT_YES) break;
}
if (tmp_304_default_flag == ALT_MAYBE) {
tmp_304_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_304_default_flag == ALT_YES || tmp_304_default_flag == ALT_BREAK) break;
else if (tmp_304_default_flag == ALT_REPEAT) goto tmp_304;
}
current_location.update_lineno(2803);
/* BTS_Tests.ttcn, line 2803 */
if (tmp_304_alt_flag_0 == ALT_NO && tmp_304_alt_flag_1 == ALT_NO && tmp_304_alt_flag_2 == ALT_NO && tmp_304_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file BTS_Tests.ttcn between lines 2803 and 2845.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(2848);
/* BTS_Tests.ttcn, line 2848 */
if ((initial__rx__lvl < last__rx__lvl)) {
current_location.update_lineno(2849);
/* BTS_Tests.ttcn, line 2849 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("Tx power increased during ramp up: ");
initial__rx__lvl.log();
TTCN_Logger::log_event_str(" -> ");
last__rx__lvl.log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
}
else {
current_location.update_lineno(2851);
/* BTS_Tests.ttcn, line 2851 */
Misc__Helpers::f__shutdown(cs_4, 2851, FAIL, (TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("No Tx power increase during whole ramp up: "),initial__rx__lvl.log(),TTCN_Logger::log_event_str(" -> "),last__rx__lvl.log(),TTCN_Logger::end_event_log2str()));
}
}

void start_f__verify__ramp__up(const COMPONENT& component_reference)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_verify_ramp_up(");
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_verify_ramp_up", text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__verify__ramp__down(const INTEGER& max__rx__lvl)
{
TTCN_Location current_location("BTS_Tests.ttcn", 2858, TTCN_Location::LOCATION_FUNCTION, "f_verify_ramp_down");
current_location.update_lineno(2859);
/* BTS_Tests.ttcn, line 2859 */
L1CTL__Types::L1ctlMessage l1__dl;
current_location.update_lineno(2860);
/* BTS_Tests.ttcn, line 2860 */
INTEGER last__rx__lvl(max__rx__lvl);
current_location.update_lineno(2862);
/* BTS_Tests.ttcn, line 2862 */
TIMER Tdown("Tdown", 5.0);
current_location.update_lineno(2863);
/* BTS_Tests.ttcn, line 2863 */
Tdown.start();
current_location.update_lineno(2864);
/* BTS_Tests.ttcn, line 2864 */
{
tmp_309:
alt_status tmp_309_alt_flag_0 = ALT_MAYBE;
alt_status tmp_309_alt_flag_1 = ALT_MAYBE;
alt_status tmp_309_alt_flag_2 = ALT_MAYBE;
alt_status tmp_309_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_309_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(2865);
/* BTS_Tests.ttcn, line 2865 */
tmp_309_alt_flag_0 = ConnHdlr_component_L1CTL.receive(L1CTL__Types::tr__L1CTL__DATA__IND(GSM__Types::t__RslChanNr__BCCH(INTEGER_template(0)), GSM__Types::RslLinkId_template(ANY_VALUE), L1CTL__Types::tr__L1CTL__DATA__IND_l2__data_defval, L1CTL__Types::tr__L1CTL__DATA__IND_num__biterr_defval, L1CTL__Types::tr__L1CTL__DATA__IND_fire__crc_defval), &(l1__dl), any_compref, NULL, NULL, NULL);
if (tmp_309_alt_flag_0 == ALT_YES) {
current_location.update_lineno(2866);
/* BTS_Tests.ttcn, line 2866 */
INTEGER rx__lvl(const_cast< const L1CTL__Types::L1ctlMessage&>(l1__dl).dl__info()().rx__level());
current_location.update_lineno(2867);
/* BTS_Tests.ttcn, line 2867 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("Received rx_level=");
rx__lvl.log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(2870);
/* BTS_Tests.ttcn, line 2870 */
if ((rx__lvl > max__rx__lvl)) {
current_location.update_lineno(2871);
/* BTS_Tests.ttcn, line 2871 */
Misc__Helpers::f__shutdown(cs_4, 2871, FAIL, (TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Detected Tx power higher than full power: "),rx__lvl.log(),TTCN_Logger::log_event_str(" > "),max__rx__lvl.log(),TTCN_Logger::end_event_log2str()));
}
current_location.update_lineno(2877);
/* BTS_Tests.ttcn, line 2877 */
if ((last__rx__lvl < rx__lvl)) {
current_location.update_lineno(2878);
/* BTS_Tests.ttcn, line 2878 */
Misc__Helpers::f__shutdown(cs_4, 2878, FAIL, (TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Detected Tx power increase during ramp up: "),last__rx__lvl.log(),TTCN_Logger::log_event_str(" -> "),rx__lvl.log(),TTCN_Logger::end_event_log2str()));
}
current_location.update_lineno(2883);
/* BTS_Tests.ttcn, line 2883 */
last__rx__lvl = rx__lvl;
current_location.update_lineno(2884);
/* BTS_Tests.ttcn, line 2884 */
if ((last__rx__lvl != 0)) {
current_location.update_lineno(2885);
/* BTS_Tests.ttcn, line 2885 */
goto tmp_309;
}
current_location.update_lineno(2888);
/* BTS_Tests.ttcn, line 2888 */
Tdown.stop();
break;
}
}
if (tmp_309_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(2890);
/* BTS_Tests.ttcn, line 2890 */
tmp_309_alt_flag_1 = ConnHdlr_component_L1CTL.receive(any_compref, NULL, NULL, NULL);
if (tmp_309_alt_flag_1 == ALT_YES) {
current_location.update_lineno(2890);
/* BTS_Tests.ttcn, line 2890 */
goto tmp_309;
}
}
if (tmp_309_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(2891);
/* BTS_Tests.ttcn, line 2891 */
tmp_309_alt_flag_2 = Tdown.timeout(NULL);
if (tmp_309_alt_flag_2 == ALT_YES) break;
}
if (tmp_309_default_flag == ALT_MAYBE) {
tmp_309_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_309_default_flag == ALT_YES || tmp_309_default_flag == ALT_BREAK) break;
else if (tmp_309_default_flag == ALT_REPEAT) goto tmp_309;
}
current_location.update_lineno(2864);
/* BTS_Tests.ttcn, line 2864 */
if (tmp_309_alt_flag_0 == ALT_NO && tmp_309_alt_flag_1 == ALT_NO && tmp_309_alt_flag_2 == ALT_NO && tmp_309_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file BTS_Tests.ttcn between lines 2864 and 2892.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(2895);
/* BTS_Tests.ttcn, line 2895 */
if ((max__rx__lvl > last__rx__lvl)) {
current_location.update_lineno(2896);
/* BTS_Tests.ttcn, line 2896 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("Tx power decreased during ramp down: ");
max__rx__lvl.log();
TTCN_Logger::log_event_str(" -> ");
last__rx__lvl.log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
}
else {
current_location.update_lineno(2898);
/* BTS_Tests.ttcn, line 2898 */
Misc__Helpers::f__shutdown(cs_4, 2898, FAIL, (TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("No Tx power decrease during whole ramp down: "),max__rx__lvl.log(),TTCN_Logger::log_event_str(" -> "),last__rx__lvl.log(),TTCN_Logger::end_event_log2str()));
}
}

void start_f__verify__ramp__down(const COMPONENT& component_reference, const INTEGER& max__rx__lvl)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_verify_ramp_down(");
max__rx__lvl.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_verify_ramp_down", text_buf);
max__rx__lvl.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__verify__power__down(const INTEGER& max__rx__lvl)
{
TTCN_Location current_location("BTS_Tests.ttcn", 2905, TTCN_Location::LOCATION_FUNCTION, "f_verify_power_down");
current_location.update_lineno(2906);
/* BTS_Tests.ttcn, line 2906 */
L1CTL__Types::L1ctlMessage l1__dl;
current_location.update_lineno(2907);
/* BTS_Tests.ttcn, line 2907 */
BOOLEAN first__data__ind(TRUE);
current_location.update_lineno(2909);
/* BTS_Tests.ttcn, line 2909 */
TIMER Tdown("Tdown", 5.0);
current_location.update_lineno(2910);
/* BTS_Tests.ttcn, line 2910 */
Tdown.start();
current_location.update_lineno(2911);
/* BTS_Tests.ttcn, line 2911 */
{
tmp_311:
alt_status tmp_311_alt_flag_0 = ALT_UNCHECKED;
alt_status tmp_311_alt_flag_1 = ALT_UNCHECKED;
alt_status tmp_311_alt_flag_2 = ALT_MAYBE;
alt_status tmp_311_alt_flag_3 = ALT_MAYBE;
alt_status tmp_311_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_311_alt_flag_0 == ALT_UNCHECKED) {
current_location.update_lineno(2912);
/* BTS_Tests.ttcn, line 2912 */
if ((first__data__ind == TRUE)) tmp_311_alt_flag_0 = ALT_MAYBE;
else tmp_311_alt_flag_0 = ALT_NO;
}
if (tmp_311_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(2912);
/* BTS_Tests.ttcn, line 2912 */
tmp_311_alt_flag_0 = ConnHdlr_component_L1CTL.receive(L1CTL__Types::tr__L1CTL__DATA__IND(GSM__Types::t__RslChanNr__BCCH(INTEGER_template(0)), GSM__Types::RslLinkId_template(ANY_VALUE), L1CTL__Types::tr__L1CTL__DATA__IND_l2__data_defval, L1CTL__Types::tr__L1CTL__DATA__IND_num__biterr_defval, L1CTL__Types::tr__L1CTL__DATA__IND_fire__crc_defval), &(l1__dl), any_compref, NULL, NULL, NULL);
if (tmp_311_alt_flag_0 == ALT_YES) {
current_location.update_lineno(2913);
/* BTS_Tests.ttcn, line 2913 */
first__data__ind = FALSE;
current_location.update_lineno(2914);
/* BTS_Tests.ttcn, line 2914 */
INTEGER rx__lvl(const_cast< const L1CTL__Types::L1ctlMessage&>(l1__dl).dl__info()().rx__level());
current_location.update_lineno(2915);
/* BTS_Tests.ttcn, line 2915 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("Received rx_level=");
rx__lvl.log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(2918);
/* BTS_Tests.ttcn, line 2918 */
{
boolean tmp_313;
tmp_313 = (rx__lvl != 0);
if (tmp_313) tmp_313 = (rx__lvl != max__rx__lvl);
if (tmp_313) {
current_location.update_lineno(2919);
/* BTS_Tests.ttcn, line 2919 */
Misc__Helpers::f__shutdown(cs_4, 2919, FAIL, (TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Detected Tx power: "),rx__lvl.log(),TTCN_Logger::log_event_str(" should be 0 or "),max__rx__lvl.log(),TTCN_Logger::end_event_log2str()));
}
}
current_location.update_lineno(2923);
/* BTS_Tests.ttcn, line 2923 */
goto tmp_311;
}
}
if (tmp_311_alt_flag_1 == ALT_UNCHECKED) {
current_location.update_lineno(2925);
/* BTS_Tests.ttcn, line 2925 */
if ((first__data__ind == FALSE)) tmp_311_alt_flag_1 = ALT_MAYBE;
else tmp_311_alt_flag_1 = ALT_NO;
}
if (tmp_311_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(2925);
/* BTS_Tests.ttcn, line 2925 */
tmp_311_alt_flag_1 = ConnHdlr_component_L1CTL.receive(L1CTL__Types::tr__L1CTL__DATA__IND(GSM__Types::t__RslChanNr__BCCH(INTEGER_template(0)), GSM__Types::RslLinkId_template(ANY_VALUE), L1CTL__Types::tr__L1CTL__DATA__IND_l2__data_defval, L1CTL__Types::tr__L1CTL__DATA__IND_num__biterr_defval, L1CTL__Types::tr__L1CTL__DATA__IND_fire__crc_defval), &(l1__dl), any_compref, NULL, NULL, NULL);
if (tmp_311_alt_flag_1 == ALT_YES) {
current_location.update_lineno(2926);
/* BTS_Tests.ttcn, line 2926 */
INTEGER rx__lvl(const_cast< const L1CTL__Types::L1ctlMessage&>(l1__dl).dl__info()().rx__level());
current_location.update_lineno(2927);
/* BTS_Tests.ttcn, line 2927 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("Received rx_level=");
rx__lvl.log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(2931);
/* BTS_Tests.ttcn, line 2931 */
if ((rx__lvl != 0)) {
current_location.update_lineno(2932);
/* BTS_Tests.ttcn, line 2932 */
Misc__Helpers::f__shutdown(cs_4, 2932, FAIL, (TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Detected Tx power: "),rx__lvl.log(),TTCN_Logger::log_event_str(" should be 0"),TTCN_Logger::end_event_log2str()));
}
current_location.update_lineno(2937);
/* BTS_Tests.ttcn, line 2937 */
goto tmp_311;
}
}
if (tmp_311_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(2939);
/* BTS_Tests.ttcn, line 2939 */
tmp_311_alt_flag_2 = ConnHdlr_component_L1CTL.receive(any_compref, NULL, NULL, NULL);
if (tmp_311_alt_flag_2 == ALT_YES) {
current_location.update_lineno(2939);
/* BTS_Tests.ttcn, line 2939 */
goto tmp_311;
}
}
if (tmp_311_alt_flag_3 == ALT_MAYBE) {
current_location.update_lineno(2940);
/* BTS_Tests.ttcn, line 2940 */
tmp_311_alt_flag_3 = Tdown.timeout(NULL);
if (tmp_311_alt_flag_3 == ALT_YES) break;
}
if (tmp_311_default_flag == ALT_MAYBE) {
tmp_311_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_311_default_flag == ALT_YES || tmp_311_default_flag == ALT_BREAK) break;
else if (tmp_311_default_flag == ALT_REPEAT) goto tmp_311;
}
current_location.update_lineno(2911);
/* BTS_Tests.ttcn, line 2911 */
if (tmp_311_alt_flag_0 == ALT_NO && tmp_311_alt_flag_1 == ALT_NO && tmp_311_alt_flag_2 == ALT_NO && tmp_311_alt_flag_3 == ALT_NO && tmp_311_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file BTS_Tests.ttcn between lines 2911 and 2941.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
}

void start_f__verify__power__down(const COMPONENT& component_reference, const INTEGER& max__rx__lvl)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_verify_power_down(");
max__rx__lvl.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_verify_power_down", text_buf);
max__rx__lvl.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__TC__tx__power__start__ramp__up__bcch(const CHARSTRING& )
{
TTCN_Location current_location("BTS_Tests.ttcn", 2945, TTCN_Location::LOCATION_FUNCTION, "f_TC_tx_power_start_ramp_up_bcch");
current_location.update_lineno(2946);
/* BTS_Tests.ttcn, line 2946 */
f__l1__tune(ConnHdlr_component_L1CTL, f__l1__tune_ccch__mode_defval);
current_location.update_lineno(2947);
/* BTS_Tests.ttcn, line 2947 */
RSL__Emulation::RSL__DchanHdlr_component_RSL.clear();
current_location.update_lineno(2949);
/* BTS_Tests.ttcn, line 2949 */
f__verify__ramp__up();
current_location.update_lineno(2951);
/* BTS_Tests.ttcn, line 2951 */
TTCN_Runtime::setverdict(PASS);
}

void start_f__TC__tx__power__start__ramp__up__bcch(const COMPONENT& component_reference, const CHARSTRING& id)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_TC_tx_power_start_ramp_up_bcch(");
id.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_TC_tx_power_start_ramp_up_bcch", text_buf);
id.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

verdicttype testcase_TC__tx__power__start__ramp__up__bcch(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests.ttcn", 2953, TTCN_Location::LOCATION_TESTCASE, "TC_tx_power_start_ramp_up_bcch");
try {
TTCN_Runtime::begin_testcase("BTS_Tests", "TC_tx_power_start_ramp_up_bcch", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(2954);
/* BTS_Tests.ttcn, line 2954 */
COMPONENT vc__conn;
current_location.update_lineno(2955);
/* BTS_Tests.ttcn, line 2955 */
ConnHdlrPars pars;
current_location.update_lineno(2956);
/* BTS_Tests.ttcn, line 2956 */
f__init(f__init_trx__nr_defval);
current_location.update_lineno(2957);
/* BTS_Tests.ttcn, line 2957 */
pars = t__Pars(GSM__Types::t__RslChanNr__Bm(INTEGER_template(0)), RSL__Types::ts__RSL__ChanMode__SIGN(RSL__Types::ts__RSL__ChanMode__SIGN_t_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxd_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxu_defval), t__Pars_spec_defval, t__Pars_trx__nr_defval, t__Pars_t__guard_defval).valueof();
current_location.update_lineno(2958);
/* BTS_Tests.ttcn, line 2958 */
vc__conn = f__start__handler(&f__TC__tx__power__start__ramp__up__bcch, pars, FALSE, TRUE, f__start__handler_l1ctl_defval);
current_location.update_lineno(2960);
/* BTS_Tests.ttcn, line 2960 */
{
tmp_316:
alt_status alt_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (alt_flag != ALT_NO) {
alt_flag = vc__conn.done(NULL, NULL);
if (alt_flag == ALT_YES) break;
else if (alt_flag == ALT_REPEAT) goto tmp_316;
}
if (default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps(first_run);
if (default_flag == ALT_YES || default_flag == ALT_BREAK) break;
else if (default_flag == ALT_REPEAT) goto tmp_316;
}
current_location.update_lineno(2960);
/* BTS_Tests.ttcn, line 2960 */
if (alt_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("Stand-alone done statement failed in file BTS_Tests.ttcn, line 2960.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(2961);
/* BTS_Tests.ttcn, line 2961 */
Misc__Helpers::f__shutdown(cs_4, 2961, Misc__Helpers::f__shutdown_verdict_defval, Misc__Helpers::f__shutdown_text_defval);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_tx_power_start_ramp_up_bcch was stopped.");
}
return TTCN_Runtime::end_testcase();
}

void f__TC__tx__power__down__bcch(const CHARSTRING& )
{
TTCN_Location current_location("BTS_Tests.ttcn", 2965, TTCN_Location::LOCATION_FUNCTION, "f_TC_tx_power_down_bcch");
current_location.update_lineno(2966);
/* BTS_Tests.ttcn, line 2966 */
f__connhdlr__init__vty__bsc();
current_location.update_lineno(2968);
/* BTS_Tests.ttcn, line 2968 */
f__l1__tune(ConnHdlr_component_L1CTL, f__l1__tune_ccch__mode_defval);
current_location.update_lineno(2969);
/* BTS_Tests.ttcn, line 2969 */
RSL__Emulation::RSL__DchanHdlr_component_RSL.clear();
current_location.update_lineno(2972);
/* BTS_Tests.ttcn, line 2972 */
INTEGER max__rx__lvl(f__wait__ramp__up());
current_location.update_lineno(2973);
/* BTS_Tests.ttcn, line 2973 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("Reached nominal level ");
max__rx__lvl.log();
TTCN_Logger::log_event_str(", shutting down OML link");
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(2975);
/* BTS_Tests.ttcn, line 2975 */
Osmocom__VTY__Functions::f__vty__transceive(ConnHdlr_component_BSCVTY, cs_38, Osmocom__VTY__Functions::f__vty__transceive_strict_defval);
current_location.update_lineno(2976);
/* BTS_Tests.ttcn, line 2976 */
f__verify__power__down(max__rx__lvl);
current_location.update_lineno(2978);
/* BTS_Tests.ttcn, line 2978 */
TTCN_Runtime::setverdict(PASS);
}

void start_f__TC__tx__power__down__bcch(const COMPONENT& component_reference, const CHARSTRING& id)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_TC_tx_power_down_bcch(");
id.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_TC_tx_power_down_bcch", text_buf);
id.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

verdicttype testcase_TC__tx__power__down__bcch(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests.ttcn", 2980, TTCN_Location::LOCATION_TESTCASE, "TC_tx_power_down_bcch");
try {
TTCN_Runtime::begin_testcase("BTS_Tests", "TC_tx_power_down_bcch", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(2981);
/* BTS_Tests.ttcn, line 2981 */
COMPONENT vc__conn;
current_location.update_lineno(2982);
/* BTS_Tests.ttcn, line 2982 */
ConnHdlrPars pars;
current_location.update_lineno(2983);
/* BTS_Tests.ttcn, line 2983 */
f__init(f__init_trx__nr_defval);
current_location.update_lineno(2984);
/* BTS_Tests.ttcn, line 2984 */
pars = t__Pars(GSM__Types::t__RslChanNr__Bm(INTEGER_template(0)), RSL__Types::ts__RSL__ChanMode__SIGN(RSL__Types::ts__RSL__ChanMode__SIGN_t_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxd_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxu_defval), t__Pars_spec_defval, t__Pars_trx__nr_defval, t__Pars_t__guard_defval).valueof();
current_location.update_lineno(2985);
/* BTS_Tests.ttcn, line 2985 */
vc__conn = f__start__handler(&f__TC__tx__power__down__bcch, pars, FALSE, TRUE, f__start__handler_l1ctl_defval);
current_location.update_lineno(2987);
/* BTS_Tests.ttcn, line 2987 */
{
tmp_319:
alt_status alt_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (alt_flag != ALT_NO) {
alt_flag = vc__conn.done(NULL, NULL);
if (alt_flag == ALT_YES) break;
else if (alt_flag == ALT_REPEAT) goto tmp_319;
}
if (default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps(first_run);
if (default_flag == ALT_YES || default_flag == ALT_BREAK) break;
else if (default_flag == ALT_REPEAT) goto tmp_319;
}
current_location.update_lineno(2987);
/* BTS_Tests.ttcn, line 2987 */
if (alt_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("Stand-alone done statement failed in file BTS_Tests.ttcn, line 2987.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(2988);
/* BTS_Tests.ttcn, line 2988 */
Misc__Helpers::f__shutdown(cs_4, 2988, Misc__Helpers::f__shutdown_verdict_defval, Misc__Helpers::f__shutdown_text_defval);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_tx_power_down_bcch was stopped.");
}
return TTCN_Runtime::end_testcase();
}

void f__TC__tx__power__ramp__adm__state__change(const CHARSTRING& )
{
TTCN_Location current_location("BTS_Tests.ttcn", 2995, TTCN_Location::LOCATION_FUNCTION, "f_TC_tx_power_ramp_adm_state_change");
current_location.update_lineno(2996);
/* BTS_Tests.ttcn, line 2996 */
L1CTL__Types::L1ctlMessage l1__dl;
current_location.update_lineno(2997);
/* BTS_Tests.ttcn, line 2997 */
INTEGER last__rx__lvl;
current_location.update_lineno(2999);
/* BTS_Tests.ttcn, line 2999 */
f__connhdlr__init__vty__bsc();
current_location.update_lineno(3001);
/* BTS_Tests.ttcn, line 3001 */
f__l1__tune(ConnHdlr_component_L1CTL, f__l1__tune_ccch__mode_defval);
current_location.update_lineno(3002);
/* BTS_Tests.ttcn, line 3002 */
RSL__Emulation::RSL__DchanHdlr_component_RSL.clear();
current_location.update_lineno(3005);
/* BTS_Tests.ttcn, line 3005 */
INTEGER max__rx__lvl(f__wait__ramp__up());
current_location.update_lineno(3006);
/* BTS_Tests.ttcn, line 3006 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("Reached nominal level ");
max__rx__lvl.log();
TTCN_Logger::log_event_str(", changing ADM state to LOCKED");
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(3008);
/* BTS_Tests.ttcn, line 3008 */
TTCN_Logger::log_str(TTCN_USER, "ADM STATE UNLOCKED->LOCKED");
current_location.update_lineno(3009);
/* BTS_Tests.ttcn, line 3009 */
Osmocom__VTY__Functions::f__vty__enter__cfg__trx(ConnHdlr_component_BSCVTY, Osmocom__VTY__Functions::f__vty__enter__cfg__trx_bts_defval, Osmocom__VTY__Functions::f__vty__enter__cfg__trx_trx_defval);
current_location.update_lineno(3010);
/* BTS_Tests.ttcn, line 3010 */
Osmocom__VTY__Functions::f__vty__transceive(ConnHdlr_component_BSCVTY, cs_46, Osmocom__VTY__Functions::f__vty__transceive_strict_defval);
current_location.update_lineno(3011);
/* BTS_Tests.ttcn, line 3011 */
last__rx__lvl = max__rx__lvl;
current_location.update_lineno(3012);
/* BTS_Tests.ttcn, line 3012 */
f__verify__ramp__down(max__rx__lvl);
current_location.update_lineno(3016);
/* BTS_Tests.ttcn, line 3016 */
Osmocom__Types::f__sleep(2.0);
current_location.update_lineno(3017);
/* BTS_Tests.ttcn, line 3017 */
ConnHdlr_component_L1CTL.clear();
current_location.update_lineno(3018);
/* BTS_Tests.ttcn, line 3018 */
TIMER Tlocked("Tlocked", 2.0);
current_location.update_lineno(3019);
/* BTS_Tests.ttcn, line 3019 */
Tlocked.start();
current_location.update_lineno(3020);
/* BTS_Tests.ttcn, line 3020 */
{
tmp_321:
alt_status tmp_321_alt_flag_0 = ALT_MAYBE;
alt_status tmp_321_alt_flag_1 = ALT_MAYBE;
alt_status tmp_321_alt_flag_2 = ALT_MAYBE;
alt_status tmp_321_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_321_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(3021);
/* BTS_Tests.ttcn, line 3021 */
tmp_321_alt_flag_0 = ConnHdlr_component_L1CTL.receive(L1CTL__Types::tr__L1CTL__DATA__IND(GSM__Types::t__RslChanNr__BCCH(INTEGER_template(0)), GSM__Types::RslLinkId_template(ANY_VALUE), L1CTL__Types::tr__L1CTL__DATA__IND_l2__data_defval, L1CTL__Types::tr__L1CTL__DATA__IND_num__biterr_defval, L1CTL__Types::tr__L1CTL__DATA__IND_fire__crc_defval), &(l1__dl), any_compref, NULL, NULL, NULL);
if (tmp_321_alt_flag_0 == ALT_YES) {
current_location.update_lineno(3022);
/* BTS_Tests.ttcn, line 3022 */
Misc__Helpers::f__shutdown(cs_4, 3022, FAIL, (TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Received data_ind during rf_locked: "),l1__dl.log(),TTCN_Logger::end_event_log2str()));
break;
}
}
if (tmp_321_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(3025);
/* BTS_Tests.ttcn, line 3025 */
tmp_321_alt_flag_1 = ConnHdlr_component_L1CTL.receive(any_compref, NULL, NULL, NULL);
if (tmp_321_alt_flag_1 == ALT_YES) {
current_location.update_lineno(3025);
/* BTS_Tests.ttcn, line 3025 */
goto tmp_321;
}
}
if (tmp_321_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(3026);
/* BTS_Tests.ttcn, line 3026 */
tmp_321_alt_flag_2 = Tlocked.timeout(NULL);
if (tmp_321_alt_flag_2 == ALT_YES) {
current_location.update_lineno(3026);
/* BTS_Tests.ttcn, line 3026 */
TTCN_Runtime::setverdict(PASS,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Didn't receive data_ind while in rf_locked state."),TTCN_Logger::end_event_log2str()));
break;
}
}
if (tmp_321_default_flag == ALT_MAYBE) {
tmp_321_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_321_default_flag == ALT_YES || tmp_321_default_flag == ALT_BREAK) break;
else if (tmp_321_default_flag == ALT_REPEAT) goto tmp_321;
}
current_location.update_lineno(3020);
/* BTS_Tests.ttcn, line 3020 */
if (tmp_321_alt_flag_0 == ALT_NO && tmp_321_alt_flag_1 == ALT_NO && tmp_321_alt_flag_2 == ALT_NO && tmp_321_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file BTS_Tests.ttcn between lines 3020 and 3027.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(3029);
/* BTS_Tests.ttcn, line 3029 */
TTCN_Logger::log_str(TTCN_USER, "ADM STATE LOCKED->UNLOCKED");
current_location.update_lineno(3030);
/* BTS_Tests.ttcn, line 3030 */
Osmocom__VTY__Functions::f__vty__transceive(ConnHdlr_component_BSCVTY, cs_47, Osmocom__VTY__Functions::f__vty__transceive_strict_defval);
current_location.update_lineno(3031);
/* BTS_Tests.ttcn, line 3031 */
f__verify__ramp__up();
current_location.update_lineno(3032);
/* BTS_Tests.ttcn, line 3032 */
TTCN_Runtime::setverdict(PASS);
}

void start_f__TC__tx__power__ramp__adm__state__change(const COMPONENT& component_reference, const CHARSTRING& id)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_TC_tx_power_ramp_adm_state_change(");
id.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_TC_tx_power_ramp_adm_state_change", text_buf);
id.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

verdicttype testcase_TC__tx__power__ramp__adm__state__change(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests.ttcn", 3034, TTCN_Location::LOCATION_TESTCASE, "TC_tx_power_ramp_adm_state_change");
try {
TTCN_Runtime::begin_testcase("BTS_Tests", "TC_tx_power_ramp_adm_state_change", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(3035);
/* BTS_Tests.ttcn, line 3035 */
COMPONENT vc__conn;
current_location.update_lineno(3036);
/* BTS_Tests.ttcn, line 3036 */
ConnHdlrPars pars;
current_location.update_lineno(3037);
/* BTS_Tests.ttcn, line 3037 */
f__init(f__init_trx__nr_defval);
current_location.update_lineno(3038);
/* BTS_Tests.ttcn, line 3038 */
pars = t__Pars(GSM__Types::t__RslChanNr__Bm(INTEGER_template(0)), RSL__Types::ts__RSL__ChanMode__SIGN(RSL__Types::ts__RSL__ChanMode__SIGN_t_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxd_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxu_defval), t__Pars_spec_defval, t__Pars_trx__nr_defval, t__Pars_t__guard_defval).valueof();
current_location.update_lineno(3039);
/* BTS_Tests.ttcn, line 3039 */
vc__conn = f__start__handler(&f__TC__tx__power__ramp__adm__state__change, pars, FALSE, TRUE, f__start__handler_l1ctl_defval);
current_location.update_lineno(3041);
/* BTS_Tests.ttcn, line 3041 */
{
tmp_324:
alt_status alt_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (alt_flag != ALT_NO) {
alt_flag = vc__conn.done(NULL, NULL);
if (alt_flag == ALT_YES) break;
else if (alt_flag == ALT_REPEAT) goto tmp_324;
}
if (default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps(first_run);
if (default_flag == ALT_YES || default_flag == ALT_BREAK) break;
else if (default_flag == ALT_REPEAT) goto tmp_324;
}
current_location.update_lineno(3041);
/* BTS_Tests.ttcn, line 3041 */
if (alt_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("Stand-alone done statement failed in file BTS_Tests.ttcn, line 3041.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(3042);
/* BTS_Tests.ttcn, line 3042 */
Misc__Helpers::f__shutdown(cs_4, 3042, Misc__Helpers::f__shutdown_verdict_defval, Misc__Helpers::f__shutdown_text_defval);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_tx_power_ramp_adm_state_change was stopped.");
}
return TTCN_Runtime::end_testcase();
}

void f__check__meas__bs__power__level(const INTEGER& level)
{
TTCN_Location current_location("BTS_Tests.ttcn", 3045, TTCN_Location::LOCATION_FUNCTION, "f_check_meas_bs_power_level");
current_location.update_lineno(3046);
/* BTS_Tests.ttcn, line 3046 */
TIMER T("T", 8.0);
current_location.update_lineno(3047);
/* BTS_Tests.ttcn, line 3047 */
T.start();
current_location.update_lineno(3048);
/* BTS_Tests.ttcn, line 3048 */
RSL__Types::RSL__Message rsl;
current_location.update_lineno(3049);
/* BTS_Tests.ttcn, line 3049 */
{
tmp_325:
alt_status tmp_325_alt_flag_0 = ALT_MAYBE;
alt_status tmp_325_alt_flag_1 = ALT_MAYBE;
alt_status tmp_325_alt_flag_2 = ALT_MAYBE;
alt_status tmp_325_alt_flag_3 = ALT_MAYBE;
alt_status tmp_325_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_325_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(3050);
/* BTS_Tests.ttcn, line 3050 */
tmp_325_alt_flag_0 = as__l1__sacch__loop_instance(first_run);
if (tmp_325_alt_flag_0 == ALT_REPEAT) goto tmp_325;
if (tmp_325_alt_flag_0 == ALT_BREAK) break;
if (tmp_325_alt_flag_0 == ALT_YES) break;
}
if (tmp_325_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(3051);
/* BTS_Tests.ttcn, line 3051 */
tmp_325_alt_flag_1 = ConnHdlr_component_L1CTL.receive(any_compref, NULL, NULL, NULL);
if (tmp_325_alt_flag_1 == ALT_YES) {
current_location.update_lineno(3051);
/* BTS_Tests.ttcn, line 3051 */
goto tmp_325;
}
}
if (tmp_325_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(3052);
/* BTS_Tests.ttcn, line 3052 */
tmp_325_alt_flag_2 = RSL__Emulation::RSL__DchanHdlr_component_RSL.receive(RSL__Types::tr__RSL__MEAS__RES(GSM__Types::RslChannelNr_template(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr), INTEGER_template(ANY_VALUE), RSL__Types::RSL__IE__UplinkMeas_template(ANY_VALUE), RSL__Types::RSL__IE__BS__Power_template(ANY_VALUE)), &(rsl), any_compref, NULL, NULL, NULL);
if (tmp_325_alt_flag_2 == ALT_YES) {
current_location.update_lineno(3053);
/* BTS_Tests.ttcn, line 3053 */
if ((const_cast< const RSL__Types::RSL__Message&>(rsl).ies()()[3].body().bs__power().power__level() == level)) {
current_location.update_lineno(3054);
/* BTS_Tests.ttcn, line 3054 */
TTCN_Runtime::setverdict(PASS);
}
else {
current_location.update_lineno(3056);
/* BTS_Tests.ttcn, line 3056 */
Misc__Helpers::f__shutdown(cs_4, 3056, FAIL, (TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Received wrong BS power level in MEAS RES "),rsl.log(),TTCN_Logger::end_event_log2str()));
}
break;
}
}
if (tmp_325_alt_flag_3 == ALT_MAYBE) {
current_location.update_lineno(3059);
/* BTS_Tests.ttcn, line 3059 */
tmp_325_alt_flag_3 = T.timeout(NULL);
if (tmp_325_alt_flag_3 == ALT_YES) {
current_location.update_lineno(3060);
/* BTS_Tests.ttcn, line 3060 */
Misc__Helpers::f__shutdown(cs_4, 3060, FAIL, cs_45);
break;
}
}
if (tmp_325_default_flag == ALT_MAYBE) {
tmp_325_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_325_default_flag == ALT_YES || tmp_325_default_flag == ALT_BREAK) break;
else if (tmp_325_default_flag == ALT_REPEAT) goto tmp_325;
}
current_location.update_lineno(3049);
/* BTS_Tests.ttcn, line 3049 */
if (tmp_325_alt_flag_0 == ALT_NO && tmp_325_alt_flag_1 == ALT_NO && tmp_325_alt_flag_2 == ALT_NO && tmp_325_alt_flag_3 == ALT_NO && tmp_325_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file BTS_Tests.ttcn between lines 3049 and 3062.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
}

void start_f__check__meas__bs__power__level(const COMPONENT& component_reference, const INTEGER& level)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_check_meas_bs_power_level(");
level.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_check_meas_bs_power_level", text_buf);
level.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__TC__rsl__bs__pwr__static__ass(const CHARSTRING& )
{
TTCN_Location current_location("BTS_Tests.ttcn", 3067, TTCN_Location::LOCATION_FUNCTION, "f_TC_rsl_bs_pwr_static_ass");
current_location.update_lineno(3068);
/* BTS_Tests.ttcn, line 3068 */
f__l1__tune(ConnHdlr_component_L1CTL, f__l1__tune_ccch__mode_defval);
current_location.update_lineno(3069);
/* BTS_Tests.ttcn, line 3069 */
RSL__Emulation::RSL__DchanHdlr_component_RSL.clear();
current_location.update_lineno(3071);
/* BTS_Tests.ttcn, line 3071 */
if ((mp__bts__trxc__port != -1)) {
current_location.update_lineno(3072);
/* BTS_Tests.ttcn, line 3072 */
f__trxc__fake__rssi(GSM__Types::rxlev2dbm(mp__ul__rxlev__exp));
current_location.update_lineno(3073);
/* BTS_Tests.ttcn, line 3073 */
f__trxc__fake__toffs256(INTEGER(const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).l1__pars().timing__offset__256syms()));
}
current_location.update_lineno(3076);
/* BTS_Tests.ttcn, line 3076 */
INTEGER pwr__var(1);
current_location.update_lineno(3077);
/* BTS_Tests.ttcn, line 3077 */
RSL__Types::RSL__IE__BS__Power_template bs__power(RSL__Types::ts__RSL__IE__BS__Power(pwr__var, RSL__Types::ts__RSL__IE__BS__Power_epc_defval, RSL__Types::ts__RSL__IE__BS__Power_fpc_defval));
current_location.update_lineno(3078);
/* BTS_Tests.ttcn, line 3078 */
RSL__Types::RSL__IE_template pwr;
{
RSL__Types::RSL__IE__Body_template tmp_326;
tmp_326.bs__power() = bs__power;
pwr = RSL__Types::t__RSL__IE(RSL__Types::RSL__IE__Type::RSL__IE__BS__POWER, tmp_326);
}
current_location.update_lineno(3080);
/* BTS_Tests.ttcn, line 3080 */
{
RSL__Types::RSL__IE__List tmp_327;
tmp_327.set_size(1);
tmp_327[0] = pwr.valueof();
f__est__dchan(f__est__dchan_encr__enable_defval, tmp_327, f__est__dchan_act__type_defval);
}
current_location.update_lineno(3082);
/* BTS_Tests.ttcn, line 3082 */
f__check__meas__bs__power__level(pwr__var);
current_location.update_lineno(3084);
/* BTS_Tests.ttcn, line 3084 */
f__rsl__chan__deact();
current_location.update_lineno(3085);
/* BTS_Tests.ttcn, line 3085 */
L1CTL__PortType::f__L1CTL__DM__REL__REQ(ConnHdlr_component_L1CTL, RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr);
}

void start_f__TC__rsl__bs__pwr__static__ass(const COMPONENT& component_reference, const CHARSTRING& id)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_TC_rsl_bs_pwr_static_ass(");
id.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_TC_rsl_bs_pwr_static_ass", text_buf);
id.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__TC__rsl__bs__pwr__static__power__control(const CHARSTRING& )
{
TTCN_Location current_location("BTS_Tests.ttcn", 3090, TTCN_Location::LOCATION_FUNCTION, "f_TC_rsl_bs_pwr_static_power_control");
current_location.update_lineno(3091);
/* BTS_Tests.ttcn, line 3091 */
f__l1__tune(ConnHdlr_component_L1CTL, f__l1__tune_ccch__mode_defval);
current_location.update_lineno(3092);
/* BTS_Tests.ttcn, line 3092 */
RSL__Emulation::RSL__DchanHdlr_component_RSL.clear();
current_location.update_lineno(3094);
/* BTS_Tests.ttcn, line 3094 */
if ((mp__bts__trxc__port != -1)) {
current_location.update_lineno(3095);
/* BTS_Tests.ttcn, line 3095 */
f__trxc__fake__rssi(GSM__Types::rxlev2dbm(mp__ul__rxlev__exp));
current_location.update_lineno(3096);
/* BTS_Tests.ttcn, line 3096 */
f__trxc__fake__toffs256(INTEGER(const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).l1__pars().timing__offset__256syms()));
}
current_location.update_lineno(3099);
/* BTS_Tests.ttcn, line 3099 */
INTEGER pwr__var(1);
current_location.update_lineno(3100);
/* BTS_Tests.ttcn, line 3100 */
RSL__Types::RSL__IE__BS__Power_template bs__power(RSL__Types::ts__RSL__IE__BS__Power(pwr__var, RSL__Types::ts__RSL__IE__BS__Power_epc_defval, RSL__Types::ts__RSL__IE__BS__Power_fpc_defval));
current_location.update_lineno(3102);
/* BTS_Tests.ttcn, line 3102 */
f__est__dchan(f__est__dchan_encr__enable_defval, f__est__dchan_more__ies_defval, f__est__dchan_act__type_defval);
current_location.update_lineno(3104);
/* BTS_Tests.ttcn, line 3104 */
RSL__Emulation::RSL__DchanHdlr_component_RSL.send(RSL__Types::ts__RSL__BS__PWR__CTRL(GSM__Types::RslChannelNr_template(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr), bs__power), FALSE, NULL);
current_location.update_lineno(3106);
/* BTS_Tests.ttcn, line 3106 */
f__check__meas__bs__power__level(pwr__var);
current_location.update_lineno(3108);
/* BTS_Tests.ttcn, line 3108 */
f__rsl__chan__deact();
current_location.update_lineno(3109);
/* BTS_Tests.ttcn, line 3109 */
L1CTL__PortType::f__L1CTL__DM__REL__REQ(ConnHdlr_component_L1CTL, RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr);
}

void start_f__TC__rsl__bs__pwr__static__power__control(const COMPONENT& component_reference, const CHARSTRING& id)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_TC_rsl_bs_pwr_static_power_control(");
id.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_TC_rsl_bs_pwr_static_power_control", text_buf);
id.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

verdicttype testcase_TC__rsl__bs__pwr__static__ass(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests.ttcn", 3112, TTCN_Location::LOCATION_TESTCASE, "TC_rsl_bs_pwr_static_ass");
try {
TTCN_Runtime::begin_testcase("BTS_Tests", "TC_rsl_bs_pwr_static_ass", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(3113);
/* BTS_Tests.ttcn, line 3113 */
COMPONENT vc__conn;
current_location.update_lineno(3114);
/* BTS_Tests.ttcn, line 3114 */
ConnHdlrPars pars;
current_location.update_lineno(3116);
/* BTS_Tests.ttcn, line 3116 */
f__init(f__init_trx__nr_defval);
current_location.update_lineno(3118);
/* BTS_Tests.ttcn, line 3118 */
pars = t__Pars(GSM__Types::t__RslChanNr__Bm(INTEGER_template(0)), RSL__Types::ts__RSL__ChanMode__SIGN(RSL__Types::ts__RSL__ChanMode__SIGN_t_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxd_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxu_defval), t__Pars_spec_defval, 1, t__Pars_t__guard_defval).valueof();
current_location.update_lineno(3119);
/* BTS_Tests.ttcn, line 3119 */
vc__conn = f__start__handler(&f__TC__rsl__bs__pwr__static__ass, pars, FALSE, TRUE, f__start__handler_l1ctl_defval);
current_location.update_lineno(3121);
/* BTS_Tests.ttcn, line 3121 */
{
tmp_330:
alt_status alt_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (alt_flag != ALT_NO) {
alt_flag = vc__conn.done(NULL, NULL);
if (alt_flag == ALT_YES) break;
else if (alt_flag == ALT_REPEAT) goto tmp_330;
}
if (default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps(first_run);
if (default_flag == ALT_YES || default_flag == ALT_BREAK) break;
else if (default_flag == ALT_REPEAT) goto tmp_330;
}
current_location.update_lineno(3121);
/* BTS_Tests.ttcn, line 3121 */
if (alt_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("Stand-alone done statement failed in file BTS_Tests.ttcn, line 3121.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(3123);
/* BTS_Tests.ttcn, line 3123 */
Misc__Helpers::f__shutdown(cs_4, 3123, Misc__Helpers::f__shutdown_verdict_defval, Misc__Helpers::f__shutdown_text_defval);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_rsl_bs_pwr_static_ass was stopped.");
}
return TTCN_Runtime::end_testcase();
}

verdicttype testcase_TC__rsl__bs__pwr__static__power__control(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests.ttcn", 3126, TTCN_Location::LOCATION_TESTCASE, "TC_rsl_bs_pwr_static_power_control");
try {
TTCN_Runtime::begin_testcase("BTS_Tests", "TC_rsl_bs_pwr_static_power_control", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(3127);
/* BTS_Tests.ttcn, line 3127 */
COMPONENT vc__conn;
current_location.update_lineno(3128);
/* BTS_Tests.ttcn, line 3128 */
ConnHdlrPars pars;
current_location.update_lineno(3130);
/* BTS_Tests.ttcn, line 3130 */
f__init(f__init_trx__nr_defval);
current_location.update_lineno(3132);
/* BTS_Tests.ttcn, line 3132 */
pars = t__Pars(GSM__Types::t__RslChanNr__Bm(INTEGER_template(0)), RSL__Types::ts__RSL__ChanMode__SIGN(RSL__Types::ts__RSL__ChanMode__SIGN_t_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxd_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxu_defval), t__Pars_spec_defval, 1, t__Pars_t__guard_defval).valueof();
current_location.update_lineno(3133);
/* BTS_Tests.ttcn, line 3133 */
vc__conn = f__start__handler(&f__TC__rsl__bs__pwr__static__power__control, pars, FALSE, TRUE, f__start__handler_l1ctl_defval);
current_location.update_lineno(3135);
/* BTS_Tests.ttcn, line 3135 */
{
tmp_333:
alt_status alt_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (alt_flag != ALT_NO) {
alt_flag = vc__conn.done(NULL, NULL);
if (alt_flag == ALT_YES) break;
else if (alt_flag == ALT_REPEAT) goto tmp_333;
}
if (default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps(first_run);
if (default_flag == ALT_YES || default_flag == ALT_BREAK) break;
else if (default_flag == ALT_REPEAT) goto tmp_333;
}
current_location.update_lineno(3135);
/* BTS_Tests.ttcn, line 3135 */
if (alt_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("Stand-alone done statement failed in file BTS_Tests.ttcn, line 3135.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(3137);
/* BTS_Tests.ttcn, line 3137 */
Misc__Helpers::f__shutdown(cs_4, 3137, Misc__Helpers::f__shutdown_verdict_defval, Misc__Helpers::f__shutdown_text_defval);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_rsl_bs_pwr_static_power_control was stopped.");
}
return TTCN_Runtime::end_testcase();
}

void f__TC__rsl__ms__pwr__dyn__ass__updown(const CHARSTRING& )
{
TTCN_Location current_location("BTS_Tests.ttcn", 3143, TTCN_Location::LOCATION_FUNCTION, "f_TC_rsl_ms_pwr_dyn_ass_updown");
current_location.update_lineno(3144);
/* BTS_Tests.ttcn, line 3144 */
INTEGER pwr__var(7);
current_location.update_lineno(3145);
/* BTS_Tests.ttcn, line 3145 */
GSM__RR__Types::SacchL1Header l1h;
current_location.update_lineno(3147);
/* BTS_Tests.ttcn, line 3147 */
f__trxc__fake__rssi(GSM__Types::rxlev2dbm(10));
current_location.update_lineno(3148);
/* BTS_Tests.ttcn, line 3148 */
f__l1__tune(ConnHdlr_component_L1CTL, f__l1__tune_ccch__mode_defval);
current_location.update_lineno(3149);
/* BTS_Tests.ttcn, line 3149 */
RSL__Emulation::RSL__DchanHdlr_component_RSL.clear();
current_location.update_lineno(3151);
/* BTS_Tests.ttcn, line 3151 */
RSL__Types::RSL__IE__List addl__ies;
current_location.update_lineno(3152);
/* BTS_Tests.ttcn, line 3152 */
RSL__Types::RSL__IE__MS__Power__Parameters_template pp(RSL__Types::ts__RSL__IE__MS__Power__Parameters(os_2));
current_location.update_lineno(3154);
/* BTS_Tests.ttcn, line 3154 */
addl__ies.set_size(2);
{
RSL__Types::RSL__IE__Body_template tmp_335;
tmp_335.ms__power() = RSL__Types::ts__RSL__IE__MS__Power(pwr__var, RSL__Types::ts__RSL__IE__MS__Power_fpc__epc_defval);
addl__ies[0] = RSL__Types::t__RSL__IE(RSL__Types::RSL__IE__Type::RSL__IE__MS__POWER, tmp_335).valueof();
}
{
RSL__Types::RSL__IE__Body_template tmp_336;
tmp_336.ms__power__params() = pp;
addl__ies[1] = RSL__Types::t__RSL__IE(RSL__Types::RSL__IE__Type::RSL__IE__MS__POWER__PARAM, tmp_336).valueof();
}
current_location.update_lineno(3160);
/* BTS_Tests.ttcn, line 3160 */
f__est__dchan(f__est__dchan_encr__enable_defval, addl__ies, f__est__dchan_act__type_defval);
current_location.update_lineno(3163);
/* BTS_Tests.ttcn, line 3163 */
f__trxc__fake__rssi(GSM__Types::rxlev2dbm(20));
current_location.update_lineno(3165);
/* BTS_Tests.ttcn, line 3165 */
TIMER T2("T2", 6.0);
current_location.update_lineno(3166);
/* BTS_Tests.ttcn, line 3166 */
T2.start();
current_location.update_lineno(3167);
/* BTS_Tests.ttcn, line 3167 */
{
tmp_337:
alt_status tmp_337_alt_flag_0 = ALT_MAYBE;
alt_status tmp_337_alt_flag_1 = ALT_MAYBE;
alt_status tmp_337_alt_flag_2 = ALT_MAYBE;
alt_status tmp_337_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_337_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(3168);
/* BTS_Tests.ttcn, line 3168 */
tmp_337_alt_flag_0 = as__l1__sacch__l1h_instance(l1h, as__l1__sacch__l1h_do__apply_defval, first_run);
if (tmp_337_alt_flag_0 == ALT_REPEAT) goto tmp_337;
if (tmp_337_alt_flag_0 == ALT_BREAK) break;
if (tmp_337_alt_flag_0 == ALT_YES) {
current_location.update_lineno(3169);
/* BTS_Tests.ttcn, line 3169 */
f__send__meas__rep__l1h(GSM__RR__Types::ts__MeasurementResults(GSM__RR__Types::ts__MeasurementResults_rxl__f_defval, GSM__RR__Types::ts__MeasurementResults_rxl__s_defval, GSM__RR__Types::ts__MeasurementResults_rxq__f_defval, GSM__RR__Types::ts__MeasurementResults_rxq__s_defval, GSM__RR__Types::ts__MeasurementResults_dtx__used_defval, GSM__RR__Types::ts__MeasurementResults_valid_defval, GSM__RR__Types::ts__MeasurementResults_reps_defval), GSM__RR__Types::SacchL1Header_template(l1h));
current_location.update_lineno(3171);
/* BTS_Tests.ttcn, line 3171 */
if ((const_cast< const GSM__RR__Types::SacchL1Header&>(l1h).ms__power__lvl() < (pwr__var + 6))) {
current_location.update_lineno(3172);
/* BTS_Tests.ttcn, line 3172 */
goto tmp_337;
}
current_location.update_lineno(3174);
/* BTS_Tests.ttcn, line 3174 */
T2.stop();
break;
}
}
if (tmp_337_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(3176);
/* BTS_Tests.ttcn, line 3176 */
tmp_337_alt_flag_1 = ConnHdlr_component_L1CTL.receive(any_compref, NULL, NULL, NULL);
if (tmp_337_alt_flag_1 == ALT_YES) {
current_location.update_lineno(3176);
/* BTS_Tests.ttcn, line 3176 */
goto tmp_337;
}
}
if (tmp_337_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(3177);
/* BTS_Tests.ttcn, line 3177 */
tmp_337_alt_flag_2 = T2.timeout(NULL);
if (tmp_337_alt_flag_2 == ALT_YES) {
current_location.update_lineno(3178);
/* BTS_Tests.ttcn, line 3178 */
Misc__Helpers::f__shutdown(cs_4, 3178, FAIL, cs_48);
break;
}
}
if (tmp_337_default_flag == ALT_MAYBE) {
tmp_337_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_337_default_flag == ALT_YES || tmp_337_default_flag == ALT_BREAK) break;
else if (tmp_337_default_flag == ALT_REPEAT) goto tmp_337;
}
current_location.update_lineno(3167);
/* BTS_Tests.ttcn, line 3167 */
if (tmp_337_alt_flag_0 == ALT_NO && tmp_337_alt_flag_1 == ALT_NO && tmp_337_alt_flag_2 == ALT_NO && tmp_337_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file BTS_Tests.ttcn between lines 3167 and 3181.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(3184);
/* BTS_Tests.ttcn, line 3184 */
f__trxc__fake__rssi(GSM__Types::rxlev2dbm(0));
current_location.update_lineno(3186);
/* BTS_Tests.ttcn, line 3186 */
TIMER T4("T4", 6.0);
current_location.update_lineno(3187);
/* BTS_Tests.ttcn, line 3187 */
T4.start();
current_location.update_lineno(3188);
/* BTS_Tests.ttcn, line 3188 */
{
tmp_338:
alt_status tmp_338_alt_flag_0 = ALT_MAYBE;
alt_status tmp_338_alt_flag_1 = ALT_MAYBE;
alt_status tmp_338_alt_flag_2 = ALT_MAYBE;
alt_status tmp_338_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_338_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(3189);
/* BTS_Tests.ttcn, line 3189 */
tmp_338_alt_flag_0 = as__l1__sacch__l1h_instance(l1h, as__l1__sacch__l1h_do__apply_defval, first_run);
if (tmp_338_alt_flag_0 == ALT_REPEAT) goto tmp_338;
if (tmp_338_alt_flag_0 == ALT_BREAK) break;
if (tmp_338_alt_flag_0 == ALT_YES) {
current_location.update_lineno(3190);
/* BTS_Tests.ttcn, line 3190 */
f__send__meas__rep__l1h(GSM__RR__Types::ts__MeasurementResults(GSM__RR__Types::ts__MeasurementResults_rxl__f_defval, GSM__RR__Types::ts__MeasurementResults_rxl__s_defval, GSM__RR__Types::ts__MeasurementResults_rxq__f_defval, GSM__RR__Types::ts__MeasurementResults_rxq__s_defval, GSM__RR__Types::ts__MeasurementResults_dtx__used_defval, GSM__RR__Types::ts__MeasurementResults_valid_defval, GSM__RR__Types::ts__MeasurementResults_reps_defval), GSM__RR__Types::SacchL1Header_template(l1h));
current_location.update_lineno(3192);
/* BTS_Tests.ttcn, line 3192 */
if ((const_cast< const GSM__RR__Types::SacchL1Header&>(l1h).ms__power__lvl() > pwr__var)) {
current_location.update_lineno(3193);
/* BTS_Tests.ttcn, line 3193 */
goto tmp_338;
}
current_location.update_lineno(3195);
/* BTS_Tests.ttcn, line 3195 */
T4.stop();
current_location.update_lineno(3196);
/* BTS_Tests.ttcn, line 3196 */
TTCN_Runtime::setverdict(PASS,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Power level in L1 decreased/increased as expected"),TTCN_Logger::end_event_log2str()));
break;
}
}
if (tmp_338_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(3198);
/* BTS_Tests.ttcn, line 3198 */
tmp_338_alt_flag_1 = ConnHdlr_component_L1CTL.receive(any_compref, NULL, NULL, NULL);
if (tmp_338_alt_flag_1 == ALT_YES) {
current_location.update_lineno(3198);
/* BTS_Tests.ttcn, line 3198 */
goto tmp_338;
}
}
if (tmp_338_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(3199);
/* BTS_Tests.ttcn, line 3199 */
tmp_338_alt_flag_2 = T4.timeout(NULL);
if (tmp_338_alt_flag_2 == ALT_YES) {
current_location.update_lineno(3200);
/* BTS_Tests.ttcn, line 3200 */
Misc__Helpers::f__shutdown(cs_4, 3200, FAIL, cs_49);
break;
}
}
if (tmp_338_default_flag == ALT_MAYBE) {
tmp_338_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_338_default_flag == ALT_YES || tmp_338_default_flag == ALT_BREAK) break;
else if (tmp_338_default_flag == ALT_REPEAT) goto tmp_338;
}
current_location.update_lineno(3188);
/* BTS_Tests.ttcn, line 3188 */
if (tmp_338_alt_flag_0 == ALT_NO && tmp_338_alt_flag_1 == ALT_NO && tmp_338_alt_flag_2 == ALT_NO && tmp_338_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file BTS_Tests.ttcn between lines 3188 and 3203.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(3205);
/* BTS_Tests.ttcn, line 3205 */
f__rsl__chan__deact();
current_location.update_lineno(3206);
/* BTS_Tests.ttcn, line 3206 */
L1CTL__PortType::f__L1CTL__DM__REL__REQ(ConnHdlr_component_L1CTL, RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr);
}

void start_f__TC__rsl__ms__pwr__dyn__ass__updown(const COMPONENT& component_reference, const CHARSTRING& id)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_TC_rsl_ms_pwr_dyn_ass_updown(");
id.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_TC_rsl_ms_pwr_dyn_ass_updown", text_buf);
id.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__TC__rsl__ms__pwr__dyn__max(const CHARSTRING& )
{
TTCN_Location current_location("BTS_Tests.ttcn", 3211, TTCN_Location::LOCATION_FUNCTION, "f_TC_rsl_ms_pwr_dyn_max");
current_location.update_lineno(3212);
/* BTS_Tests.ttcn, line 3212 */
INTEGER pwr__var(7);
current_location.update_lineno(3213);
/* BTS_Tests.ttcn, line 3213 */
GSM__RR__Types::SacchL1Header l1h;
current_location.update_lineno(3216);
/* BTS_Tests.ttcn, line 3216 */
f__trxc__fake__rssi(GSM__Types::rxlev2dbm(10));
current_location.update_lineno(3217);
/* BTS_Tests.ttcn, line 3217 */
f__l1__tune(ConnHdlr_component_L1CTL, f__l1__tune_ccch__mode_defval);
current_location.update_lineno(3218);
/* BTS_Tests.ttcn, line 3218 */
RSL__Emulation::RSL__DchanHdlr_component_RSL.clear();
current_location.update_lineno(3220);
/* BTS_Tests.ttcn, line 3220 */
RSL__Types::RSL__IE__List addl__ies;
current_location.update_lineno(3221);
/* BTS_Tests.ttcn, line 3221 */
RSL__Types::RSL__IE__MS__Power__Parameters_template pp(RSL__Types::ts__RSL__IE__MS__Power__Parameters(os_2));
current_location.update_lineno(3223);
/* BTS_Tests.ttcn, line 3223 */
addl__ies.set_size(2);
{
RSL__Types::RSL__IE__Body_template tmp_340;
tmp_340.ms__power() = RSL__Types::ts__RSL__IE__MS__Power(pwr__var, RSL__Types::ts__RSL__IE__MS__Power_fpc__epc_defval);
addl__ies[0] = RSL__Types::t__RSL__IE(RSL__Types::RSL__IE__Type::RSL__IE__MS__POWER, tmp_340).valueof();
}
{
RSL__Types::RSL__IE__Body_template tmp_341;
tmp_341.ms__power__params() = pp;
addl__ies[1] = RSL__Types::t__RSL__IE(RSL__Types::RSL__IE__Type::RSL__IE__MS__POWER__PARAM, tmp_341).valueof();
}
current_location.update_lineno(3229);
/* BTS_Tests.ttcn, line 3229 */
f__est__dchan(f__est__dchan_encr__enable_defval, addl__ies, f__est__dchan_act__type_defval);
current_location.update_lineno(3231);
/* BTS_Tests.ttcn, line 3231 */
TIMER T1("T1", 1.0e1);
current_location.update_lineno(3232);
/* BTS_Tests.ttcn, line 3232 */
T1.start();
current_location.update_lineno(3233);
/* BTS_Tests.ttcn, line 3233 */
{
tmp_342:
alt_status tmp_342_alt_flag_0 = ALT_MAYBE;
alt_status tmp_342_alt_flag_1 = ALT_MAYBE;
alt_status tmp_342_alt_flag_2 = ALT_MAYBE;
alt_status tmp_342_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_342_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(3234);
/* BTS_Tests.ttcn, line 3234 */
tmp_342_alt_flag_0 = as__l1__sacch__l1h_instance(l1h, as__l1__sacch__l1h_do__apply_defval, first_run);
if (tmp_342_alt_flag_0 == ALT_REPEAT) goto tmp_342;
if (tmp_342_alt_flag_0 == ALT_BREAK) break;
if (tmp_342_alt_flag_0 == ALT_YES) {
current_location.update_lineno(3235);
/* BTS_Tests.ttcn, line 3235 */
f__send__meas__rep__l1h(GSM__RR__Types::ts__MeasurementResults(GSM__RR__Types::ts__MeasurementResults_rxl__f_defval, GSM__RR__Types::ts__MeasurementResults_rxl__s_defval, GSM__RR__Types::ts__MeasurementResults_rxq__f_defval, GSM__RR__Types::ts__MeasurementResults_rxq__s_defval, GSM__RR__Types::ts__MeasurementResults_dtx__used_defval, GSM__RR__Types::ts__MeasurementResults_valid_defval, GSM__RR__Types::ts__MeasurementResults_reps_defval), GSM__RR__Types::SacchL1Header_template(l1h));
current_location.update_lineno(3236);
/* BTS_Tests.ttcn, line 3236 */
goto tmp_342;
}
}
if (tmp_342_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(3238);
/* BTS_Tests.ttcn, line 3238 */
tmp_342_alt_flag_1 = ConnHdlr_component_L1CTL.receive(any_compref, NULL, NULL, NULL);
if (tmp_342_alt_flag_1 == ALT_YES) {
current_location.update_lineno(3238);
/* BTS_Tests.ttcn, line 3238 */
goto tmp_342;
}
}
if (tmp_342_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(3239);
/* BTS_Tests.ttcn, line 3239 */
tmp_342_alt_flag_2 = T1.timeout(NULL);
if (tmp_342_alt_flag_2 == ALT_YES) {
current_location.update_lineno(3240);
/* BTS_Tests.ttcn, line 3240 */
if ((!(l1h.is_bound()))) {
current_location.update_lineno(3241);
/* BTS_Tests.ttcn, line 3241 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("No SACCH blocks were received"),TTCN_Logger::end_event_log2str()));
}
else {
current_location.update_lineno(3242);
/* BTS_Tests.ttcn, line 3242 */
if ((const_cast< const GSM__RR__Types::SacchL1Header&>(l1h).ms__power__lvl() != pwr__var)) {
current_location.update_lineno(3243);
/* BTS_Tests.ttcn, line 3243 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Power level in L1 header should not have changed"),TTCN_Logger::end_event_log2str()));
}
}
break;
}
}
if (tmp_342_default_flag == ALT_MAYBE) {
tmp_342_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_342_default_flag == ALT_YES || tmp_342_default_flag == ALT_BREAK) break;
else if (tmp_342_default_flag == ALT_REPEAT) goto tmp_342;
}
current_location.update_lineno(3233);
/* BTS_Tests.ttcn, line 3233 */
if (tmp_342_alt_flag_0 == ALT_NO && tmp_342_alt_flag_1 == ALT_NO && tmp_342_alt_flag_2 == ALT_NO && tmp_342_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file BTS_Tests.ttcn between lines 3233 and 3246.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(3248);
/* BTS_Tests.ttcn, line 3248 */
f__rsl__chan__deact();
current_location.update_lineno(3249);
/* BTS_Tests.ttcn, line 3249 */
L1CTL__PortType::f__L1CTL__DM__REL__REQ(ConnHdlr_component_L1CTL, RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr);
}

void start_f__TC__rsl__ms__pwr__dyn__max(const COMPONENT& component_reference, const CHARSTRING& id)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_TC_rsl_ms_pwr_dyn_max(");
id.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_TC_rsl_ms_pwr_dyn_max", text_buf);
id.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__TC__rsl__ms__pwr__dyn__up(const CHARSTRING& )
{
TTCN_Location current_location("BTS_Tests.ttcn", 3254, TTCN_Location::LOCATION_FUNCTION, "f_TC_rsl_ms_pwr_dyn_up");
current_location.update_lineno(3255);
/* BTS_Tests.ttcn, line 3255 */
GSM__RR__Types::SacchL1Header l1h;
current_location.update_lineno(3256);
/* BTS_Tests.ttcn, line 3256 */
INTEGER pwr__var(15);
current_location.update_lineno(3257);
/* BTS_Tests.ttcn, line 3257 */
INTEGER pwr__max__var(f__get__max__power__from__band());
current_location.update_lineno(3260);
/* BTS_Tests.ttcn, line 3260 */
f__trxc__fake__rssi(GSM__Types::rxlev2dbm(10));
current_location.update_lineno(3261);
/* BTS_Tests.ttcn, line 3261 */
f__l1__tune(ConnHdlr_component_L1CTL, f__l1__tune_ccch__mode_defval);
current_location.update_lineno(3262);
/* BTS_Tests.ttcn, line 3262 */
RSL__Emulation::RSL__DchanHdlr_component_RSL.clear();
current_location.update_lineno(3264);
/* BTS_Tests.ttcn, line 3264 */
RSL__Types::RSL__IE__MS__Power_template ms__power(RSL__Types::ts__RSL__IE__MS__Power(pwr__var, RSL__Types::ts__RSL__IE__MS__Power_fpc__epc_defval));
current_location.update_lineno(3265);
/* BTS_Tests.ttcn, line 3265 */
RSL__Types::RSL__IE_template pwr;
{
RSL__Types::RSL__IE__Body_template tmp_343;
tmp_343.ms__power() = ms__power;
pwr = RSL__Types::t__RSL__IE(RSL__Types::RSL__IE__Type::RSL__IE__MS__POWER, tmp_343);
}
current_location.update_lineno(3268);
/* BTS_Tests.ttcn, line 3268 */
{
RSL__Types::RSL__IE__List tmp_344;
tmp_344.set_size(1);
tmp_344[0] = pwr.valueof();
f__est__dchan(f__est__dchan_encr__enable_defval, tmp_344, f__est__dchan_act__type_defval);
}
current_location.update_lineno(3271);
/* BTS_Tests.ttcn, line 3271 */
f__wait__for__l1__power__level(pwr__var);
current_location.update_lineno(3275);
/* BTS_Tests.ttcn, line 3275 */
RSL__Emulation::RSL__DchanHdlr_component_RSL.send(RSL__Types::ts__RSL__MS__PWR__CTRL__with__pp(GSM__Types::RslChannelNr_template(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr), pwr__max__var), FALSE, NULL);
current_location.update_lineno(3280);
/* BTS_Tests.ttcn, line 3280 */
TIMER T1("T1", 1.92e1);
current_location.update_lineno(3281);
/* BTS_Tests.ttcn, line 3281 */
T1.start();
current_location.update_lineno(3282);
/* BTS_Tests.ttcn, line 3282 */
{
tmp_345:
alt_status tmp_345_alt_flag_0 = ALT_MAYBE;
alt_status tmp_345_alt_flag_1 = ALT_MAYBE;
alt_status tmp_345_alt_flag_2 = ALT_MAYBE;
alt_status tmp_345_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_345_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(3283);
/* BTS_Tests.ttcn, line 3283 */
tmp_345_alt_flag_0 = as__l1__sacch__l1h_instance(l1h, as__l1__sacch__l1h_do__apply_defval, first_run);
if (tmp_345_alt_flag_0 == ALT_REPEAT) goto tmp_345;
if (tmp_345_alt_flag_0 == ALT_BREAK) break;
if (tmp_345_alt_flag_0 == ALT_YES) {
current_location.update_lineno(3284);
/* BTS_Tests.ttcn, line 3284 */
f__send__meas__rep__l1h(GSM__RR__Types::ts__MeasurementResults(GSM__RR__Types::ts__MeasurementResults_rxl__f_defval, GSM__RR__Types::ts__MeasurementResults_rxl__s_defval, GSM__RR__Types::ts__MeasurementResults_rxq__f_defval, GSM__RR__Types::ts__MeasurementResults_rxq__s_defval, GSM__RR__Types::ts__MeasurementResults_dtx__used_defval, GSM__RR__Types::ts__MeasurementResults_valid_defval, GSM__RR__Types::ts__MeasurementResults_reps_defval), GSM__RR__Types::SacchL1Header_template(l1h));
current_location.update_lineno(3285);
/* BTS_Tests.ttcn, line 3285 */
goto tmp_345;
}
}
if (tmp_345_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(3287);
/* BTS_Tests.ttcn, line 3287 */
tmp_345_alt_flag_1 = ConnHdlr_component_L1CTL.receive(any_compref, NULL, NULL, NULL);
if (tmp_345_alt_flag_1 == ALT_YES) {
current_location.update_lineno(3287);
/* BTS_Tests.ttcn, line 3287 */
goto tmp_345;
}
}
if (tmp_345_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(3288);
/* BTS_Tests.ttcn, line 3288 */
tmp_345_alt_flag_2 = T1.timeout(NULL);
if (tmp_345_alt_flag_2 == ALT_YES) {
current_location.update_lineno(3289);
/* BTS_Tests.ttcn, line 3289 */
if ((!(l1h.is_bound()))) {
current_location.update_lineno(3290);
/* BTS_Tests.ttcn, line 3290 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("No SACCH blocks were received"),TTCN_Logger::end_event_log2str()));
}
else {
current_location.update_lineno(3291);
/* BTS_Tests.ttcn, line 3291 */
if (f__power__level__is__highest__dbm(const_cast< const GSM__RR__Types::SacchL1Header&>(l1h).ms__power__lvl())) {
current_location.update_lineno(3292);
/* BTS_Tests.ttcn, line 3292 */
TTCN_Runtime::setverdict(PASS,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Power level in L1 header reduced as expected"),TTCN_Logger::end_event_log2str()));
}
else {
current_location.update_lineno(3294);
/* BTS_Tests.ttcn, line 3294 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Power level := "),const_cast< const GSM__RR__Types::SacchL1Header&>(l1h).ms__power__lvl().log(),TTCN_Logger::log_event_str(" did not reach the expected value := "),pwr__max__var.log(),TTCN_Logger::end_event_log2str()));
}
}
break;
}
}
if (tmp_345_default_flag == ALT_MAYBE) {
tmp_345_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_345_default_flag == ALT_YES || tmp_345_default_flag == ALT_BREAK) break;
else if (tmp_345_default_flag == ALT_REPEAT) goto tmp_345;
}
current_location.update_lineno(3282);
/* BTS_Tests.ttcn, line 3282 */
if (tmp_345_alt_flag_0 == ALT_NO && tmp_345_alt_flag_1 == ALT_NO && tmp_345_alt_flag_2 == ALT_NO && tmp_345_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file BTS_Tests.ttcn between lines 3282 and 3298.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(3300);
/* BTS_Tests.ttcn, line 3300 */
f__rsl__chan__deact();
current_location.update_lineno(3301);
/* BTS_Tests.ttcn, line 3301 */
L1CTL__PortType::f__L1CTL__DM__REL__REQ(ConnHdlr_component_L1CTL, RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr);
}

void start_f__TC__rsl__ms__pwr__dyn__up(const COMPONENT& component_reference, const CHARSTRING& id)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_TC_rsl_ms_pwr_dyn_up(");
id.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_TC_rsl_ms_pwr_dyn_up", text_buf);
id.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__TC__rsl__ms__pwr__dyn__down(const CHARSTRING& )
{
TTCN_Location current_location("BTS_Tests.ttcn", 3306, TTCN_Location::LOCATION_FUNCTION, "f_TC_rsl_ms_pwr_dyn_down");
current_location.update_lineno(3307);
/* BTS_Tests.ttcn, line 3307 */
GSM__RR__Types::SacchL1Header l1h;
current_location.update_lineno(3310);
/* BTS_Tests.ttcn, line 3310 */
f__trxc__fake__rssi(GSM__Types::rxlev2dbm(50));
current_location.update_lineno(3311);
/* BTS_Tests.ttcn, line 3311 */
f__l1__tune(ConnHdlr_component_L1CTL, f__l1__tune_ccch__mode_defval);
current_location.update_lineno(3312);
/* BTS_Tests.ttcn, line 3312 */
RSL__Emulation::RSL__DchanHdlr_component_RSL.clear();
current_location.update_lineno(3314);
/* BTS_Tests.ttcn, line 3314 */
INTEGER pwr__var(5);
current_location.update_lineno(3315);
/* BTS_Tests.ttcn, line 3315 */
INTEGER pwr__target__val(15);
current_location.update_lineno(3317);
/* BTS_Tests.ttcn, line 3317 */
RSL__Types::RSL__IE__MS__Power_template ms__power(RSL__Types::ts__RSL__IE__MS__Power(pwr__var, RSL__Types::ts__RSL__IE__MS__Power_fpc__epc_defval));
current_location.update_lineno(3318);
/* BTS_Tests.ttcn, line 3318 */
RSL__Types::RSL__IE_template pwr;
{
RSL__Types::RSL__IE__Body_template tmp_346;
tmp_346.ms__power() = ms__power;
pwr = RSL__Types::t__RSL__IE(RSL__Types::RSL__IE__Type::RSL__IE__MS__POWER, tmp_346);
}
current_location.update_lineno(3321);
/* BTS_Tests.ttcn, line 3321 */
{
RSL__Types::RSL__IE__List tmp_347;
tmp_347.set_size(1);
tmp_347[0] = pwr.valueof();
f__est__dchan(f__est__dchan_encr__enable_defval, tmp_347, f__est__dchan_act__type_defval);
}
current_location.update_lineno(3324);
/* BTS_Tests.ttcn, line 3324 */
f__wait__for__l1__power__level(pwr__var);
current_location.update_lineno(3328);
/* BTS_Tests.ttcn, line 3328 */
RSL__Emulation::RSL__DchanHdlr_component_RSL.send(RSL__Types::ts__RSL__MS__PWR__CTRL__with__pp(GSM__Types::RslChannelNr_template(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr), pwr__target__val), FALSE, NULL);
current_location.update_lineno(3331);
/* BTS_Tests.ttcn, line 3331 */
TIMER T1("T1", 1.0e1);
current_location.update_lineno(3332);
/* BTS_Tests.ttcn, line 3332 */
T1.start();
current_location.update_lineno(3333);
/* BTS_Tests.ttcn, line 3333 */
{
tmp_348:
alt_status tmp_348_alt_flag_0 = ALT_MAYBE;
alt_status tmp_348_alt_flag_1 = ALT_MAYBE;
alt_status tmp_348_alt_flag_2 = ALT_MAYBE;
alt_status tmp_348_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_348_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(3334);
/* BTS_Tests.ttcn, line 3334 */
tmp_348_alt_flag_0 = as__l1__sacch__l1h_instance(l1h, as__l1__sacch__l1h_do__apply_defval, first_run);
if (tmp_348_alt_flag_0 == ALT_REPEAT) goto tmp_348;
if (tmp_348_alt_flag_0 == ALT_BREAK) break;
if (tmp_348_alt_flag_0 == ALT_YES) {
current_location.update_lineno(3334);
/* BTS_Tests.ttcn, line 3334 */
goto tmp_348;
}
}
if (tmp_348_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(3335);
/* BTS_Tests.ttcn, line 3335 */
tmp_348_alt_flag_1 = ConnHdlr_component_L1CTL.receive(any_compref, NULL, NULL, NULL);
if (tmp_348_alt_flag_1 == ALT_YES) {
current_location.update_lineno(3335);
/* BTS_Tests.ttcn, line 3335 */
goto tmp_348;
}
}
if (tmp_348_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(3336);
/* BTS_Tests.ttcn, line 3336 */
tmp_348_alt_flag_2 = T1.timeout(NULL);
if (tmp_348_alt_flag_2 == ALT_YES) {
current_location.update_lineno(3337);
/* BTS_Tests.ttcn, line 3337 */
if ((!(l1h.is_bound()))) {
current_location.update_lineno(3338);
/* BTS_Tests.ttcn, line 3338 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("No SACCH blocks were received"),TTCN_Logger::end_event_log2str()));
}
else {
current_location.update_lineno(3339);
/* BTS_Tests.ttcn, line 3339 */
if (f__power__level__is__lowest__dbm(const_cast< const GSM__RR__Types::SacchL1Header&>(l1h).ms__power__lvl())) {
current_location.update_lineno(3340);
/* BTS_Tests.ttcn, line 3340 */
TTCN_Runtime::setverdict(PASS,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Power level increased to lowest power value"),TTCN_Logger::end_event_log2str()));
}
else {
current_location.update_lineno(3342);
/* BTS_Tests.ttcn, line 3342 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Power level NOT increased to lowest power value"),TTCN_Logger::end_event_log2str()));
}
}
break;
}
}
if (tmp_348_default_flag == ALT_MAYBE) {
tmp_348_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_348_default_flag == ALT_YES || tmp_348_default_flag == ALT_BREAK) break;
else if (tmp_348_default_flag == ALT_REPEAT) goto tmp_348;
}
current_location.update_lineno(3333);
/* BTS_Tests.ttcn, line 3333 */
if (tmp_348_alt_flag_0 == ALT_NO && tmp_348_alt_flag_1 == ALT_NO && tmp_348_alt_flag_2 == ALT_NO && tmp_348_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file BTS_Tests.ttcn between lines 3333 and 3345.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(3347);
/* BTS_Tests.ttcn, line 3347 */
f__rsl__chan__deact();
current_location.update_lineno(3348);
/* BTS_Tests.ttcn, line 3348 */
L1CTL__PortType::f__L1CTL__DM__REL__REQ(ConnHdlr_component_L1CTL, RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr);
}

void start_f__TC__rsl__ms__pwr__dyn__down(const COMPONENT& component_reference, const CHARSTRING& id)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_TC_rsl_ms_pwr_dyn_down(");
id.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_TC_rsl_ms_pwr_dyn_down", text_buf);
id.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__TC__rsl__ms__pwr__dyn__active(const CHARSTRING& )
{
TTCN_Location current_location("BTS_Tests.ttcn", 3354, TTCN_Location::LOCATION_FUNCTION, "f_TC_rsl_ms_pwr_dyn_active");
current_location.update_lineno(3355);
/* BTS_Tests.ttcn, line 3355 */
GSM__RR__Types::SacchL1Header l1h;
current_location.update_lineno(3358);
/* BTS_Tests.ttcn, line 3358 */
f__trxc__fake__rssi(GSM__Types::rxlev2dbm(50));
current_location.update_lineno(3359);
/* BTS_Tests.ttcn, line 3359 */
f__l1__tune(ConnHdlr_component_L1CTL, f__l1__tune_ccch__mode_defval);
current_location.update_lineno(3360);
/* BTS_Tests.ttcn, line 3360 */
RSL__Emulation::RSL__DchanHdlr_component_RSL.clear();
current_location.update_lineno(3362);
/* BTS_Tests.ttcn, line 3362 */
INTEGER pwr__var(5);
current_location.update_lineno(3364);
/* BTS_Tests.ttcn, line 3364 */
RSL__Types::RSL__IE__MS__Power_template ms__power(RSL__Types::ts__RSL__IE__MS__Power(pwr__var, RSL__Types::ts__RSL__IE__MS__Power_fpc__epc_defval));
current_location.update_lineno(3365);
/* BTS_Tests.ttcn, line 3365 */
RSL__Types::RSL__IE_template pwr;
{
RSL__Types::RSL__IE__Body_template tmp_349;
tmp_349.ms__power() = ms__power;
pwr = RSL__Types::t__RSL__IE(RSL__Types::RSL__IE__Type::RSL__IE__MS__POWER, tmp_349);
}
current_location.update_lineno(3368);
/* BTS_Tests.ttcn, line 3368 */
{
RSL__Types::RSL__IE__List tmp_350;
tmp_350.set_size(1);
tmp_350[0] = pwr.valueof();
f__est__dchan(f__est__dchan_encr__enable_defval, tmp_350, f__est__dchan_act__type_defval);
}
current_location.update_lineno(3371);
/* BTS_Tests.ttcn, line 3371 */
f__wait__for__l1__power__level(pwr__var);
current_location.update_lineno(3374);
/* BTS_Tests.ttcn, line 3374 */
TIMER T1("T1", 1.0e1);
current_location.update_lineno(3375);
/* BTS_Tests.ttcn, line 3375 */
T1.start();
current_location.update_lineno(3376);
/* BTS_Tests.ttcn, line 3376 */
{
tmp_351:
alt_status tmp_351_alt_flag_0 = ALT_MAYBE;
alt_status tmp_351_alt_flag_1 = ALT_MAYBE;
alt_status tmp_351_alt_flag_2 = ALT_MAYBE;
alt_status tmp_351_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_351_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(3377);
/* BTS_Tests.ttcn, line 3377 */
tmp_351_alt_flag_0 = as__l1__sacch__l1h_instance(l1h, FALSE, first_run);
if (tmp_351_alt_flag_0 == ALT_REPEAT) goto tmp_351;
if (tmp_351_alt_flag_0 == ALT_BREAK) break;
if (tmp_351_alt_flag_0 == ALT_YES) {
current_location.update_lineno(3378);
/* BTS_Tests.ttcn, line 3378 */
if ((const_cast< const GSM__RR__Types::SacchL1Header&>(l1h).ms__power__lvl() != pwr__var)) {
current_location.update_lineno(3379);
/* BTS_Tests.ttcn, line 3379 */
Misc__Helpers::f__shutdown(cs_4, 3379, FAIL, cs_50);
}
current_location.update_lineno(3382);
/* BTS_Tests.ttcn, line 3382 */
goto tmp_351;
}
}
if (tmp_351_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(3384);
/* BTS_Tests.ttcn, line 3384 */
tmp_351_alt_flag_1 = ConnHdlr_component_L1CTL.receive(any_compref, NULL, NULL, NULL);
if (tmp_351_alt_flag_1 == ALT_YES) {
current_location.update_lineno(3384);
/* BTS_Tests.ttcn, line 3384 */
goto tmp_351;
}
}
if (tmp_351_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(3385);
/* BTS_Tests.ttcn, line 3385 */
tmp_351_alt_flag_2 = T1.timeout(NULL);
if (tmp_351_alt_flag_2 == ALT_YES) {
current_location.update_lineno(3385);
/* BTS_Tests.ttcn, line 3385 */
TTCN_Runtime::setverdict(PASS);
break;
}
}
if (tmp_351_default_flag == ALT_MAYBE) {
tmp_351_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_351_default_flag == ALT_YES || tmp_351_default_flag == ALT_BREAK) break;
else if (tmp_351_default_flag == ALT_REPEAT) goto tmp_351;
}
current_location.update_lineno(3376);
/* BTS_Tests.ttcn, line 3376 */
if (tmp_351_alt_flag_0 == ALT_NO && tmp_351_alt_flag_1 == ALT_NO && tmp_351_alt_flag_2 == ALT_NO && tmp_351_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file BTS_Tests.ttcn between lines 3376 and 3386.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(3388);
/* BTS_Tests.ttcn, line 3388 */
f__rsl__chan__deact();
current_location.update_lineno(3389);
/* BTS_Tests.ttcn, line 3389 */
L1CTL__PortType::f__L1CTL__DM__REL__REQ(ConnHdlr_component_L1CTL, RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr);
}

void start_f__TC__rsl__ms__pwr__dyn__active(const COMPONENT& component_reference, const CHARSTRING& id)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_TC_rsl_ms_pwr_dyn_active(");
id.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_TC_rsl_ms_pwr_dyn_active", text_buf);
id.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__TC__rsl__ms__pwr__dyn__active2(const CHARSTRING& )
{
TTCN_Location current_location("BTS_Tests.ttcn", 3395, TTCN_Location::LOCATION_FUNCTION, "f_TC_rsl_ms_pwr_dyn_active2");
current_location.update_lineno(3396);
/* BTS_Tests.ttcn, line 3396 */
GSM__RR__Types::SacchL1Header l1h;
current_location.update_lineno(3399);
/* BTS_Tests.ttcn, line 3399 */
f__trxc__fake__rssi(GSM__Types::rxlev2dbm(50));
current_location.update_lineno(3400);
/* BTS_Tests.ttcn, line 3400 */
f__l1__tune(ConnHdlr_component_L1CTL, f__l1__tune_ccch__mode_defval);
current_location.update_lineno(3401);
/* BTS_Tests.ttcn, line 3401 */
RSL__Emulation::RSL__DchanHdlr_component_RSL.clear();
current_location.update_lineno(3403);
/* BTS_Tests.ttcn, line 3403 */
INTEGER pwr__var(5);
current_location.update_lineno(3405);
/* BTS_Tests.ttcn, line 3405 */
RSL__Types::RSL__IE__MS__Power_template ms__power(RSL__Types::ts__RSL__IE__MS__Power(pwr__var, RSL__Types::ts__RSL__IE__MS__Power_fpc__epc_defval));
current_location.update_lineno(3406);
/* BTS_Tests.ttcn, line 3406 */
RSL__Types::RSL__IE_template pwr;
{
RSL__Types::RSL__IE__Body_template tmp_352;
tmp_352.ms__power() = ms__power;
pwr = RSL__Types::t__RSL__IE(RSL__Types::RSL__IE__Type::RSL__IE__MS__POWER, tmp_352);
}
current_location.update_lineno(3409);
/* BTS_Tests.ttcn, line 3409 */
{
RSL__Types::RSL__IE__List tmp_353;
tmp_353.set_size(1);
tmp_353[0] = pwr.valueof();
f__est__dchan(f__est__dchan_encr__enable_defval, tmp_353, f__est__dchan_act__type_defval);
}
current_location.update_lineno(3412);
/* BTS_Tests.ttcn, line 3412 */
f__wait__for__l1__power__level(pwr__var);
current_location.update_lineno(3415);
/* BTS_Tests.ttcn, line 3415 */
RSL__Emulation::RSL__DchanHdlr_component_RSL.send(RSL__Types::ts__RSL__MS__PWR__CTRL(GSM__Types::RslChannelNr_template(RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr), ms__power), FALSE, NULL);
current_location.update_lineno(3418);
/* BTS_Tests.ttcn, line 3418 */
TIMER T1("T1", 1.0e1);
current_location.update_lineno(3419);
/* BTS_Tests.ttcn, line 3419 */
T1.start();
current_location.update_lineno(3420);
/* BTS_Tests.ttcn, line 3420 */
{
tmp_354:
alt_status tmp_354_alt_flag_0 = ALT_MAYBE;
alt_status tmp_354_alt_flag_1 = ALT_MAYBE;
alt_status tmp_354_alt_flag_2 = ALT_MAYBE;
alt_status tmp_354_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_354_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(3421);
/* BTS_Tests.ttcn, line 3421 */
tmp_354_alt_flag_0 = as__l1__sacch__l1h_instance(l1h, FALSE, first_run);
if (tmp_354_alt_flag_0 == ALT_REPEAT) goto tmp_354;
if (tmp_354_alt_flag_0 == ALT_BREAK) break;
if (tmp_354_alt_flag_0 == ALT_YES) {
current_location.update_lineno(3422);
/* BTS_Tests.ttcn, line 3422 */
if ((const_cast< const GSM__RR__Types::SacchL1Header&>(l1h).ms__power__lvl() != pwr__var)) {
current_location.update_lineno(3423);
/* BTS_Tests.ttcn, line 3423 */
Misc__Helpers::f__shutdown(cs_4, 3423, FAIL, cs_50);
}
current_location.update_lineno(3426);
/* BTS_Tests.ttcn, line 3426 */
goto tmp_354;
}
}
if (tmp_354_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(3428);
/* BTS_Tests.ttcn, line 3428 */
tmp_354_alt_flag_1 = ConnHdlr_component_L1CTL.receive(any_compref, NULL, NULL, NULL);
if (tmp_354_alt_flag_1 == ALT_YES) {
current_location.update_lineno(3428);
/* BTS_Tests.ttcn, line 3428 */
goto tmp_354;
}
}
if (tmp_354_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(3429);
/* BTS_Tests.ttcn, line 3429 */
tmp_354_alt_flag_2 = T1.timeout(NULL);
if (tmp_354_alt_flag_2 == ALT_YES) {
current_location.update_lineno(3429);
/* BTS_Tests.ttcn, line 3429 */
TTCN_Runtime::setverdict(PASS);
break;
}
}
if (tmp_354_default_flag == ALT_MAYBE) {
tmp_354_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_354_default_flag == ALT_YES || tmp_354_default_flag == ALT_BREAK) break;
else if (tmp_354_default_flag == ALT_REPEAT) goto tmp_354;
}
current_location.update_lineno(3420);
/* BTS_Tests.ttcn, line 3420 */
if (tmp_354_alt_flag_0 == ALT_NO && tmp_354_alt_flag_1 == ALT_NO && tmp_354_alt_flag_2 == ALT_NO && tmp_354_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file BTS_Tests.ttcn between lines 3420 and 3430.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(3432);
/* BTS_Tests.ttcn, line 3432 */
f__rsl__chan__deact();
current_location.update_lineno(3433);
/* BTS_Tests.ttcn, line 3433 */
L1CTL__PortType::f__L1CTL__DM__REL__REQ(ConnHdlr_component_L1CTL, RSL__Emulation::RSL__DchanHdlr_component_g__chan__nr);
}

void start_f__TC__rsl__ms__pwr__dyn__active2(const COMPONENT& component_reference, const CHARSTRING& id)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_TC_rsl_ms_pwr_dyn_active2(");
id.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_TC_rsl_ms_pwr_dyn_active2", text_buf);
id.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__wait__for__l1__power__level(const INTEGER& level)
{
TTCN_Location current_location("BTS_Tests.ttcn", 3437, TTCN_Location::LOCATION_FUNCTION, "f_wait_for_l1_power_level");
current_location.update_lineno(3438);
/* BTS_Tests.ttcn, line 3438 */
GSM__RR__Types::SacchL1Header l1h;
current_location.update_lineno(3439);
/* BTS_Tests.ttcn, line 3439 */
TIMER T0("T0", 1.0e1);
current_location.update_lineno(3440);
/* BTS_Tests.ttcn, line 3440 */
T0.start();
current_location.update_lineno(3441);
/* BTS_Tests.ttcn, line 3441 */
{
tmp_355:
alt_status tmp_355_alt_flag_0 = ALT_MAYBE;
alt_status tmp_355_alt_flag_1 = ALT_MAYBE;
alt_status tmp_355_alt_flag_2 = ALT_MAYBE;
alt_status tmp_355_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_355_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(3442);
/* BTS_Tests.ttcn, line 3442 */
tmp_355_alt_flag_0 = as__l1__sacch__l1h_instance(l1h, FALSE, first_run);
if (tmp_355_alt_flag_0 == ALT_REPEAT) goto tmp_355;
if (tmp_355_alt_flag_0 == ALT_BREAK) break;
if (tmp_355_alt_flag_0 == ALT_YES) {
current_location.update_lineno(3443);
/* BTS_Tests.ttcn, line 3443 */
if ((const_cast< const GSM__RR__Types::SacchL1Header&>(l1h).ms__power__lvl() != level)) {
current_location.update_lineno(3444);
/* BTS_Tests.ttcn, line 3444 */
Misc__Helpers::f__shutdown(cs_4, 3444, FAIL, cs_51);
}
break;
}
}
if (tmp_355_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(3448);
/* BTS_Tests.ttcn, line 3448 */
tmp_355_alt_flag_1 = ConnHdlr_component_L1CTL.receive(any_compref, NULL, NULL, NULL);
if (tmp_355_alt_flag_1 == ALT_YES) {
current_location.update_lineno(3448);
/* BTS_Tests.ttcn, line 3448 */
goto tmp_355;
}
}
if (tmp_355_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(3449);
/* BTS_Tests.ttcn, line 3449 */
tmp_355_alt_flag_2 = T0.timeout(NULL);
if (tmp_355_alt_flag_2 == ALT_YES) {
current_location.update_lineno(3450);
/* BTS_Tests.ttcn, line 3450 */
Misc__Helpers::f__shutdown(cs_4, 3450, FAIL, cs_52);
break;
}
}
if (tmp_355_default_flag == ALT_MAYBE) {
tmp_355_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_355_default_flag == ALT_YES || tmp_355_default_flag == ALT_BREAK) break;
else if (tmp_355_default_flag == ALT_REPEAT) goto tmp_355;
}
current_location.update_lineno(3441);
/* BTS_Tests.ttcn, line 3441 */
if (tmp_355_alt_flag_0 == ALT_NO && tmp_355_alt_flag_1 == ALT_NO && tmp_355_alt_flag_2 == ALT_NO && tmp_355_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file BTS_Tests.ttcn between lines 3441 and 3453.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(3454);
/* BTS_Tests.ttcn, line 3454 */
T0.stop();
}

void start_f__wait__for__l1__power__level(const COMPONENT& component_reference, const INTEGER& level)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_wait_for_l1_power_level(");
level.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_wait_for_l1_power_level", text_buf);
level.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

BOOLEAN f__power__level__is__lowest__dbm(const INTEGER& level)
{
TTCN_Location current_location("BTS_Tests.ttcn", 3457, TTCN_Location::LOCATION_FUNCTION, "f_power_level_is_lowest_dbm");
current_location.update_lineno(3458);
/* BTS_Tests.ttcn, line 3458 */
Osmocom__Types::IntegerRecord min__dbm__level;
current_location.update_lineno(3459);
/* BTS_Tests.ttcn, line 3459 */
Osmocom__Types::IntegerRecord max__dbm__level;
current_location.update_lineno(3460);
/* BTS_Tests.ttcn, line 3460 */
Osmocom__Types::IntegerRecord x;
Osmocom__Types::IntegerRecord tmp_356;
Osmocom__Types::IntegerRecord tmp_357;
Osmocom__Types::IntegerRecord tmp_358 = f__power__from__band(const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).bts0__band(), tmp_356, tmp_357);
if (tmp_356.is_bound()) min__dbm__level = tmp_356;
if (tmp_357.is_bound()) max__dbm__level = tmp_357;
x = tmp_358;
{
current_location.update_lineno(3462);
/* BTS_Tests.ttcn, line 3462 */
INTEGER i(0);
current_location.update_lineno(3462);
/* BTS_Tests.ttcn, line 3462 */
for ( ; ; ) {
current_location.update_lineno(3462);
/* BTS_Tests.ttcn, line 3462 */
if (!(i < min__dbm__level.size_of())) break;
current_location.update_lineno(3463);
/* BTS_Tests.ttcn, line 3463 */
if ((const_cast< const Osmocom__Types::IntegerRecord&>(min__dbm__level)[i] == level)) {
current_location.update_lineno(3464);
/* BTS_Tests.ttcn, line 3464 */
return TRUE;
}
current_location.update_lineno(3462);
/* BTS_Tests.ttcn, line 3462 */
{
INTEGER tmp_359;
++i;
}
}
}
current_location.update_lineno(3467);
/* BTS_Tests.ttcn, line 3467 */
return FALSE;
}

void start_f__power__level__is__lowest__dbm(const COMPONENT& component_reference, const INTEGER& level)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_power_level_is_lowest_dbm(");
level.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_power_level_is_lowest_dbm", text_buf);
level.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

BOOLEAN f__power__level__is__highest__dbm(const INTEGER& level)
{
TTCN_Location current_location("BTS_Tests.ttcn", 3470, TTCN_Location::LOCATION_FUNCTION, "f_power_level_is_highest_dbm");
current_location.update_lineno(3471);
/* BTS_Tests.ttcn, line 3471 */
Osmocom__Types::IntegerRecord min__dbm__level;
current_location.update_lineno(3472);
/* BTS_Tests.ttcn, line 3472 */
Osmocom__Types::IntegerRecord max__dbm__level;
current_location.update_lineno(3473);
/* BTS_Tests.ttcn, line 3473 */
Osmocom__Types::IntegerRecord x;
Osmocom__Types::IntegerRecord tmp_360;
Osmocom__Types::IntegerRecord tmp_361;
Osmocom__Types::IntegerRecord tmp_362 = f__power__from__band(const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).bts0__band(), tmp_360, tmp_361);
if (tmp_360.is_bound()) min__dbm__level = tmp_360;
if (tmp_361.is_bound()) max__dbm__level = tmp_361;
x = tmp_362;
{
current_location.update_lineno(3475);
/* BTS_Tests.ttcn, line 3475 */
INTEGER i(0);
current_location.update_lineno(3475);
/* BTS_Tests.ttcn, line 3475 */
for ( ; ; ) {
current_location.update_lineno(3475);
/* BTS_Tests.ttcn, line 3475 */
if (!(i < max__dbm__level.size_of())) break;
current_location.update_lineno(3476);
/* BTS_Tests.ttcn, line 3476 */
if ((const_cast< const Osmocom__Types::IntegerRecord&>(max__dbm__level)[i] == level)) {
current_location.update_lineno(3477);
/* BTS_Tests.ttcn, line 3477 */
return TRUE;
}
current_location.update_lineno(3475);
/* BTS_Tests.ttcn, line 3475 */
{
INTEGER tmp_363;
++i;
}
}
}
current_location.update_lineno(3480);
/* BTS_Tests.ttcn, line 3480 */
return FALSE;
}

void start_f__power__level__is__highest__dbm(const COMPONENT& component_reference, const INTEGER& level)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_power_level_is_highest_dbm(");
level.log();
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_power_level_is_highest_dbm", text_buf);
level.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

INTEGER f__get__max__power__from__band()
{
TTCN_Location current_location("BTS_Tests.ttcn", 3483, TTCN_Location::LOCATION_FUNCTION, "f_get_max_power_from_band");
current_location.update_lineno(3484);
/* BTS_Tests.ttcn, line 3484 */
Osmocom__Types::IntegerRecord min__dbm__level;
current_location.update_lineno(3485);
/* BTS_Tests.ttcn, line 3485 */
Osmocom__Types::IntegerRecord max__dbm__level;
current_location.update_lineno(3486);
/* BTS_Tests.ttcn, line 3486 */
Osmocom__Types::IntegerRecord x;
Osmocom__Types::IntegerRecord tmp_364;
Osmocom__Types::IntegerRecord tmp_365;
Osmocom__Types::IntegerRecord tmp_366 = f__power__from__band(const_cast< const ConnHdlrPars&>(ConnHdlr_component_g__pars).bts0__band(), tmp_364, tmp_365);
if (tmp_364.is_bound()) min__dbm__level = tmp_364;
if (tmp_365.is_bound()) max__dbm__level = tmp_365;
x = tmp_366;
current_location.update_lineno(3487);
/* BTS_Tests.ttcn, line 3487 */
return const_cast< const Osmocom__Types::IntegerRecord&>(max__dbm__level)[0];
}

void start_f__get__max__power__from__band(const COMPONENT& component_reference)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_get_max_power_from_band(");
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_get_max_power_from_band", text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

Osmocom__Types::IntegerRecord f__power__from__band(const CHARSTRING& band, Osmocom__Types::IntegerRecord& min__dbm__level, Osmocom__Types::IntegerRecord& max__dbm__level)
{
TTCN_Location current_location("BTS_Tests.ttcn", 3492, TTCN_Location::LOCATION_FUNCTION, "f_power_from_band");
current_location.update_lineno(3494);
/* BTS_Tests.ttcn, line 3494 */
Osmocom__Types::IntegerRecord gsm__power;
gsm__power.set_size(32);
gsm__power[0] = 31;
gsm__power[1] = 30;
gsm__power[2] = 29;
gsm__power[3] = 28;
gsm__power[4] = 27;
gsm__power[5] = 26;
gsm__power[6] = 25;
gsm__power[7] = 24;
gsm__power[8] = 23;
gsm__power[9] = 22;
gsm__power[10] = 21;
gsm__power[11] = 20;
gsm__power[12] = 19;
gsm__power[13] = 18;
gsm__power[14] = 17;
gsm__power[15] = 16;
gsm__power[16] = 15;
gsm__power[17] = 14;
gsm__power[18] = 13;
gsm__power[19] = 12;
gsm__power[20] = 11;
gsm__power[21] = 10;
gsm__power[22] = 9;
gsm__power[23] = 8;
gsm__power[24] = 7;
gsm__power[25] = 6;
gsm__power[26] = 5;
gsm__power[27] = 4;
gsm__power[28] = 3;
gsm__power[29] = 2;
gsm__power[30] = 1;
gsm__power[31] = 0;
current_location.update_lineno(3497);
/* BTS_Tests.ttcn, line 3497 */
Osmocom__Types::IntegerRecord dcs__power;
dcs__power.set_size(32);
dcs__power[0] = 28;
dcs__power[1] = 27;
dcs__power[2] = 26;
dcs__power[3] = 25;
dcs__power[4] = 24;
dcs__power[5] = 23;
dcs__power[6] = 22;
dcs__power[7] = 21;
dcs__power[8] = 20;
dcs__power[9] = 19;
dcs__power[10] = 18;
dcs__power[11] = 17;
dcs__power[12] = 16;
dcs__power[13] = 15;
dcs__power[14] = 14;
dcs__power[15] = 13;
dcs__power[16] = 12;
dcs__power[17] = 11;
dcs__power[18] = 10;
dcs__power[19] = 9;
dcs__power[20] = 8;
dcs__power[21] = 7;
dcs__power[22] = 6;
dcs__power[23] = 5;
dcs__power[24] = 4;
dcs__power[25] = 3;
dcs__power[26] = 2;
dcs__power[27] = 1;
dcs__power[28] = 0;
dcs__power[29] = 31;
dcs__power[30] = 30;
dcs__power[31] = 29;
current_location.update_lineno(3499);
/* BTS_Tests.ttcn, line 3499 */
Osmocom__Types::IntegerRecord pcs__power;
pcs__power.set_size(18);
pcs__power[0] = 15;
pcs__power[1] = 14;
pcs__power[2] = 13;
pcs__power[3] = 12;
pcs__power[4] = 11;
pcs__power[5] = 10;
pcs__power[6] = 9;
pcs__power[7] = 8;
pcs__power[8] = 7;
pcs__power[9] = 6;
pcs__power[10] = 5;
pcs__power[11] = 4;
pcs__power[12] = 3;
pcs__power[13] = 2;
pcs__power[14] = 1;
pcs__power[15] = 0;
pcs__power[16] = 31;
pcs__power[17] = 30;
current_location.update_lineno(3500);
/* BTS_Tests.ttcn, line 3500 */
Osmocom__Types::IntegerRecord rv;
{
const CHARSTRING &tmp_368 = band;
current_location.update_lineno(3503);
/* BTS_Tests.ttcn, line 3503 */
if(BtsBand__allGSM.match(tmp_368)) goto tmp_367_0;
current_location.update_lineno(3508);
/* BTS_Tests.ttcn, line 3508 */
if(tmp_368 == cs_54) goto tmp_367_1;
current_location.update_lineno(3513);
/* BTS_Tests.ttcn, line 3513 */
if(tmp_368 == cs_55) goto tmp_367_2;
goto tmp_367_3;
tmp_367_0:
{
current_location.update_lineno(3504);
/* BTS_Tests.ttcn, line 3504 */
rv = gsm__power;
current_location.update_lineno(3505);
/* BTS_Tests.ttcn, line 3505 */
min__dbm__level.set_size(13);
min__dbm__level[0] = 31;
min__dbm__level[1] = 30;
min__dbm__level[2] = 29;
min__dbm__level[3] = 28;
min__dbm__level[4] = 27;
min__dbm__level[5] = 26;
min__dbm__level[6] = 25;
min__dbm__level[7] = 24;
min__dbm__level[8] = 23;
min__dbm__level[9] = 22;
min__dbm__level[10] = 21;
min__dbm__level[11] = 20;
min__dbm__level[12] = 19;
current_location.update_lineno(3506);
/* BTS_Tests.ttcn, line 3506 */
max__dbm__level.set_size(3);
max__dbm__level[0] = 2;
max__dbm__level[1] = 1;
max__dbm__level[2] = 0;
goto tmp_367_end;
}
tmp_367_1:
{
current_location.update_lineno(3509);
/* BTS_Tests.ttcn, line 3509 */
rv = dcs__power;
current_location.update_lineno(3510);
/* BTS_Tests.ttcn, line 3510 */
min__dbm__level.set_size(14);
min__dbm__level[0] = 28;
min__dbm__level[1] = 27;
min__dbm__level[2] = 26;
min__dbm__level[3] = 25;
min__dbm__level[4] = 24;
min__dbm__level[5] = 23;
min__dbm__level[6] = 22;
min__dbm__level[7] = 21;
min__dbm__level[8] = 20;
min__dbm__level[9] = 19;
min__dbm__level[10] = 18;
min__dbm__level[11] = 17;
min__dbm__level[12] = 16;
min__dbm__level[13] = 15;
current_location.update_lineno(3511);
/* BTS_Tests.ttcn, line 3511 */
max__dbm__level.set_size(2);
max__dbm__level[0] = 0;
max__dbm__level[1] = 29;
goto tmp_367_end;
}
tmp_367_2:
{
current_location.update_lineno(3514);
/* BTS_Tests.ttcn, line 3514 */
rv = pcs__power;
current_location.update_lineno(3515);
/* BTS_Tests.ttcn, line 3515 */
min__dbm__level.set_size(1);
min__dbm__level[0] = 15;
current_location.update_lineno(3516);
/* BTS_Tests.ttcn, line 3516 */
max__dbm__level.set_size(1);
max__dbm__level[0] = 30;
goto tmp_367_end;
}
tmp_367_3:
{
current_location.update_lineno(3519);
/* BTS_Tests.ttcn, line 3519 */
Misc__Helpers::f__shutdown(cs_4, 3519, FAIL, (cs_56 + band));
goto tmp_367_end;
}
tmp_367_end: /* empty */;
}
current_location.update_lineno(3523);
/* BTS_Tests.ttcn, line 3523 */
return rv;
}

CHARSTRING f__vty__get__bts0__band()
{
TTCN_Location current_location("BTS_Tests.ttcn", 3526, TTCN_Location::LOCATION_FUNCTION, "f_vty_get_bts0_band");
current_location.update_lineno(3527);
/* BTS_Tests.ttcn, line 3527 */
return Osmocom__VTY__Functions::f__vty__transceive__match__regex(test__CT_component_BTSVTY, cs_57, cs_58, 0);
}

void start_f__vty__get__bts0__band(const COMPONENT& component_reference)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_vty_get_bts0_band(");
TTCN_Logger::log_event_str(") on component ");
component_reference.log();
TTCN_Logger::log_char('.');
TTCN_Logger::end_event();
Text_Buf text_buf;
TTCN_Runtime::prepare_start_component(component_reference, "BTS_Tests", "f_vty_get_bts0_band", text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

verdicttype testcase_TC__rsl__ms__pwr__dyn__ass__updown(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests.ttcn", 3530, TTCN_Location::LOCATION_TESTCASE, "TC_rsl_ms_pwr_dyn_ass_updown");
try {
TTCN_Runtime::begin_testcase("BTS_Tests", "TC_rsl_ms_pwr_dyn_ass_updown", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(3531);
/* BTS_Tests.ttcn, line 3531 */
COMPONENT vc__conn;
current_location.update_lineno(3532);
/* BTS_Tests.ttcn, line 3532 */
ConnHdlrPars pars;
current_location.update_lineno(3533);
/* BTS_Tests.ttcn, line 3533 */
f__init(f__init_trx__nr_defval);
current_location.update_lineno(3534);
/* BTS_Tests.ttcn, line 3534 */
Osmocom__VTY__Functions::f__vty__config(test__CT_component_BTSVTY, cs_59, cs_60);
{
current_location.update_lineno(3535);
/* BTS_Tests.ttcn, line 3535 */
INTEGER tn(1);
current_location.update_lineno(3535);
/* BTS_Tests.ttcn, line 3535 */
for ( ; ; ) {
current_location.update_lineno(3535);
/* BTS_Tests.ttcn, line 3535 */
if (!(tn <= 1)) break;
current_location.update_lineno(3536);
/* BTS_Tests.ttcn, line 3536 */
pars = t__Pars(GSM__Types::t__RslChanNr__Bm(INTEGER_template(tn)), RSL__Types::ts__RSL__ChanMode__SIGN(RSL__Types::ts__RSL__ChanMode__SIGN_t_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxd_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxu_defval), t__Pars_spec_defval, t__Pars_trx__nr_defval, t__Pars_t__guard_defval).valueof();
current_location.update_lineno(3537);
/* BTS_Tests.ttcn, line 3537 */
pars.bts0__band() = f__vty__get__bts0__band();
current_location.update_lineno(3538);
/* BTS_Tests.ttcn, line 3538 */
vc__conn = f__start__handler(&f__TC__rsl__ms__pwr__dyn__ass__updown, pars, f__start__handler_pcu__comp_defval, TRUE, f__start__handler_l1ctl_defval);
current_location.update_lineno(3539);
/* BTS_Tests.ttcn, line 3539 */
{
tmp_381:
alt_status alt_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (alt_flag != ALT_NO) {
alt_flag = vc__conn.done(NULL, NULL);
if (alt_flag == ALT_YES) break;
else if (alt_flag == ALT_REPEAT) goto tmp_381;
}
if (default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps(first_run);
if (default_flag == ALT_YES || default_flag == ALT_BREAK) break;
else if (default_flag == ALT_REPEAT) goto tmp_381;
}
current_location.update_lineno(3539);
/* BTS_Tests.ttcn, line 3539 */
if (alt_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("Stand-alone done statement failed in file BTS_Tests.ttcn, line 3539.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(3535);
/* BTS_Tests.ttcn, line 3535 */
{
INTEGER tmp_382;
++tn;
}
}
}
current_location.update_lineno(3541);
/* BTS_Tests.ttcn, line 3541 */
Osmocom__VTY__Functions::f__vty__config(test__CT_component_BTSVTY, cs_59, cs_61);
current_location.update_lineno(3542);
/* BTS_Tests.ttcn, line 3542 */
Misc__Helpers::f__shutdown(cs_4, 3542, Misc__Helpers::f__shutdown_verdict_defval, Misc__Helpers::f__shutdown_text_defval);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_rsl_ms_pwr_dyn_ass_updown was stopped.");
}
return TTCN_Runtime::end_testcase();
}

verdicttype testcase_TC__rsl__ms__pwr__dyn__up(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests.ttcn", 3545, TTCN_Location::LOCATION_TESTCASE, "TC_rsl_ms_pwr_dyn_up");
try {
TTCN_Runtime::begin_testcase("BTS_Tests", "TC_rsl_ms_pwr_dyn_up", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(3546);
/* BTS_Tests.ttcn, line 3546 */
COMPONENT vc__conn;
current_location.update_lineno(3547);
/* BTS_Tests.ttcn, line 3547 */
ConnHdlrPars pars;
current_location.update_lineno(3548);
/* BTS_Tests.ttcn, line 3548 */
f__init(f__init_trx__nr_defval);
current_location.update_lineno(3549);
/* BTS_Tests.ttcn, line 3549 */
Osmocom__VTY__Functions::f__vty__config(test__CT_component_BTSVTY, cs_59, cs_62);
{
current_location.update_lineno(3550);
/* BTS_Tests.ttcn, line 3550 */
INTEGER tn(1);
current_location.update_lineno(3550);
/* BTS_Tests.ttcn, line 3550 */
for ( ; ; ) {
current_location.update_lineno(3550);
/* BTS_Tests.ttcn, line 3550 */
if (!(tn <= 1)) break;
current_location.update_lineno(3551);
/* BTS_Tests.ttcn, line 3551 */
pars = t__Pars(GSM__Types::t__RslChanNr__Bm(INTEGER_template(tn)), RSL__Types::ts__RSL__ChanMode__SIGN(RSL__Types::ts__RSL__ChanMode__SIGN_t_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxd_defval, RSL__Types::ts__RSL__ChanMode__SIGN_dtxu_defval), t__Pars_spec_defval, t__Pars_trx__nr_defval, 3.0e1).valueof();
current_location.update_lineno(3552);
/* BTS_Tests.ttcn, line 3552 */
pars.bts0__band() = f__vty__get__bts0__band();
current_location.update_lineno(3553);
/* BTS_Tests.ttcn, line 3553 */
vc__conn = f__start__handler(&f__TC__rsl__ms__pwr__dyn__up, pars, f__start__handler_pcu__comp_defval, TRUE, f__start__handler_l1ctl_defval);
current_location.update_lineno(3554);
/* BTS_Tests.ttcn, line 3554 */
{
tmp_386:
alt_status alt_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (alt_flag != ALT_NO) {
alt_flag = vc__conn.done(NULL, NULL);
if (alt_flag == ALT_YES) break;
else if (alt_flag == ALT_REPEAT) goto tmp_386;
}
if (default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps(first_run);
if (default_flag == ALT_YES || default_flag == ALT_BREAK) break;
else if (default_flag == ALT_REPEAT) goto tmp_386;
}
current_location.update_lineno(3554);
/* BTS_Tests.ttcn, line 3554 */
if (alt_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("Stand-alone done statement failed in file BTS_Tests.ttcn, line 3554.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(3550);
/* BTS_Tests.ttcn, line 3550 */
{
INTEGER tmp_387;
++tn;
}
}
}
current_location.update_lineno(3556);
/* BTS_Tests.ttcn, line 3556 */
Osmocom__VTY__Functions::f__vty__config(test__CT_component_BTSVTY, cs_59, cs_61);
current_location.update_lineno(3557);
/* BTS_Tests.ttcn, line 3557 */
Misc__Helpers::f__shutdown(cs_4, 3557, Misc__Helpers::f__shutdown_verdict_defval, Misc__Helpers::f__shutdown_text_defval);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_rsl_ms_pwr_dyn_up was stopped.");
}
return TTCN_Runtime::end_testcase();
}


} /* end of namespace */
