// 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_SMSCB.hh"

namespace BTS__Tests__SMSCB {

/* Literal string constants */

const unsigned char bs_0_bits[] = { 212, 5 },
bs_1_bits[] = { 1 };
extern const BITSTRING bs_0(11, bs_0_bits),
bs_1(1, bs_1_bits);
const unsigned char os_9_octets[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 },
os_13_octets[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61 },
os_1_octets[] = { 0, 16, 0, 50, 15, 17, 65, 102, 12, 52, 77, 211, 203, 160, 154, 12, 0, 0, 0, 0, 0, 0 },
os_2_octets[] = { 0, 16, 0, 50, 15, 17, 65, 102, 12, 52, 77, 211, 203, 160, 154, 12, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 19, 20, 21, 22 },
os_3_octets[] = { 0, 16, 0, 50, 15, 17, 65, 102, 12, 52, 77, 211, 203, 160, 154, 12, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 19, 20, 21, 22, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 34, 35, 36, 37, 38 },
os_5_octets[] = { 0, 16, 0, 50, 15, 17, 65, 102, 12, 52, 77, 211, 203, 160, 154, 12, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 19, 20, 21, 22, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 34, 35, 36, 37, 38, 32, 17, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 50, 51, 52, 53, 54 },
os_4_octets[] = { 0, 16, 0, 50, 15, 17, 65, 102, 12, 52, 77, 211, 203, 160, 154, 12, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 19, 20, 21, 22, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 34, 35, 36, 37, 38, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 50, 51, 52, 53, 54 },
os_6_octets[] = { 0, 32, 0, 50, 15, 17, 65, 102, 12, 52, 77, 211, 203, 160, 154, 12, 0, 0, 0, 0, 0, 0, 0, 33, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 19, 20, 21, 22, 16, 33, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 34, 35, 36, 37, 38, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 50, 51, 52, 53, 54 },
os_7_octets[] = { 0, 48, 0, 50, 15, 17, 65, 102, 12, 52, 77, 211, 203, 160, 154, 12, 0, 0, 0, 0, 0, 0, 0, 49, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 19, 20, 21, 22, 16, 49, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 34, 35, 36, 37, 38, 32, 49, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 50, 51, 52, 53, 54 },
os_8_octets[] = { 1, 2, 3, 4, 5, 6, 7, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21 },
os_10_octets[] = { 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29 },
os_11_octets[] = { 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45 },
os_12_octets[] = { 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61 };
extern const OCTETSTRING os_0(0, NULL),
os_9(14, os_9_octets),
os_13(56, os_13_octets),
os_1(22, os_1_octets),
os_2(44, os_2_octets),
os_3(66, os_3_octets),
os_5(88, os_5_octets),
os_4(88, os_4_octets),
os_6(88, os_6_octets),
os_7(88, os_7_octets),
os_8(22, os_8_octets),
os_10(14, os_10_octets),
os_11(14, os_11_octets),
os_12(14, os_12_octets);
extern const CHARSTRING cs_12(20, "BTS_Tests_SMSCB.ttcn"),
cs_10(5, "Basic"),
cs_11(8, "Extended"),
cs_1(5, "bts 0"),
cs_9(25, "drop bts connection 0 oml"),
cs_0(7, "network"),
cs_7(28, "phys_chan_config CCCH+SDCCH4"),
cs_4(33, "phys_chan_config CCCH+SDCCH4+CBCH"),
cs_8(28, "phys_chan_config SDCCH8+CBCH"),
cs_6(22, "phys_chan_config TCH/F"),
cs_5(9, "timeslot "),
cs_3(10, "timeslot 0"),
cs_2(5, "trx 0");
const unsigned char module_checksum[] = { 0x37, 0x41, 0xe7, 0x8a, 0x83, 0x3d, 0x3c, 0x0a, 0x72, 0x6c, 0xd9, 0x59, 0x6c, 0x71, 0x35, 0xd1 };

/* Global variable definitions */

// No XER for CbchTestMsgs
const TTCN_Typedescriptor_t CbchTestMsgs_descr_ = { "@BTS_Tests_SMSCB.CbchTestMsgs", NULL, NULL, NULL, NULL, NULL, NULL, NULL, &CbchTestMsg_descr_, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING CbchTestMsg_rsl__cb__cmd_default_coding("RAW");
const XERdescriptor_t       CbchTestMsg_last__block_xer_ = { {"last_block>\n", "last_block>\n"}, {12, 12}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_Typedescriptor_t CbchTestMsg_last__block_descr_ = { "@BTS_Tests_SMSCB.CbchTestMsg.last_block", &INTEGER_ber_, &Osmocom__Types::uint2__t_raw_, &INTEGER_text_, &CbchTestMsg_last__block_xer_, &INTEGER_json_, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING CbchTestMsg_last__block_default_coding("RAW");
const XERdescriptor_t       CbchTestMsg_payload_xer_ = { {"payload>\n", "payload>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int CbchTestMsg_payload_oer_ext_arr_[0] = {};
const int CbchTestMsg_payload_oer_p_[0] = {};
const TTCN_OERdescriptor_t CbchTestMsg_payload_oer_ = { -1, TRUE, -1, FALSE, 0, 0, CbchTestMsg_payload_oer_ext_arr_, 0, CbchTestMsg_payload_oer_p_};
const TTCN_Typedescriptor_t CbchTestMsg_payload_descr_ = { "@BTS_Tests_SMSCB.CbchTestMsg.payload", &OCTETSTRING_ber_, &OCTETSTRING_raw_, &OCTETSTRING_text_, &CbchTestMsg_payload_xer_, &OCTETSTRING_json_, &CbchTestMsg_payload_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for CbchTestMsg
const TTCN_Typedescriptor_t CbchTestMsg_descr_ = { "@BTS_Tests_SMSCB.CbchTestMsg", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for CbchBlocks
const TTCN_Typedescriptor_t CbchBlocks_descr_ = { "@BTS_Tests_SMSCB.CbchBlocks", NULL, NULL, NULL, NULL, NULL, NULL, NULL, &CbchBlock_descr_, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       CbchBlock_seq__nr_xer_ = { {"seq_nr>\n", "seq_nr>\n"}, {8, 8}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const TTCN_OERdescriptor_t CbchBlock_seq__nr_oer_ = { -1, FALSE, -1, FALSE, 0, 0, NULL, 0, NULL };
const TTCN_Typedescriptor_t CbchBlock_seq__nr_descr_ = { "@BTS_Tests_SMSCB.CbchBlock.seq_nr", &INTEGER_ber_, &Osmocom__Types::uint4__t_raw_, &INTEGER_text_, &CbchBlock_seq__nr_xer_, &INTEGER_json_, &CbchBlock_seq__nr_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING CbchBlock_seq__nr_default_coding("RAW");
const XERdescriptor_t       CbchBlock_is__last_xer_ = { {"is_last>\n", "is_last>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int CbchBlock_is__last_oer_ext_arr_[0] = {};
const int CbchBlock_is__last_oer_p_[0] = {};
const TTCN_OERdescriptor_t CbchBlock_is__last_oer_ = { -1, TRUE, -1, FALSE, 0, 0, CbchBlock_is__last_oer_ext_arr_, 0, CbchBlock_is__last_oer_p_};
const TTCN_Typedescriptor_t CbchBlock_is__last_descr_ = { "@BTS_Tests_SMSCB.CbchBlock.is_last", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &CbchBlock_is__last_xer_, &BOOLEAN_json_, &CbchBlock_is__last_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
const XERdescriptor_t       CbchBlock_payload_xer_ = { {"payload>\n", "payload>\n"}, {9, 9}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int CbchBlock_payload_oer_ext_arr_[0] = {};
const int CbchBlock_payload_oer_p_[0] = {};
const TTCN_OERdescriptor_t CbchBlock_payload_oer_ = { -1, TRUE, 22, FALSE, 0, 0, CbchBlock_payload_oer_ext_arr_, 0, CbchBlock_payload_oer_p_};
const TTCN_Typedescriptor_t CbchBlock_payload_descr_ = { "@BTS_Tests_SMSCB.CbchBlock.payload", &OCTETSTRING_ber_, &General__Types::OCT22_raw_, &OCTETSTRING_text_, &CbchBlock_payload_xer_, &OCTETSTRING_json_, &CbchBlock_payload_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
UNIVERSAL_CHARSTRING CbchBlock_payload_default_coding("RAW");
const XERdescriptor_t       CbchBlock_seen__once_xer_ = { {"seen_once>\n", "seen_once>\n"}, {11, 11}, 0 |FORM_UNQUALIFIED, WHITESPACE_PRESERVE,  NULL, &module_object, -1, 0, NULL, NULL, -1, XSD_NONE };
const int CbchBlock_seen__once_oer_ext_arr_[0] = {};
const int CbchBlock_seen__once_oer_p_[0] = {};
const TTCN_OERdescriptor_t CbchBlock_seen__once_oer_ = { -1, TRUE, -1, FALSE, 0, 0, CbchBlock_seen__once_oer_ext_arr_, 0, CbchBlock_seen__once_oer_p_};
const TTCN_Typedescriptor_t CbchBlock_seen__once_descr_ = { "@BTS_Tests_SMSCB.CbchBlock.seen_once", &BOOLEAN_ber_, &BOOLEAN_raw_, &BOOLEAN_text_, &CbchBlock_seen__once_xer_, &BOOLEAN_json_, &CbchBlock_seen__once_oer_, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for CbchBlock
const TTCN_Typedescriptor_t CbchBlock_descr_ = { "@BTS_Tests_SMSCB.CbchBlock", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
// No XER for CbchTestParsChan
const TTCN_Typedescriptor_t CbchTestParsChan_descr_ = { "@BTS_Tests_SMSCB.CbchTestParsChan", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
CbchTestMsg_template template_t__CbchPC_def_defval;
const CbchTestMsg_template& t__CbchPC_def_defval = template_t__CbchPC_def_defval;
UNIVERSAL_CHARSTRING CbchTestPars_chan__nr_default_coding("RAW");
// No XER for CbchTestPars
const TTCN_Typedescriptor_t CbchTestPars_descr_ = { "@BTS_Tests_SMSCB.CbchTestPars", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, TTCN_Typedescriptor_t::DONTCARE };
RSL__Types::RSL__IE_template template_t__RSL__IE__SMSCB__EXT;
const RSL__Types::RSL__IE_template& t__RSL__IE__SMSCB__EXT = template_t__RSL__IE__SMSCB__EXT;
BOOLEAN const_f__smscb__setup__rsl__chan_extd_defval;
const BOOLEAN& f__smscb__setup__rsl__chan_extd_defval = const_f__smscb__setup__rsl__chan_extd_defval;
CbchTestMsgs const_msgs__1m__1b__norm;
const CbchTestMsgs& msgs__1m__1b__norm = const_msgs__1m__1b__norm;
CbchTestMsgs const_msgs__1m__2b__norm;
const CbchTestMsgs& msgs__1m__2b__norm = const_msgs__1m__2b__norm;
CbchTestMsgs const_msgs__1m__3b__norm;
const CbchTestMsgs& msgs__1m__3b__norm = const_msgs__1m__3b__norm;
CbchTestMsgs const_msgs__1m__4b__norm;
const CbchTestMsgs& msgs__1m__4b__norm = const_msgs__1m__4b__norm;
CbchTestMsgs const_msgs__1m__4b__sched;
const CbchTestMsgs& msgs__1m__4b__sched = const_msgs__1m__4b__sched;
CbchTestMsgs const_msgs__3m__4b__norm;
const CbchTestMsgs& msgs__3m__4b__norm = const_msgs__3m__4b__norm;
CbchTestMsgs const_msgs__1m__3b__default;
const CbchTestMsgs& msgs__1m__3b__default = const_msgs__1m__3b__default;
CbchTestMsg const_msg__default;
const CbchTestMsg& msg__default = const_msg__default;
GSM__RR__Types::GsmRrMessage_template template_tr__PagingType1;
const GSM__RR__Types::GsmRrMessage_template& tr__PagingType1 = template_tr__PagingType1;
OCTETSTRING const_c__etws__seg0;
const OCTETSTRING& c__etws__seg0 = const_c__etws__seg0;
OCTETSTRING const_c__etws__seg1;
const OCTETSTRING& c__etws__seg1 = const_c__etws__seg1;
OCTETSTRING const_c__etws__seg2;
const OCTETSTRING& c__etws__seg2 = const_c__etws__seg2;
OCTETSTRING const_c__etws__seg3;
const OCTETSTRING& c__etws__seg3 = const_c__etws__seg3;
OCTETSTRING const_c__etws;
const OCTETSTRING& c__etws = const_c__etws;
TTCN_Module module_object("BTS_Tests_SMSCB", __DATE__, __TIME__, module_checksum, pre_init_module, NULL, 0U, 4294967295U, 4294967295U, 4294967295U, NULL, 0LU, 0, post_init_module, NULL, NULL, NULL, NULL, NULL, 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 CbchTestMsg CbchTestMsgs::UNBOUND_ELEM;
CbchTestMsgs::CbchTestMsgs()
{
val_ptr = NULL;
}

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

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

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

void CbchTestMsgs::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.");
}
}

CbchTestMsgs& CbchTestMsgs::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;
}

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

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

boolean CbchTestMsgs::operator==(const CbchTestMsgs& other_value) const
{
if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @BTS_Tests_SMSCB.CbchTestMsgs.");
if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @BTS_Tests_SMSCB.CbchTestMsgs.");
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;
}

CbchTestMsg& CbchTestMsgs::operator[](int index_value)
{
if (index_value < 0) TTCN_error("Accessing an element of type @BTS_Tests_SMSCB.CbchTestMsgs 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 = (CbchTestMsg**)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 CbchTestMsg(*(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 CbchTestMsg;
}
return *val_ptr->value_elements[index_value];
}

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

const CbchTestMsg& CbchTestMsgs::operator[](int index_value) const
{
if (val_ptr == NULL)
TTCN_error("Accessing an element in an unbound value of type @BTS_Tests_SMSCB.CbchTestMsgs.");
if (index_value < 0) TTCN_error("Accessing an element of type @BTS_Tests_SMSCB.CbchTestMsgs 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_SMSCB.CbchTestMsgs: 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 CbchTestMsg& CbchTestMsgs::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a value of type @BTS_Tests_SMSCB.CbchTestMsgs.");
return (*this)[(int)index_value];
}

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

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

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

CbchTestMsgs CbchTestMsgs::operator>>=(int rotate_count) const
{
if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @BTS_Tests_SMSCB.CbchTestMsgs.");
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;
CbchTestMsgs 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 CbchTestMsg(*val_ptr->value_elements[i]);
}
}
return ret_val;
}

CbchTestMsgs CbchTestMsgs::operator+(const CbchTestMsgs& other_value) const
{
if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @BTS_Tests_SMSCB.CbchTestMsgs concatenation.");
if (val_ptr->n_elements == 0) return other_value;
if (other_value.val_ptr->n_elements == 0) return *this;
CbchTestMsgs 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 CbchTestMsg(*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 CbchTestMsg(*other_value.val_ptr->value_elements[i]);
}
}
return ret_val;
}

CbchTestMsgs CbchTestMsgs::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_SMSCB.CbchTestMsgs.");
check_substr_arguments(val_ptr->n_elements, index, returncount, "@BTS_Tests_SMSCB.CbchTestMsgs","element");
CbchTestMsgs 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 CbchTestMsg(*val_ptr->value_elements[i+index]);
}
}
return ret_val;
}

CbchTestMsgs CbchTestMsgs::replace(int index, int len, const CbchTestMsgs& repl) const
{
if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @BTS_Tests_SMSCB.CbchTestMsgs.");
if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @BTS_Tests_SMSCB.CbchTestMsgs.");
check_replace_arguments(val_ptr->n_elements, index, len, "@BTS_Tests_SMSCB.CbchTestMsgs","element");
CbchTestMsgs 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 CbchTestMsg(*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 CbchTestMsg(*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 CbchTestMsg(*val_ptr->value_elements[index+i+len]);
}
}
return ret_val;
}

CbchTestMsgs CbchTestMsgs::replace(int index, int len, const CbchTestMsgs_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 CbchTestMsgs::set_size(int new_size)
{
if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @BTS_Tests_SMSCB.CbchTestMsgs.");
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 = (CbchTestMsg**)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 CbchTestMsg(*(val_ptr->value_elements[elem_count]));
}
}
clean_up();
val_ptr = new_val_ptr;
}
if (new_size > val_ptr->n_elements) {
val_ptr->value_elements = (CbchTestMsg**)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_SMSCB.CbchTestMsgs: %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 = (CbchTestMsg**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size);
val_ptr->n_elements = new_size;
}
}

boolean CbchTestMsgs::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 CbchTestMsgs::size_of() const
{
if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @BTS_Tests_SMSCB.CbchTestMsgs.");
return val_ptr->n_elements;
}

int CbchTestMsgs::lengthof() const
{
if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @BTS_Tests_SMSCB.CbchTestMsgs.");
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 CbchTestMsgs::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 CbchTestMsgs::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 CbchTestMsgs::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_SMSCB.CbchTestMsgs");
    }
    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_SMSCB.CbchTestMsgs");
    }
    break;
  default:
    TTCN_error("Internal error: Unknown operation type.");
  }
}

void CbchTestMsgs::encode_text(Text_Buf& text_buf) const
{
if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @BTS_Tests_SMSCB.CbchTestMsgs.");
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 CbchTestMsgs::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_SMSCB.CbchTestMsgs.");
val_ptr->value_elements = (CbchTestMsg**)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 CbchTestMsg;
val_ptr->value_elements[elem_count]->decode_text(text_buf);
}
}

void CbchTestMsgs_template::copy_value(const CbchTestMsgs& other_value)
{
if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @BTS_Tests_SMSCB.CbchTestMsgs with an unbound value.");
single_value.n_elements = other_value.size_of();
single_value.value_elements = (CbchTestMsg_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 CbchTestMsg_template(other_value[elem_count]);
} else {
single_value.value_elements[elem_count] = new CbchTestMsg_template;
}
}
set_selection(SPECIFIC_VALUE);
}

void CbchTestMsgs_template::copy_template(const CbchTestMsgs_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 = (CbchTestMsg_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 CbchTestMsg_template(*other_value.single_value.value_elements[elem_count]);
} else {
single_value.value_elements[elem_count] = new CbchTestMsg_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 CbchTestMsgs_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 CbchTestMsgs_template(*other_value.implication_.precondition);
implication_.implied_template = new CbchTestMsgs_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_SMSCB.CbchTestMsgs.");
break;
}
set_selection(other_value);
}

boolean CbchTestMsgs_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 CbchTestMsgs_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const CbchTestMsgs*)value_ptr)[value_index], legacy);
else return ((const CbchTestMsgs_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit();
}

CbchTestMsgs_template::CbchTestMsgs_template()
{
}

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

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

CbchTestMsgs_template::CbchTestMsgs_template(const CbchTestMsgs& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

void CbchTestMsgs_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;
}

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

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

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

CbchTestMsgs_template& CbchTestMsgs_template::operator=(const OPTIONAL<CbchTestMsgs>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const CbchTestMsgs&)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_SMSCB.CbchTestMsgs.");
}
return *this;
}

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

CbchTestMsg_template& CbchTestMsgs_template::operator[](int index_value)
{
if (index_value < 0) TTCN_error("Accessing an element of a template for type @BTS_Tests_SMSCB.CbchTestMsgs 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_SMSCB.CbchTestMsgs.");
    break;
}
return *single_value.value_elements[index_value];
}

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

const CbchTestMsg_template& CbchTestMsgs_template::operator[](int index_value) const
{
if (index_value < 0) TTCN_error("Accessing an element of a template for type @BTS_Tests_SMSCB.CbchTestMsgs 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_SMSCB.CbchTestMsgs.");
if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @BTS_Tests_SMSCB.CbchTestMsgs: 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 CbchTestMsg_template& CbchTestMsgs_template::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a template of type @BTS_Tests_SMSCB.CbchTestMsgs.");
return (*this)[(int)index_value];
}

void CbchTestMsgs_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_SMSCB.CbchTestMsgs.");
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 = (CbchTestMsg_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 CbchTestMsg_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 CbchTestMsg_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 = (CbchTestMsg_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size);
single_value.n_elements = new_size;
}
}

int CbchTestMsgs_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 CbchTestMsgs_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_SMSCB.CbchTestMsgs 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_SMSCB.CbchTestMsgs 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_SMSCB.CbchTestMsgs 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_SMSCB.CbchTestMsgs 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_SMSCB.CbchTestMsgs 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_SMSCB.CbchTestMsgs containing complemented list.", op_name);
default:
  TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @BTS_Tests_SMSCB.CbchTestMsgs.", op_name);
}
return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @BTS_Tests_SMSCB.CbchTestMsgs");
}

boolean CbchTestMsgs_template::match(const CbchTestMsgs& 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_SMSCB.CbchTestMsgs.");
}
return FALSE;
}

boolean CbchTestMsgs_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;
}

CbchTestMsgs CbchTestMsgs_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_SMSCB.CbchTestMsgs.");
CbchTestMsgs 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;
}

CbchTestMsgs CbchTestMsgs_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);
}

CbchTestMsgs CbchTestMsgs_template::replace(int index, int len, const CbchTestMsgs_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());
}

CbchTestMsgs CbchTestMsgs_template::replace(int index, int len, const CbchTestMsgs& 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 CbchTestMsgs_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 CbchTestMsgs_template[list_length];
break;
default:
TTCN_error("Internal error: Setting an invalid type for a template of type @BTS_Tests_SMSCB.CbchTestMsgs.");
}
set_selection(template_type);
}

CbchTestMsgs_template& CbchTestMsgs_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_SMSCB.CbchTestMsgs.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @BTS_Tests_SMSCB.CbchTestMsgs.");
return value_list.list_value[list_index];
}

void CbchTestMsgs_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 CbchTestMsgs_template::log_match(const CbchTestMsgs& 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 CbchTestMsgs_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_SMSCB.CbchTestMsgs.");
}
}

void CbchTestMsgs_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_SMSCB.CbchTestMsgs.");
single_value.value_elements = (CbchTestMsg_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 CbchTestMsg_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 CbchTestMsgs_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_SMSCB.CbchTestMsgs.");
}
}

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

boolean CbchTestMsgs_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 CbchTestMsgs_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 CbchTestMsgs_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: {
    CbchTestMsgs_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: {
    CbchTestMsgs_template* precondition = new CbchTestMsgs_template;
    precondition->set_param(*param.get_elem(0));
    CbchTestMsgs_template* implied_template = new CbchTestMsgs_template;
    implied_template->set_param(*param.get_elem(1));
    *this = CbchTestMsgs_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record of template", "@BTS_Tests_SMSCB.CbchTestMsgs");
  }
  is_ifpresent = param.get_ifpresent();
  set_length_range(param);
}

void CbchTestMsgs_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_SMSCB.CbchTestMsgs");
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_SMSCB.CbchTestMsgs");
}

boolean CbchTestMsgs_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);
}
}
CbchTestMsg::CbchTestMsg()
{
}

CbchTestMsg::CbchTestMsg(const RSL__Types::RSL__CbCommand& par_rsl__cb__cmd,
    const INTEGER& par_last__block,
    const OCTETSTRING& par_payload,
    const OPTIONAL< CbchBlocks >& par_blocks)
  :   field_rsl__cb__cmd(par_rsl__cb__cmd),
  field_last__block(par_last__block),
  field_payload(par_payload),
  field_blocks(par_blocks)
{
}

CbchTestMsg::CbchTestMsg(const CbchTestMsg& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BTS_Tests_SMSCB.CbchTestMsg.");
if (other_value.rsl__cb__cmd().is_bound()) field_rsl__cb__cmd = other_value.rsl__cb__cmd();
else field_rsl__cb__cmd.clean_up();
if (other_value.last__block().is_bound()) field_last__block = other_value.last__block();
else field_last__block.clean_up();
if (other_value.payload().is_bound()) field_payload = other_value.payload();
else field_payload.clean_up();
if (other_value.blocks().is_bound()) field_blocks = other_value.blocks();
else field_blocks.clean_up();
}

void CbchTestMsg::clean_up()
{
field_rsl__cb__cmd.clean_up();
field_last__block.clean_up();
field_payload.clean_up();
field_blocks.clean_up();
}

const TTCN_Typedescriptor_t* CbchTestMsg::get_descriptor() const { return &CbchTestMsg_descr_; }
CbchTestMsg& CbchTestMsg::operator=(const CbchTestMsg& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BTS_Tests_SMSCB.CbchTestMsg.");
  if (other_value.rsl__cb__cmd().is_bound()) field_rsl__cb__cmd = other_value.rsl__cb__cmd();
  else field_rsl__cb__cmd.clean_up();
  if (other_value.last__block().is_bound()) field_last__block = other_value.last__block();
  else field_last__block.clean_up();
  if (other_value.payload().is_bound()) field_payload = other_value.payload();
  else field_payload.clean_up();
  if (other_value.blocks().is_bound()) field_blocks = other_value.blocks();
  else field_blocks.clean_up();
}
return *this;
}

boolean CbchTestMsg::operator==(const CbchTestMsg& other_value) const
{
return field_rsl__cb__cmd==other_value.field_rsl__cb__cmd
  && field_last__block==other_value.field_last__block
  && field_payload==other_value.field_payload
  && field_blocks==other_value.field_blocks;
}

boolean CbchTestMsg::is_bound() const
{
return (field_rsl__cb__cmd.is_bound())
  || (field_last__block.is_bound())
  || (field_payload.is_bound())
  || (OPTIONAL_OMIT == field_blocks.get_selection() || field_blocks.is_bound());
}
boolean CbchTestMsg::is_value() const
{
return field_rsl__cb__cmd.is_value()
  && field_last__block.is_value()
  && field_payload.is_value()
  && (OPTIONAL_OMIT == field_blocks.get_selection() || field_blocks.is_value());
}
int CbchTestMsg::size_of() const
{
  int ret_val = 3;
  if (field_blocks.ispresent()) ret_val++;
  return ret_val;
}

void CbchTestMsg::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ rsl_cb_cmd := ");
field_rsl__cb__cmd.log();
TTCN_Logger::log_event_str(", last_block := ");
field_last__block.log();
TTCN_Logger::log_event_str(", payload := ");
field_payload.log();
TTCN_Logger::log_event_str(", blocks := ");
field_blocks.log();
TTCN_Logger::log_event_str(" }");
}

void CbchTestMsg::set_implicit_omit()
{
if (rsl__cb__cmd().is_bound()) rsl__cb__cmd().set_implicit_omit();
if (last__block().is_bound()) last__block().set_implicit_omit();
if (payload().is_bound()) payload().set_implicit_omit();
if (!blocks().is_bound()) blocks() = OMIT_VALUE;
else blocks().set_implicit_omit();
}

void CbchTestMsg::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_SMSCB.CbchTestMsg 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) rsl__cb__cmd().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) last__block().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) payload().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) blocks().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(), "rsl_cb_cmd")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rsl__cb__cmd().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(), "last_block")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          last__block().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(), "payload")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          payload().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(), "blocks")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          blocks().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_SMSCB.CbchTestMsg: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BTS_Tests_SMSCB.CbchTestMsg");
  }
}

void CbchTestMsg::encode_text(Text_Buf& text_buf) const
{
field_rsl__cb__cmd.encode_text(text_buf);
field_last__block.encode_text(text_buf);
field_payload.encode_text(text_buf);
field_blocks.encode_text(text_buf);
}

void CbchTestMsg::decode_text(Text_Buf& text_buf)
{
field_rsl__cb__cmd.decode_text(text_buf);
field_last__block.decode_text(text_buf);
field_payload.decode_text(text_buf);
field_blocks.decode_text(text_buf);
}

struct CbchTestMsg_template::single_value_struct {
RSL__Types::RSL__CbCommand_template field_rsl__cb__cmd;
INTEGER_template field_last__block;
OCTETSTRING_template field_payload;
CbchBlocks_template field_blocks;
};

void CbchTestMsg_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_rsl__cb__cmd = ANY_VALUE;
single_value->field_last__block = ANY_VALUE;
single_value->field_payload = ANY_VALUE;
single_value->field_blocks = ANY_OR_OMIT;
}
}
}

void CbchTestMsg_template::copy_value(const CbchTestMsg& other_value)
{
single_value = new single_value_struct;
if (other_value.rsl__cb__cmd().is_bound()) {
  single_value->field_rsl__cb__cmd = other_value.rsl__cb__cmd();
} else {
  single_value->field_rsl__cb__cmd.clean_up();
}
if (other_value.last__block().is_bound()) {
  single_value->field_last__block = other_value.last__block();
} else {
  single_value->field_last__block.clean_up();
}
if (other_value.payload().is_bound()) {
  single_value->field_payload = other_value.payload();
} else {
  single_value->field_payload.clean_up();
}
if (other_value.blocks().is_bound()) {
  if (other_value.blocks().ispresent()) single_value->field_blocks = other_value.blocks()();
  else single_value->field_blocks = OMIT_VALUE;
} else {
  single_value->field_blocks.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void CbchTestMsg_template::copy_template(const CbchTestMsg_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.rsl__cb__cmd().get_selection()) {
single_value->field_rsl__cb__cmd = other_value.rsl__cb__cmd();
} else {
single_value->field_rsl__cb__cmd.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.last__block().get_selection()) {
single_value->field_last__block = other_value.last__block();
} else {
single_value->field_last__block.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.payload().get_selection()) {
single_value->field_payload = other_value.payload();
} else {
single_value->field_payload.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.blocks().get_selection()) {
single_value->field_blocks = other_value.blocks();
} else {
single_value->field_blocks.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 CbchTestMsg_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 CbchTestMsg_template(*other_value.implication_.precondition);
implication_.implied_template = new CbchTestMsg_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_SMSCB.CbchTestMsg.");
break;
}
set_selection(other_value);
}

CbchTestMsg_template::CbchTestMsg_template()
{
}

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

CbchTestMsg_template::CbchTestMsg_template(const CbchTestMsg& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

CbchTestMsg_template& CbchTestMsg_template::operator=(const OPTIONAL<CbchTestMsg>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const CbchTestMsg&)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_SMSCB.CbchTestMsg.");
}
return *this;
}

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

boolean CbchTestMsg_template::match(const CbchTestMsg& 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.rsl__cb__cmd().is_bound()) return FALSE;
if(!single_value->field_rsl__cb__cmd.match(other_value.rsl__cb__cmd(), legacy))return FALSE;
if(!other_value.last__block().is_bound()) return FALSE;
if(!single_value->field_last__block.match(other_value.last__block(), legacy))return FALSE;
if(!other_value.payload().is_bound()) return FALSE;
if(!single_value->field_payload.match(other_value.payload(), legacy))return FALSE;
if(!other_value.blocks().is_bound()) return FALSE;
if((other_value.blocks().ispresent() ? !single_value->field_blocks.match((const CbchBlocks&)other_value.blocks(), legacy) : !single_value->field_blocks.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_SMSCB.CbchTestMsg.");
}
return FALSE;
}

boolean CbchTestMsg_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_rsl__cb__cmd.is_bound()
 || single_value->field_last__block.is_bound()
 || single_value->field_payload.is_bound()
 || (single_value->field_blocks.is_omit() || single_value->field_blocks.is_bound());
}

boolean CbchTestMsg_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_rsl__cb__cmd.is_value()
 && single_value->field_last__block.is_value()
 && single_value->field_payload.is_value()
 && (single_value->field_blocks.is_omit() || single_value->field_blocks.is_value());
}

void CbchTestMsg_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;
}

CbchTestMsg CbchTestMsg_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_SMSCB.CbchTestMsg.");
CbchTestMsg ret_val;
if (single_value->field_rsl__cb__cmd.is_bound()) {
ret_val.rsl__cb__cmd() = single_value->field_rsl__cb__cmd.valueof();
}
if (single_value->field_last__block.is_bound()) {
ret_val.last__block() = single_value->field_last__block.valueof();
}
if (single_value->field_payload.is_bound()) {
ret_val.payload() = single_value->field_payload.valueof();
}
if (single_value->field_blocks.is_omit()) ret_val.blocks() = OMIT_VALUE;
else if (single_value->field_blocks.is_bound()) {
ret_val.blocks() = single_value->field_blocks.valueof();
}
return ret_val;
}

void CbchTestMsg_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_SMSCB.CbchTestMsg.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new CbchTestMsg_template[list_length];
}

CbchTestMsg_template& CbchTestMsg_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_SMSCB.CbchTestMsg.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BTS_Tests_SMSCB.CbchTestMsg.");
return value_list.list_value[list_index];
}

RSL__Types::RSL__CbCommand_template& CbchTestMsg_template::rsl__cb__cmd()
{
set_specific();
return single_value->field_rsl__cb__cmd;
}

const RSL__Types::RSL__CbCommand_template& CbchTestMsg_template::rsl__cb__cmd() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field rsl_cb_cmd of a non-specific template of type @BTS_Tests_SMSCB.CbchTestMsg.");
return single_value->field_rsl__cb__cmd;
}

INTEGER_template& CbchTestMsg_template::last__block()
{
set_specific();
return single_value->field_last__block;
}

const INTEGER_template& CbchTestMsg_template::last__block() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field last_block of a non-specific template of type @BTS_Tests_SMSCB.CbchTestMsg.");
return single_value->field_last__block;
}

OCTETSTRING_template& CbchTestMsg_template::payload()
{
set_specific();
return single_value->field_payload;
}

const OCTETSTRING_template& CbchTestMsg_template::payload() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field payload of a non-specific template of type @BTS_Tests_SMSCB.CbchTestMsg.");
return single_value->field_payload;
}

CbchBlocks_template& CbchTestMsg_template::blocks()
{
set_specific();
return single_value->field_blocks;
}

const CbchBlocks_template& CbchTestMsg_template::blocks() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field blocks of a non-specific template of type @BTS_Tests_SMSCB.CbchTestMsg.");
return single_value->field_blocks;
}

int CbchTestMsg_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests_SMSCB.CbchTestMsg which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 3;
      if (single_value->field_blocks.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_SMSCB.CbchTestMsg 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_SMSCB.CbchTestMsg 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_SMSCB.CbchTestMsg containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests_SMSCB.CbchTestMsg containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests_SMSCB.CbchTestMsg containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests_SMSCB.CbchTestMsg containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests_SMSCB.CbchTestMsg containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests_SMSCB.CbchTestMsg containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BTS_Tests_SMSCB.CbchTestMsg.");
  }
  return 0;
}

void CbchTestMsg_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ rsl_cb_cmd := ");
single_value->field_rsl__cb__cmd.log();
TTCN_Logger::log_event_str(", last_block := ");
single_value->field_last__block.log();
TTCN_Logger::log_event_str(", payload := ");
single_value->field_payload.log();
TTCN_Logger::log_event_str(", blocks := ");
single_value->field_blocks.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 CbchTestMsg_template::log_match(const CbchTestMsg& 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_rsl__cb__cmd.match(match_value.rsl__cb__cmd(), legacy)){
TTCN_Logger::log_logmatch_info(".rsl_cb_cmd");
single_value->field_rsl__cb__cmd.log_match(match_value.rsl__cb__cmd(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_last__block.match(match_value.last__block(), legacy)){
TTCN_Logger::log_logmatch_info(".last_block");
single_value->field_last__block.log_match(match_value.last__block(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_payload.match(match_value.payload(), legacy)){
TTCN_Logger::log_logmatch_info(".payload");
single_value->field_payload.log_match(match_value.payload(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.blocks().ispresent()){
if(!single_value->field_blocks.match(match_value.blocks(), legacy)){
TTCN_Logger::log_logmatch_info(".blocks");
single_value->field_blocks.log_match(match_value.blocks(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_blocks.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".blocks := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_blocks.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("{ rsl_cb_cmd := ");
single_value->field_rsl__cb__cmd.log_match(match_value.rsl__cb__cmd(), legacy);
TTCN_Logger::log_event_str(", last_block := ");
single_value->field_last__block.log_match(match_value.last__block(), legacy);
TTCN_Logger::log_event_str(", payload := ");
single_value->field_payload.log_match(match_value.payload(), legacy);
TTCN_Logger::log_event_str(", blocks := ");
if (match_value.blocks().ispresent()) {
single_value->field_blocks.log_match(match_value.blocks(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_blocks.log();
if (single_value->field_blocks.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 CbchTestMsg_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (rsl__cb__cmd().is_bound()) rsl__cb__cmd().set_implicit_omit();
if (last__block().is_bound()) last__block().set_implicit_omit();
if (payload().is_bound()) payload().set_implicit_omit();
if (!blocks().is_bound()) blocks() = OMIT_VALUE;
else blocks().set_implicit_omit();
}

void CbchTestMsg_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_rsl__cb__cmd.encode_text(text_buf);
single_value->field_last__block.encode_text(text_buf);
single_value->field_payload.encode_text(text_buf);
single_value->field_blocks.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_SMSCB.CbchTestMsg.");
}
}

void CbchTestMsg_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_rsl__cb__cmd.decode_text(text_buf);
single_value->field_last__block.decode_text(text_buf);
single_value->field_payload.decode_text(text_buf);
single_value->field_blocks.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 CbchTestMsg_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_SMSCB.CbchTestMsg.");
}
}

void CbchTestMsg_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: {
    CbchTestMsg_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_SMSCB.CbchTestMsg 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) rsl__cb__cmd().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) last__block().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) payload().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) blocks().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(), "rsl_cb_cmd")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          rsl__cb__cmd().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(), "last_block")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          last__block().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(), "payload")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          payload().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(), "blocks")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          blocks().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_SMSCB.CbchTestMsg: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    CbchTestMsg_template* precondition = new CbchTestMsg_template;
    precondition->set_param(*param.get_elem(0));
    CbchTestMsg_template* implied_template = new CbchTestMsg_template;
    implied_template->set_param(*param.get_elem(1));
    *this = CbchTestMsg_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BTS_Tests_SMSCB.CbchTestMsg");
  }
  is_ifpresent = param.get_ifpresent();
}

void CbchTestMsg_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_rsl__cb__cmd.check_restriction(t_res, t_name ? t_name : "@BTS_Tests_SMSCB.CbchTestMsg");
single_value->field_last__block.check_restriction(t_res, t_name ? t_name : "@BTS_Tests_SMSCB.CbchTestMsg");
single_value->field_payload.check_restriction(t_res, t_name ? t_name : "@BTS_Tests_SMSCB.CbchTestMsg");
single_value->field_blocks.check_restriction(t_res, t_name ? t_name : "@BTS_Tests_SMSCB.CbchTestMsg");
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_SMSCB.CbchTestMsg");
}

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

boolean CbchTestMsg_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 CbchBlock CbchBlocks::UNBOUND_ELEM;
CbchBlocks::CbchBlocks()
{
val_ptr = NULL;
}

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

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

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

void CbchBlocks::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.");
}
}

CbchBlocks& CbchBlocks::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;
}

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

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

boolean CbchBlocks::operator==(const CbchBlocks& other_value) const
{
if (val_ptr == NULL) TTCN_error("The left operand of comparison is an unbound value of type @BTS_Tests_SMSCB.CbchBlocks.");
if (other_value.val_ptr == NULL) TTCN_error("The right operand of comparison is an unbound value of type @BTS_Tests_SMSCB.CbchBlocks.");
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;
}

CbchBlock& CbchBlocks::operator[](int index_value)
{
if (index_value < 0) TTCN_error("Accessing an element of type @BTS_Tests_SMSCB.CbchBlocks 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 = (CbchBlock**)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 CbchBlock(*(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 CbchBlock;
}
return *val_ptr->value_elements[index_value];
}

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

const CbchBlock& CbchBlocks::operator[](int index_value) const
{
if (val_ptr == NULL)
TTCN_error("Accessing an element in an unbound value of type @BTS_Tests_SMSCB.CbchBlocks.");
if (index_value < 0) TTCN_error("Accessing an element of type @BTS_Tests_SMSCB.CbchBlocks 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_SMSCB.CbchBlocks: 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 CbchBlock& CbchBlocks::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a value of type @BTS_Tests_SMSCB.CbchBlocks.");
return (*this)[(int)index_value];
}

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

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

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

CbchBlocks CbchBlocks::operator>>=(int rotate_count) const
{
if (val_ptr == NULL) TTCN_error("Performing rotation operation on an unbound value of type @BTS_Tests_SMSCB.CbchBlocks.");
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;
CbchBlocks 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 CbchBlock(*val_ptr->value_elements[i]);
}
}
return ret_val;
}

CbchBlocks CbchBlocks::operator+(const CbchBlocks& other_value) const
{
if (val_ptr == NULL || other_value.val_ptr == NULL) TTCN_error("Unbound operand of @BTS_Tests_SMSCB.CbchBlocks concatenation.");
if (val_ptr->n_elements == 0) return other_value;
if (other_value.val_ptr->n_elements == 0) return *this;
CbchBlocks 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 CbchBlock(*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 CbchBlock(*other_value.val_ptr->value_elements[i]);
}
}
return ret_val;
}

CbchBlocks CbchBlocks::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_SMSCB.CbchBlocks.");
check_substr_arguments(val_ptr->n_elements, index, returncount, "@BTS_Tests_SMSCB.CbchBlocks","element");
CbchBlocks 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 CbchBlock(*val_ptr->value_elements[i+index]);
}
}
return ret_val;
}

CbchBlocks CbchBlocks::replace(int index, int len, const CbchBlocks& repl) const
{
if (val_ptr == NULL) TTCN_error("The first argument of replace() is an unbound value of type @BTS_Tests_SMSCB.CbchBlocks.");
if (repl.val_ptr == NULL) TTCN_error("The fourth argument of replace() is an unbound value of type @BTS_Tests_SMSCB.CbchBlocks.");
check_replace_arguments(val_ptr->n_elements, index, len, "@BTS_Tests_SMSCB.CbchBlocks","element");
CbchBlocks 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 CbchBlock(*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 CbchBlock(*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 CbchBlock(*val_ptr->value_elements[index+i+len]);
}
}
return ret_val;
}

CbchBlocks CbchBlocks::replace(int index, int len, const CbchBlocks_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 CbchBlocks::set_size(int new_size)
{
if (new_size < 0) TTCN_error("Internal error: Setting a negative size for a value of type @BTS_Tests_SMSCB.CbchBlocks.");
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 = (CbchBlock**)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 CbchBlock(*(val_ptr->value_elements[elem_count]));
}
}
clean_up();
val_ptr = new_val_ptr;
}
if (new_size > val_ptr->n_elements) {
val_ptr->value_elements = (CbchBlock**)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_SMSCB.CbchBlocks: %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 = (CbchBlock**)reallocate_pointers((void**)val_ptr->value_elements, val_ptr->n_elements, new_size);
val_ptr->n_elements = new_size;
}
}

boolean CbchBlocks::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 CbchBlocks::size_of() const
{
if (val_ptr == NULL) TTCN_error("Performing sizeof operation on an unbound value of type @BTS_Tests_SMSCB.CbchBlocks.");
return val_ptr->n_elements;
}

int CbchBlocks::lengthof() const
{
if (val_ptr == NULL) TTCN_error("Performing lengthof operation on an unbound value of type @BTS_Tests_SMSCB.CbchBlocks.");
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 CbchBlocks::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 CbchBlocks::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 CbchBlocks::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_SMSCB.CbchBlocks");
    }
    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_SMSCB.CbchBlocks");
    }
    break;
  default:
    TTCN_error("Internal error: Unknown operation type.");
  }
}

void CbchBlocks::encode_text(Text_Buf& text_buf) const
{
if (val_ptr == NULL) TTCN_error("Text encoder: Encoding an unbound value of type @BTS_Tests_SMSCB.CbchBlocks.");
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 CbchBlocks::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_SMSCB.CbchBlocks.");
val_ptr->value_elements = (CbchBlock**)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 CbchBlock;
val_ptr->value_elements[elem_count]->decode_text(text_buf);
}
}

void CbchBlocks_template::copy_value(const CbchBlocks& other_value)
{
if (!other_value.is_bound()) TTCN_error("Initialization of a template of type @BTS_Tests_SMSCB.CbchBlocks with an unbound value.");
single_value.n_elements = other_value.size_of();
single_value.value_elements = (CbchBlock_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 CbchBlock_template(other_value[elem_count]);
} else {
single_value.value_elements[elem_count] = new CbchBlock_template;
}
}
set_selection(SPECIFIC_VALUE);
}

void CbchBlocks_template::copy_template(const CbchBlocks_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 = (CbchBlock_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 CbchBlock_template(*other_value.single_value.value_elements[elem_count]);
} else {
single_value.value_elements[elem_count] = new CbchBlock_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 CbchBlocks_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 CbchBlocks_template(*other_value.implication_.precondition);
implication_.implied_template = new CbchBlocks_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_SMSCB.CbchBlocks.");
break;
}
set_selection(other_value);
}

boolean CbchBlocks_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 CbchBlocks_template*)template_ptr)->single_value.value_elements[template_index]->match((*(const CbchBlocks*)value_ptr)[value_index], legacy);
else return ((const CbchBlocks_template*)template_ptr)->single_value.value_elements[template_index]->is_any_or_omit();
}

CbchBlocks_template::CbchBlocks_template()
{
}

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

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

CbchBlocks_template::CbchBlocks_template(const CbchBlocks& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

void CbchBlocks_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;
}

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

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

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

CbchBlocks_template& CbchBlocks_template::operator=(const OPTIONAL<CbchBlocks>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const CbchBlocks&)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_SMSCB.CbchBlocks.");
}
return *this;
}

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

CbchBlock_template& CbchBlocks_template::operator[](int index_value)
{
if (index_value < 0) TTCN_error("Accessing an element of a template for type @BTS_Tests_SMSCB.CbchBlocks 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_SMSCB.CbchBlocks.");
    break;
}
return *single_value.value_elements[index_value];
}

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

const CbchBlock_template& CbchBlocks_template::operator[](int index_value) const
{
if (index_value < 0) TTCN_error("Accessing an element of a template for type @BTS_Tests_SMSCB.CbchBlocks 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_SMSCB.CbchBlocks.");
if (index_value >= single_value.n_elements) TTCN_error("Index overflow in a template of type @BTS_Tests_SMSCB.CbchBlocks: 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 CbchBlock_template& CbchBlocks_template::operator[](const INTEGER& index_value) const
{
index_value.must_bound("Using an unbound integer value for indexing a template of type @BTS_Tests_SMSCB.CbchBlocks.");
return (*this)[(int)index_value];
}

void CbchBlocks_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_SMSCB.CbchBlocks.");
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 = (CbchBlock_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 CbchBlock_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 CbchBlock_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 = (CbchBlock_template**)reallocate_pointers((void**)single_value.value_elements, single_value.n_elements, new_size);
single_value.n_elements = new_size;
}
}

int CbchBlocks_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 CbchBlocks_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_SMSCB.CbchBlocks 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_SMSCB.CbchBlocks 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_SMSCB.CbchBlocks 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_SMSCB.CbchBlocks 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_SMSCB.CbchBlocks 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_SMSCB.CbchBlocks containing complemented list.", op_name);
default:
  TTCN_error("Performing %sof() operation on an uninitialized/unsupported template of type @BTS_Tests_SMSCB.CbchBlocks.", op_name);
}
return check_section_is_single(min_size, has_any_or_none, op_name, "a", "template of type @BTS_Tests_SMSCB.CbchBlocks");
}

boolean CbchBlocks_template::match(const CbchBlocks& 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_SMSCB.CbchBlocks.");
}
return FALSE;
}

boolean CbchBlocks_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;
}

CbchBlocks CbchBlocks_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_SMSCB.CbchBlocks.");
CbchBlocks 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;
}

CbchBlocks CbchBlocks_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);
}

CbchBlocks CbchBlocks_template::replace(int index, int len, const CbchBlocks_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());
}

CbchBlocks CbchBlocks_template::replace(int index, int len, const CbchBlocks& 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 CbchBlocks_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 CbchBlocks_template[list_length];
break;
default:
TTCN_error("Internal error: Setting an invalid type for a template of type @BTS_Tests_SMSCB.CbchBlocks.");
}
set_selection(template_type);
}

CbchBlocks_template& CbchBlocks_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_SMSCB.CbchBlocks.");
if (list_index >= value_list.n_values) TTCN_error("Internal error: Index overflow in a value list template of type @BTS_Tests_SMSCB.CbchBlocks.");
return value_list.list_value[list_index];
}

void CbchBlocks_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 CbchBlocks_template::log_match(const CbchBlocks& 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 CbchBlocks_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_SMSCB.CbchBlocks.");
}
}

void CbchBlocks_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_SMSCB.CbchBlocks.");
single_value.value_elements = (CbchBlock_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 CbchBlock_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 CbchBlocks_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_SMSCB.CbchBlocks.");
}
}

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

boolean CbchBlocks_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 CbchBlocks_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 CbchBlocks_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: {
    CbchBlocks_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: {
    CbchBlocks_template* precondition = new CbchBlocks_template;
    precondition->set_param(*param.get_elem(0));
    CbchBlocks_template* implied_template = new CbchBlocks_template;
    implied_template->set_param(*param.get_elem(1));
    *this = CbchBlocks_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record of template", "@BTS_Tests_SMSCB.CbchBlocks");
  }
  is_ifpresent = param.get_ifpresent();
  set_length_range(param);
}

void CbchBlocks_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_SMSCB.CbchBlocks");
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_SMSCB.CbchBlocks");
}

boolean CbchBlocks_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);
}
}
CbchBlock::CbchBlock()
{
}

CbchBlock::CbchBlock(const INTEGER& par_seq__nr,
    const BOOLEAN& par_is__last,
    const OCTETSTRING& par_payload,
    const BOOLEAN& par_seen__once)
  :   field_seq__nr(par_seq__nr),
  field_is__last(par_is__last),
  field_payload(par_payload),
  field_seen__once(par_seen__once)
{
}

CbchBlock::CbchBlock(const CbchBlock& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BTS_Tests_SMSCB.CbchBlock.");
if (other_value.seq__nr().is_bound()) field_seq__nr = other_value.seq__nr();
else field_seq__nr.clean_up();
if (other_value.is__last().is_bound()) field_is__last = other_value.is__last();
else field_is__last.clean_up();
if (other_value.payload().is_bound()) field_payload = other_value.payload();
else field_payload.clean_up();
if (other_value.seen__once().is_bound()) field_seen__once = other_value.seen__once();
else field_seen__once.clean_up();
}

void CbchBlock::clean_up()
{
field_seq__nr.clean_up();
field_is__last.clean_up();
field_payload.clean_up();
field_seen__once.clean_up();
}

const TTCN_Typedescriptor_t* CbchBlock::get_descriptor() const { return &CbchBlock_descr_; }
CbchBlock& CbchBlock::operator=(const CbchBlock& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BTS_Tests_SMSCB.CbchBlock.");
  if (other_value.seq__nr().is_bound()) field_seq__nr = other_value.seq__nr();
  else field_seq__nr.clean_up();
  if (other_value.is__last().is_bound()) field_is__last = other_value.is__last();
  else field_is__last.clean_up();
  if (other_value.payload().is_bound()) field_payload = other_value.payload();
  else field_payload.clean_up();
  if (other_value.seen__once().is_bound()) field_seen__once = other_value.seen__once();
  else field_seen__once.clean_up();
}
return *this;
}

boolean CbchBlock::operator==(const CbchBlock& other_value) const
{
return field_seq__nr==other_value.field_seq__nr
  && field_is__last==other_value.field_is__last
  && field_payload==other_value.field_payload
  && field_seen__once==other_value.field_seen__once;
}

boolean CbchBlock::is_bound() const
{
return (field_seq__nr.is_bound())
  || (field_is__last.is_bound())
  || (field_payload.is_bound())
  || (field_seen__once.is_bound());
}
boolean CbchBlock::is_value() const
{
return field_seq__nr.is_value()
  && field_is__last.is_value()
  && field_payload.is_value()
  && field_seen__once.is_value();
}
void CbchBlock::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ seq_nr := ");
field_seq__nr.log();
TTCN_Logger::log_event_str(", is_last := ");
field_is__last.log();
TTCN_Logger::log_event_str(", payload := ");
field_payload.log();
TTCN_Logger::log_event_str(", seen_once := ");
field_seen__once.log();
TTCN_Logger::log_event_str(" }");
}

void CbchBlock::set_implicit_omit()
{
if (seq__nr().is_bound()) seq__nr().set_implicit_omit();
if (is__last().is_bound()) is__last().set_implicit_omit();
if (payload().is_bound()) payload().set_implicit_omit();
if (seen__once().is_bound()) seen__once().set_implicit_omit();
}

void CbchBlock::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_SMSCB.CbchBlock 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) seq__nr().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) is__last().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) payload().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) seen__once().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(), "seq_nr")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          seq__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(), "is_last")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          is__last().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(), "payload")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          payload().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(), "seen_once")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          seen__once().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_SMSCB.CbchBlock: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BTS_Tests_SMSCB.CbchBlock");
  }
}

void CbchBlock::encode_text(Text_Buf& text_buf) const
{
field_seq__nr.encode_text(text_buf);
field_is__last.encode_text(text_buf);
field_payload.encode_text(text_buf);
field_seen__once.encode_text(text_buf);
}

void CbchBlock::decode_text(Text_Buf& text_buf)
{
field_seq__nr.decode_text(text_buf);
field_is__last.decode_text(text_buf);
field_payload.decode_text(text_buf);
field_seen__once.decode_text(text_buf);
}

struct CbchBlock_template::single_value_struct {
INTEGER_template field_seq__nr;
BOOLEAN_template field_is__last;
OCTETSTRING_template field_payload;
BOOLEAN_template field_seen__once;
};

void CbchBlock_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_seq__nr = ANY_VALUE;
single_value->field_is__last = ANY_VALUE;
single_value->field_payload = ANY_VALUE;
single_value->field_seen__once = ANY_VALUE;
}
}
}

void CbchBlock_template::copy_value(const CbchBlock& other_value)
{
single_value = new single_value_struct;
if (other_value.seq__nr().is_bound()) {
  single_value->field_seq__nr = other_value.seq__nr();
} else {
  single_value->field_seq__nr.clean_up();
}
if (other_value.is__last().is_bound()) {
  single_value->field_is__last = other_value.is__last();
} else {
  single_value->field_is__last.clean_up();
}
if (other_value.payload().is_bound()) {
  single_value->field_payload = other_value.payload();
} else {
  single_value->field_payload.clean_up();
}
if (other_value.seen__once().is_bound()) {
  single_value->field_seen__once = other_value.seen__once();
} else {
  single_value->field_seen__once.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void CbchBlock_template::copy_template(const CbchBlock_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.seq__nr().get_selection()) {
single_value->field_seq__nr = other_value.seq__nr();
} else {
single_value->field_seq__nr.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.is__last().get_selection()) {
single_value->field_is__last = other_value.is__last();
} else {
single_value->field_is__last.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.payload().get_selection()) {
single_value->field_payload = other_value.payload();
} else {
single_value->field_payload.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.seen__once().get_selection()) {
single_value->field_seen__once = other_value.seen__once();
} else {
single_value->field_seen__once.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 CbchBlock_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 CbchBlock_template(*other_value.implication_.precondition);
implication_.implied_template = new CbchBlock_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_SMSCB.CbchBlock.");
break;
}
set_selection(other_value);
}

CbchBlock_template::CbchBlock_template()
{
}

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

CbchBlock_template::CbchBlock_template(const CbchBlock& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

CbchBlock_template& CbchBlock_template::operator=(const OPTIONAL<CbchBlock>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const CbchBlock&)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_SMSCB.CbchBlock.");
}
return *this;
}

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

boolean CbchBlock_template::match(const CbchBlock& 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.seq__nr().is_bound()) return FALSE;
if(!single_value->field_seq__nr.match(other_value.seq__nr(), legacy))return FALSE;
if(!other_value.is__last().is_bound()) return FALSE;
if(!single_value->field_is__last.match(other_value.is__last(), legacy))return FALSE;
if(!other_value.payload().is_bound()) return FALSE;
if(!single_value->field_payload.match(other_value.payload(), legacy))return FALSE;
if(!other_value.seen__once().is_bound()) return FALSE;
if(!single_value->field_seen__once.match(other_value.seen__once(), 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_SMSCB.CbchBlock.");
}
return FALSE;
}

boolean CbchBlock_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_seq__nr.is_bound()
 || single_value->field_is__last.is_bound()
 || single_value->field_payload.is_bound()
 || single_value->field_seen__once.is_bound();
}

boolean CbchBlock_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_seq__nr.is_value()
 && single_value->field_is__last.is_value()
 && single_value->field_payload.is_value()
 && single_value->field_seen__once.is_value();
}

void CbchBlock_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;
}

CbchBlock CbchBlock_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_SMSCB.CbchBlock.");
CbchBlock ret_val;
if (single_value->field_seq__nr.is_bound()) {
ret_val.seq__nr() = single_value->field_seq__nr.valueof();
}
if (single_value->field_is__last.is_bound()) {
ret_val.is__last() = single_value->field_is__last.valueof();
}
if (single_value->field_payload.is_bound()) {
ret_val.payload() = single_value->field_payload.valueof();
}
if (single_value->field_seen__once.is_bound()) {
ret_val.seen__once() = single_value->field_seen__once.valueof();
}
return ret_val;
}

void CbchBlock_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_SMSCB.CbchBlock.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new CbchBlock_template[list_length];
}

CbchBlock_template& CbchBlock_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_SMSCB.CbchBlock.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BTS_Tests_SMSCB.CbchBlock.");
return value_list.list_value[list_index];
}

INTEGER_template& CbchBlock_template::seq__nr()
{
set_specific();
return single_value->field_seq__nr;
}

const INTEGER_template& CbchBlock_template::seq__nr() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field seq_nr of a non-specific template of type @BTS_Tests_SMSCB.CbchBlock.");
return single_value->field_seq__nr;
}

BOOLEAN_template& CbchBlock_template::is__last()
{
set_specific();
return single_value->field_is__last;
}

const BOOLEAN_template& CbchBlock_template::is__last() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field is_last of a non-specific template of type @BTS_Tests_SMSCB.CbchBlock.");
return single_value->field_is__last;
}

OCTETSTRING_template& CbchBlock_template::payload()
{
set_specific();
return single_value->field_payload;
}

const OCTETSTRING_template& CbchBlock_template::payload() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field payload of a non-specific template of type @BTS_Tests_SMSCB.CbchBlock.");
return single_value->field_payload;
}

BOOLEAN_template& CbchBlock_template::seen__once()
{
set_specific();
return single_value->field_seen__once;
}

const BOOLEAN_template& CbchBlock_template::seen__once() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field seen_once of a non-specific template of type @BTS_Tests_SMSCB.CbchBlock.");
return single_value->field_seen__once;
}

int CbchBlock_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests_SMSCB.CbchBlock 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_SMSCB.CbchBlock 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_SMSCB.CbchBlock 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_SMSCB.CbchBlock containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests_SMSCB.CbchBlock containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests_SMSCB.CbchBlock containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests_SMSCB.CbchBlock containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests_SMSCB.CbchBlock containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests_SMSCB.CbchBlock containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BTS_Tests_SMSCB.CbchBlock.");
  }
  return 0;
}

void CbchBlock_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ seq_nr := ");
single_value->field_seq__nr.log();
TTCN_Logger::log_event_str(", is_last := ");
single_value->field_is__last.log();
TTCN_Logger::log_event_str(", payload := ");
single_value->field_payload.log();
TTCN_Logger::log_event_str(", seen_once := ");
single_value->field_seen__once.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 CbchBlock_template::log_match(const CbchBlock& 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_seq__nr.match(match_value.seq__nr(), legacy)){
TTCN_Logger::log_logmatch_info(".seq_nr");
single_value->field_seq__nr.log_match(match_value.seq__nr(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_is__last.match(match_value.is__last(), legacy)){
TTCN_Logger::log_logmatch_info(".is_last");
single_value->field_is__last.log_match(match_value.is__last(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_payload.match(match_value.payload(), legacy)){
TTCN_Logger::log_logmatch_info(".payload");
single_value->field_payload.log_match(match_value.payload(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if(!single_value->field_seen__once.match(match_value.seen__once(), legacy)){
TTCN_Logger::log_logmatch_info(".seen_once");
single_value->field_seen__once.log_match(match_value.seen__once(), 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("{ seq_nr := ");
single_value->field_seq__nr.log_match(match_value.seq__nr(), legacy);
TTCN_Logger::log_event_str(", is_last := ");
single_value->field_is__last.log_match(match_value.is__last(), legacy);
TTCN_Logger::log_event_str(", payload := ");
single_value->field_payload.log_match(match_value.payload(), legacy);
TTCN_Logger::log_event_str(", seen_once := ");
single_value->field_seen__once.log_match(match_value.seen__once(), 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 CbchBlock_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (seq__nr().is_bound()) seq__nr().set_implicit_omit();
if (is__last().is_bound()) is__last().set_implicit_omit();
if (payload().is_bound()) payload().set_implicit_omit();
if (seen__once().is_bound()) seen__once().set_implicit_omit();
}

void CbchBlock_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_seq__nr.encode_text(text_buf);
single_value->field_is__last.encode_text(text_buf);
single_value->field_payload.encode_text(text_buf);
single_value->field_seen__once.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_SMSCB.CbchBlock.");
}
}

void CbchBlock_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_seq__nr.decode_text(text_buf);
single_value->field_is__last.decode_text(text_buf);
single_value->field_payload.decode_text(text_buf);
single_value->field_seen__once.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 CbchBlock_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_SMSCB.CbchBlock.");
}
}

void CbchBlock_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: {
    CbchBlock_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_SMSCB.CbchBlock 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) seq__nr().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) is__last().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) payload().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) seen__once().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(), "seq_nr")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          seq__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(), "is_last")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          is__last().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(), "payload")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          payload().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(), "seen_once")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          seen__once().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_SMSCB.CbchBlock: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    CbchBlock_template* precondition = new CbchBlock_template;
    precondition->set_param(*param.get_elem(0));
    CbchBlock_template* implied_template = new CbchBlock_template;
    implied_template->set_param(*param.get_elem(1));
    *this = CbchBlock_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BTS_Tests_SMSCB.CbchBlock");
  }
  is_ifpresent = param.get_ifpresent();
}

void CbchBlock_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_seq__nr.check_restriction(t_res, t_name ? t_name : "@BTS_Tests_SMSCB.CbchBlock");
single_value->field_is__last.check_restriction(t_res, t_name ? t_name : "@BTS_Tests_SMSCB.CbchBlock");
single_value->field_payload.check_restriction(t_res, t_name ? t_name : "@BTS_Tests_SMSCB.CbchBlock");
single_value->field_seen__once.check_restriction(t_res, t_name ? t_name : "@BTS_Tests_SMSCB.CbchBlock");
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_SMSCB.CbchBlock");
}

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

boolean CbchBlock_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;
}

CbchTestParsChan::CbchTestParsChan()
{
}

CbchTestParsChan::CbchTestParsChan(const CbchTestMsgs& par_msgs,
    const OPTIONAL< CbchTestMsg >& par_default__msg)
  :   field_msgs(par_msgs),
  field_default__msg(par_default__msg)
{
}

CbchTestParsChan::CbchTestParsChan(const CbchTestParsChan& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BTS_Tests_SMSCB.CbchTestParsChan.");
if (other_value.msgs().is_bound()) field_msgs = other_value.msgs();
else field_msgs.clean_up();
if (other_value.default__msg().is_bound()) field_default__msg = other_value.default__msg();
else field_default__msg.clean_up();
}

void CbchTestParsChan::clean_up()
{
field_msgs.clean_up();
field_default__msg.clean_up();
}

const TTCN_Typedescriptor_t* CbchTestParsChan::get_descriptor() const { return &CbchTestParsChan_descr_; }
CbchTestParsChan& CbchTestParsChan::operator=(const CbchTestParsChan& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BTS_Tests_SMSCB.CbchTestParsChan.");
  if (other_value.msgs().is_bound()) field_msgs = other_value.msgs();
  else field_msgs.clean_up();
  if (other_value.default__msg().is_bound()) field_default__msg = other_value.default__msg();
  else field_default__msg.clean_up();
}
return *this;
}

boolean CbchTestParsChan::operator==(const CbchTestParsChan& other_value) const
{
return field_msgs==other_value.field_msgs
  && field_default__msg==other_value.field_default__msg;
}

boolean CbchTestParsChan::is_bound() const
{
return (field_msgs.is_bound())
  || (OPTIONAL_OMIT == field_default__msg.get_selection() || field_default__msg.is_bound());
}
boolean CbchTestParsChan::is_value() const
{
return field_msgs.is_value()
  && (OPTIONAL_OMIT == field_default__msg.get_selection() || field_default__msg.is_value());
}
int CbchTestParsChan::size_of() const
{
  int ret_val = 1;
  if (field_default__msg.ispresent()) ret_val++;
  return ret_val;
}

void CbchTestParsChan::log() const
{
if (!is_bound()) {
TTCN_Logger::log_event_unbound();
return;
}
TTCN_Logger::log_event_str("{ msgs := ");
field_msgs.log();
TTCN_Logger::log_event_str(", default_msg := ");
field_default__msg.log();
TTCN_Logger::log_event_str(" }");
}

void CbchTestParsChan::set_implicit_omit()
{
if (msgs().is_bound()) msgs().set_implicit_omit();
if (!default__msg().is_bound()) default__msg() = OMIT_VALUE;
else default__msg().set_implicit_omit();
}

void CbchTestParsChan::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_SMSCB.CbchTestParsChan 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) msgs().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) default__msg().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(), "msgs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          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(), "default_msg")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          default__msg().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_SMSCB.CbchTestParsChan: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BTS_Tests_SMSCB.CbchTestParsChan");
  }
}

void CbchTestParsChan::encode_text(Text_Buf& text_buf) const
{
field_msgs.encode_text(text_buf);
field_default__msg.encode_text(text_buf);
}

void CbchTestParsChan::decode_text(Text_Buf& text_buf)
{
field_msgs.decode_text(text_buf);
field_default__msg.decode_text(text_buf);
}

struct CbchTestParsChan_template::single_value_struct {
CbchTestMsgs_template field_msgs;
CbchTestMsg_template field_default__msg;
};

void CbchTestParsChan_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_msgs = ANY_VALUE;
single_value->field_default__msg = ANY_OR_OMIT;
}
}
}

void CbchTestParsChan_template::copy_value(const CbchTestParsChan& other_value)
{
single_value = new single_value_struct;
if (other_value.msgs().is_bound()) {
  single_value->field_msgs = other_value.msgs();
} else {
  single_value->field_msgs.clean_up();
}
if (other_value.default__msg().is_bound()) {
  if (other_value.default__msg().ispresent()) single_value->field_default__msg = other_value.default__msg()();
  else single_value->field_default__msg = OMIT_VALUE;
} else {
  single_value->field_default__msg.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void CbchTestParsChan_template::copy_template(const CbchTestParsChan_template& other_value)
{
switch (other_value.template_selection) {
case SPECIFIC_VALUE:
single_value = new single_value_struct;
if (UNINITIALIZED_TEMPLATE != other_value.msgs().get_selection()) {
single_value->field_msgs = other_value.msgs();
} else {
single_value->field_msgs.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.default__msg().get_selection()) {
single_value->field_default__msg = other_value.default__msg();
} else {
single_value->field_default__msg.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 CbchTestParsChan_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 CbchTestParsChan_template(*other_value.implication_.precondition);
implication_.implied_template = new CbchTestParsChan_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_SMSCB.CbchTestParsChan.");
break;
}
set_selection(other_value);
}

CbchTestParsChan_template::CbchTestParsChan_template()
{
}

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

CbchTestParsChan_template::CbchTestParsChan_template(const CbchTestParsChan& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

CbchTestParsChan_template& CbchTestParsChan_template::operator=(const OPTIONAL<CbchTestParsChan>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const CbchTestParsChan&)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_SMSCB.CbchTestParsChan.");
}
return *this;
}

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

boolean CbchTestParsChan_template::match(const CbchTestParsChan& 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.msgs().is_bound()) return FALSE;
if(!single_value->field_msgs.match(other_value.msgs(), legacy))return FALSE;
if(!other_value.default__msg().is_bound()) return FALSE;
if((other_value.default__msg().ispresent() ? !single_value->field_default__msg.match((const CbchTestMsg&)other_value.default__msg(), legacy) : !single_value->field_default__msg.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_SMSCB.CbchTestParsChan.");
}
return FALSE;
}

boolean CbchTestParsChan_template::is_bound() const
{
if (template_selection == UNINITIALIZED_TEMPLATE && !is_ifpresent) return FALSE;
if (template_selection != SPECIFIC_VALUE) return TRUE;
return single_value->field_msgs.is_bound()
 || (single_value->field_default__msg.is_omit() || single_value->field_default__msg.is_bound());
}

boolean CbchTestParsChan_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_msgs.is_value()
 && (single_value->field_default__msg.is_omit() || single_value->field_default__msg.is_value());
}

void CbchTestParsChan_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;
}

CbchTestParsChan CbchTestParsChan_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_SMSCB.CbchTestParsChan.");
CbchTestParsChan ret_val;
if (single_value->field_msgs.is_bound()) {
ret_val.msgs() = single_value->field_msgs.valueof();
}
if (single_value->field_default__msg.is_omit()) ret_val.default__msg() = OMIT_VALUE;
else if (single_value->field_default__msg.is_bound()) {
ret_val.default__msg() = single_value->field_default__msg.valueof();
}
return ret_val;
}

void CbchTestParsChan_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_SMSCB.CbchTestParsChan.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new CbchTestParsChan_template[list_length];
}

CbchTestParsChan_template& CbchTestParsChan_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_SMSCB.CbchTestParsChan.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BTS_Tests_SMSCB.CbchTestParsChan.");
return value_list.list_value[list_index];
}

CbchTestMsgs_template& CbchTestParsChan_template::msgs()
{
set_specific();
return single_value->field_msgs;
}

const CbchTestMsgs_template& CbchTestParsChan_template::msgs() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field msgs of a non-specific template of type @BTS_Tests_SMSCB.CbchTestParsChan.");
return single_value->field_msgs;
}

CbchTestMsg_template& CbchTestParsChan_template::default__msg()
{
set_specific();
return single_value->field_default__msg;
}

const CbchTestMsg_template& CbchTestParsChan_template::default__msg() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field default_msg of a non-specific template of type @BTS_Tests_SMSCB.CbchTestParsChan.");
return single_value->field_default__msg;
}

int CbchTestParsChan_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests_SMSCB.CbchTestParsChan which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 1;
      if (single_value->field_default__msg.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_SMSCB.CbchTestParsChan 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_SMSCB.CbchTestParsChan 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_SMSCB.CbchTestParsChan containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests_SMSCB.CbchTestParsChan containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests_SMSCB.CbchTestParsChan containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests_SMSCB.CbchTestParsChan containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests_SMSCB.CbchTestParsChan containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests_SMSCB.CbchTestParsChan containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BTS_Tests_SMSCB.CbchTestParsChan.");
  }
  return 0;
}

void CbchTestParsChan_template::log() const
{
switch (template_selection) {
case SPECIFIC_VALUE:
TTCN_Logger::log_event_str("{ msgs := ");
single_value->field_msgs.log();
TTCN_Logger::log_event_str(", default_msg := ");
single_value->field_default__msg.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 CbchTestParsChan_template::log_match(const CbchTestParsChan& 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_msgs.match(match_value.msgs(), legacy)){
TTCN_Logger::log_logmatch_info(".msgs");
single_value->field_msgs.log_match(match_value.msgs(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.default__msg().ispresent()){
if(!single_value->field_default__msg.match(match_value.default__msg(), legacy)){
TTCN_Logger::log_logmatch_info(".default_msg");
single_value->field_default__msg.log_match(match_value.default__msg(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_default__msg.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".default_msg := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_default__msg.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("{ msgs := ");
single_value->field_msgs.log_match(match_value.msgs(), legacy);
TTCN_Logger::log_event_str(", default_msg := ");
if (match_value.default__msg().ispresent()) {
single_value->field_default__msg.log_match(match_value.default__msg(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_default__msg.log();
if (single_value->field_default__msg.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 CbchTestParsChan_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (msgs().is_bound()) msgs().set_implicit_omit();
if (!default__msg().is_bound()) default__msg() = OMIT_VALUE;
else default__msg().set_implicit_omit();
}

void CbchTestParsChan_template::encode_text(Text_Buf& text_buf) const
{
encode_text_base(text_buf);
switch (template_selection) {
case SPECIFIC_VALUE:
single_value->field_msgs.encode_text(text_buf);
single_value->field_default__msg.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_SMSCB.CbchTestParsChan.");
}
}

void CbchTestParsChan_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_msgs.decode_text(text_buf);
single_value->field_default__msg.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 CbchTestParsChan_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_SMSCB.CbchTestParsChan.");
}
}

void CbchTestParsChan_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: {
    CbchTestParsChan_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_SMSCB.CbchTestParsChan 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) msgs().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) default__msg().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(), "msgs")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          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(), "default_msg")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          default__msg().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_SMSCB.CbchTestParsChan: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    CbchTestParsChan_template* precondition = new CbchTestParsChan_template;
    precondition->set_param(*param.get_elem(0));
    CbchTestParsChan_template* implied_template = new CbchTestParsChan_template;
    implied_template->set_param(*param.get_elem(1));
    *this = CbchTestParsChan_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BTS_Tests_SMSCB.CbchTestParsChan");
  }
  is_ifpresent = param.get_ifpresent();
}

void CbchTestParsChan_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_msgs.check_restriction(t_res, t_name ? t_name : "@BTS_Tests_SMSCB.CbchTestParsChan");
single_value->field_default__msg.check_restriction(t_res, t_name ? t_name : "@BTS_Tests_SMSCB.CbchTestParsChan");
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_SMSCB.CbchTestParsChan");
}

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

boolean CbchTestParsChan_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;
}

CbchTestPars::CbchTestPars()
{
}

CbchTestPars::CbchTestPars(const GSM__Types::RslChannelNr& par_chan__nr,
    const BTS__Tests::FreqHopPars& par_fhp,
    const CbchTestParsChan& par_basic,
    const OPTIONAL< CbchTestParsChan >& par_extended)
  :   field_chan__nr(par_chan__nr),
  field_fhp(par_fhp),
  field_basic(par_basic),
  field_extended(par_extended)
{
}

CbchTestPars::CbchTestPars(const CbchTestPars& other_value)
{
if(!other_value.is_bound()) TTCN_error("Copying an unbound value of type @BTS_Tests_SMSCB.CbchTestPars.");
if (other_value.chan__nr().is_bound()) field_chan__nr = other_value.chan__nr();
else field_chan__nr.clean_up();
if (other_value.fhp().is_bound()) field_fhp = other_value.fhp();
else field_fhp.clean_up();
if (other_value.basic().is_bound()) field_basic = other_value.basic();
else field_basic.clean_up();
if (other_value.extended().is_bound()) field_extended = other_value.extended();
else field_extended.clean_up();
}

void CbchTestPars::clean_up()
{
field_chan__nr.clean_up();
field_fhp.clean_up();
field_basic.clean_up();
field_extended.clean_up();
}

const TTCN_Typedescriptor_t* CbchTestPars::get_descriptor() const { return &CbchTestPars_descr_; }
CbchTestPars& CbchTestPars::operator=(const CbchTestPars& other_value)
{
if (this != &other_value) {
  if(!other_value.is_bound()) TTCN_error("Assignment of an unbound value of type @BTS_Tests_SMSCB.CbchTestPars.");
  if (other_value.chan__nr().is_bound()) field_chan__nr = other_value.chan__nr();
  else field_chan__nr.clean_up();
  if (other_value.fhp().is_bound()) field_fhp = other_value.fhp();
  else field_fhp.clean_up();
  if (other_value.basic().is_bound()) field_basic = other_value.basic();
  else field_basic.clean_up();
  if (other_value.extended().is_bound()) field_extended = other_value.extended();
  else field_extended.clean_up();
}
return *this;
}

boolean CbchTestPars::operator==(const CbchTestPars& other_value) const
{
return field_chan__nr==other_value.field_chan__nr
  && field_fhp==other_value.field_fhp
  && field_basic==other_value.field_basic
  && field_extended==other_value.field_extended;
}

boolean CbchTestPars::is_bound() const
{
return (field_chan__nr.is_bound())
  || (field_fhp.is_bound())
  || (field_basic.is_bound())
  || (OPTIONAL_OMIT == field_extended.get_selection() || field_extended.is_bound());
}
boolean CbchTestPars::is_value() const
{
return field_chan__nr.is_value()
  && field_fhp.is_value()
  && field_basic.is_value()
  && (OPTIONAL_OMIT == field_extended.get_selection() || field_extended.is_value());
}
int CbchTestPars::size_of() const
{
  int ret_val = 3;
  if (field_extended.ispresent()) ret_val++;
  return ret_val;
}

void CbchTestPars::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(", fhp := ");
field_fhp.log();
TTCN_Logger::log_event_str(", basic := ");
field_basic.log();
TTCN_Logger::log_event_str(", extended := ");
field_extended.log();
TTCN_Logger::log_event_str(" }");
}

void CbchTestPars::set_implicit_omit()
{
if (chan__nr().is_bound()) chan__nr().set_implicit_omit();
if (fhp().is_bound()) fhp().set_implicit_omit();
if (basic().is_bound()) basic().set_implicit_omit();
if (!extended().is_bound()) extended() = OMIT_VALUE;
else extended().set_implicit_omit();
}

void CbchTestPars::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_SMSCB.CbchTestPars 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) chan__nr().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) fhp().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) basic().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) extended().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(), "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(), "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(), "basic")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          basic().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(), "extended")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          extended().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_SMSCB.CbchTestPars: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  default:
    param.type_error("record value", "@BTS_Tests_SMSCB.CbchTestPars");
  }
}

void CbchTestPars::encode_text(Text_Buf& text_buf) const
{
field_chan__nr.encode_text(text_buf);
field_fhp.encode_text(text_buf);
field_basic.encode_text(text_buf);
field_extended.encode_text(text_buf);
}

void CbchTestPars::decode_text(Text_Buf& text_buf)
{
field_chan__nr.decode_text(text_buf);
field_fhp.decode_text(text_buf);
field_basic.decode_text(text_buf);
field_extended.decode_text(text_buf);
}

struct CbchTestPars_template::single_value_struct {
GSM__Types::RslChannelNr_template field_chan__nr;
BTS__Tests::FreqHopPars_template field_fhp;
CbchTestParsChan_template field_basic;
CbchTestParsChan_template field_extended;
};

void CbchTestPars_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_fhp = ANY_VALUE;
single_value->field_basic = ANY_VALUE;
single_value->field_extended = ANY_OR_OMIT;
}
}
}

void CbchTestPars_template::copy_value(const CbchTestPars& 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.fhp().is_bound()) {
  single_value->field_fhp = other_value.fhp();
} else {
  single_value->field_fhp.clean_up();
}
if (other_value.basic().is_bound()) {
  single_value->field_basic = other_value.basic();
} else {
  single_value->field_basic.clean_up();
}
if (other_value.extended().is_bound()) {
  if (other_value.extended().ispresent()) single_value->field_extended = other_value.extended()();
  else single_value->field_extended = OMIT_VALUE;
} else {
  single_value->field_extended.clean_up();
}
set_selection(SPECIFIC_VALUE);
}

void CbchTestPars_template::copy_template(const CbchTestPars_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.fhp().get_selection()) {
single_value->field_fhp = other_value.fhp();
} else {
single_value->field_fhp.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.basic().get_selection()) {
single_value->field_basic = other_value.basic();
} else {
single_value->field_basic.clean_up();
}
if (UNINITIALIZED_TEMPLATE != other_value.extended().get_selection()) {
single_value->field_extended = other_value.extended();
} else {
single_value->field_extended.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 CbchTestPars_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 CbchTestPars_template(*other_value.implication_.precondition);
implication_.implied_template = new CbchTestPars_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_SMSCB.CbchTestPars.");
break;
}
set_selection(other_value);
}

CbchTestPars_template::CbchTestPars_template()
{
}

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

CbchTestPars_template::CbchTestPars_template(const CbchTestPars& other_value)
{
copy_value(other_value);
}

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

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

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

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

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

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

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

CbchTestPars_template& CbchTestPars_template::operator=(const OPTIONAL<CbchTestPars>& other_value)
{
clean_up();
switch (other_value.get_selection()) {
case OPTIONAL_PRESENT:
copy_value((const CbchTestPars&)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_SMSCB.CbchTestPars.");
}
return *this;
}

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

boolean CbchTestPars_template::match(const CbchTestPars& 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.fhp().is_bound()) return FALSE;
if(!single_value->field_fhp.match(other_value.fhp(), legacy))return FALSE;
if(!other_value.basic().is_bound()) return FALSE;
if(!single_value->field_basic.match(other_value.basic(), legacy))return FALSE;
if(!other_value.extended().is_bound()) return FALSE;
if((other_value.extended().ispresent() ? !single_value->field_extended.match((const CbchTestParsChan&)other_value.extended(), legacy) : !single_value->field_extended.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_SMSCB.CbchTestPars.");
}
return FALSE;
}

boolean CbchTestPars_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_fhp.is_bound()
 || single_value->field_basic.is_bound()
 || (single_value->field_extended.is_omit() || single_value->field_extended.is_bound());
}

boolean CbchTestPars_template::is_value() const
{
if (template_selection != SPECIFIC_VALUE || is_ifpresent) return FALSE;
return single_value->field_chan__nr.is_value()
 && single_value->field_fhp.is_value()
 && single_value->field_basic.is_value()
 && (single_value->field_extended.is_omit() || single_value->field_extended.is_value());
}

void CbchTestPars_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;
}

CbchTestPars CbchTestPars_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_SMSCB.CbchTestPars.");
CbchTestPars ret_val;
if (single_value->field_chan__nr.is_bound()) {
ret_val.chan__nr() = single_value->field_chan__nr.valueof();
}
if (single_value->field_fhp.is_bound()) {
ret_val.fhp() = single_value->field_fhp.valueof();
}
if (single_value->field_basic.is_bound()) {
ret_val.basic() = single_value->field_basic.valueof();
}
if (single_value->field_extended.is_omit()) ret_val.extended() = OMIT_VALUE;
else if (single_value->field_extended.is_bound()) {
ret_val.extended() = single_value->field_extended.valueof();
}
return ret_val;
}

void CbchTestPars_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_SMSCB.CbchTestPars.");
clean_up();
set_selection(template_type);
value_list.n_values = list_length;
value_list.list_value = new CbchTestPars_template[list_length];
}

CbchTestPars_template& CbchTestPars_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_SMSCB.CbchTestPars.");
if (list_index >= value_list.n_values)
TTCN_error("Index overflow in a value list template of type @BTS_Tests_SMSCB.CbchTestPars.");
return value_list.list_value[list_index];
}

GSM__Types::RslChannelNr_template& CbchTestPars_template::chan__nr()
{
set_specific();
return single_value->field_chan__nr;
}

const GSM__Types::RslChannelNr_template& CbchTestPars_template::chan__nr() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field chan_nr of a non-specific template of type @BTS_Tests_SMSCB.CbchTestPars.");
return single_value->field_chan__nr;
}

BTS__Tests::FreqHopPars_template& CbchTestPars_template::fhp()
{
set_specific();
return single_value->field_fhp;
}

const BTS__Tests::FreqHopPars_template& CbchTestPars_template::fhp() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field fhp of a non-specific template of type @BTS_Tests_SMSCB.CbchTestPars.");
return single_value->field_fhp;
}

CbchTestParsChan_template& CbchTestPars_template::basic()
{
set_specific();
return single_value->field_basic;
}

const CbchTestParsChan_template& CbchTestPars_template::basic() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field basic of a non-specific template of type @BTS_Tests_SMSCB.CbchTestPars.");
return single_value->field_basic;
}

CbchTestParsChan_template& CbchTestPars_template::extended()
{
set_specific();
return single_value->field_extended;
}

const CbchTestParsChan_template& CbchTestPars_template::extended() const
{
if (template_selection != SPECIFIC_VALUE)
TTCN_error("Accessing field extended of a non-specific template of type @BTS_Tests_SMSCB.CbchTestPars.");
return single_value->field_extended;
}

int CbchTestPars_template::size_of() const
{
  if (is_ifpresent) TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests_SMSCB.CbchTestPars which has an ifpresent attribute.");
  switch (template_selection)
  {
  case SPECIFIC_VALUE:
  {    int ret_val = 3;
      if (single_value->field_extended.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_SMSCB.CbchTestPars 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_SMSCB.CbchTestPars 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_SMSCB.CbchTestPars containing omit value.");
  case ANY_VALUE:
  case ANY_OR_OMIT:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests_SMSCB.CbchTestPars containing */? value.");
  case COMPLEMENTED_LIST:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests_SMSCB.CbchTestPars containing complemented list.");
  case CONJUNCTION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests_SMSCB.CbchTestPars containing a conjunction list match.");
  case IMPLICATION_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests_SMSCB.CbchTestPars containing an implication match.");
  case DYNAMIC_MATCH:
    TTCN_error("Performing sizeof() operation on a template of type @BTS_Tests_SMSCB.CbchTestPars containing a dynamic match.");
  default:
    TTCN_error("Performing sizeof() operation on an uninitialized/unsupported template of type @BTS_Tests_SMSCB.CbchTestPars.");
  }
  return 0;
}

void CbchTestPars_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(", fhp := ");
single_value->field_fhp.log();
TTCN_Logger::log_event_str(", basic := ");
single_value->field_basic.log();
TTCN_Logger::log_event_str(", extended := ");
single_value->field_extended.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 CbchTestPars_template::log_match(const CbchTestPars& 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_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_basic.match(match_value.basic(), legacy)){
TTCN_Logger::log_logmatch_info(".basic");
single_value->field_basic.log_match(match_value.basic(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
if (match_value.extended().ispresent()){
if(!single_value->field_extended.match(match_value.extended(), legacy)){
TTCN_Logger::log_logmatch_info(".extended");
single_value->field_extended.log_match(match_value.extended(), legacy);
TTCN_Logger::set_logmatch_buffer_len(previous_size);
}
} else {
if (!single_value->field_extended.match_omit(legacy)){
 TTCN_Logger::log_logmatch_info(".extended := omit with ");
TTCN_Logger::print_logmatch_buffer();
single_value->field_extended.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("{ chan_nr := ");
single_value->field_chan__nr.log_match(match_value.chan__nr(), legacy);
TTCN_Logger::log_event_str(", fhp := ");
single_value->field_fhp.log_match(match_value.fhp(), legacy);
TTCN_Logger::log_event_str(", basic := ");
single_value->field_basic.log_match(match_value.basic(), legacy);
TTCN_Logger::log_event_str(", extended := ");
if (match_value.extended().ispresent()) {
single_value->field_extended.log_match(match_value.extended(), legacy);
} else {
TTCN_Logger::log_event_str("omit with ");
single_value->field_extended.log();
if (single_value->field_extended.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 CbchTestPars_template::set_implicit_omit()
{
if (template_selection != SPECIFIC_VALUE) return;
if (chan__nr().is_bound()) chan__nr().set_implicit_omit();
if (fhp().is_bound()) fhp().set_implicit_omit();
if (basic().is_bound()) basic().set_implicit_omit();
if (!extended().is_bound()) extended() = OMIT_VALUE;
else extended().set_implicit_omit();
}

void CbchTestPars_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_fhp.encode_text(text_buf);
single_value->field_basic.encode_text(text_buf);
single_value->field_extended.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_SMSCB.CbchTestPars.");
}
}

void CbchTestPars_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_fhp.decode_text(text_buf);
single_value->field_basic.decode_text(text_buf);
single_value->field_extended.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 CbchTestPars_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_SMSCB.CbchTestPars.");
}
}

void CbchTestPars_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: {
    CbchTestPars_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_SMSCB.CbchTestPars 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) chan__nr().set_param(*param.get_elem(0));
    if (param.get_size()>1 && param.get_elem(1)->get_type()!=Module_Param::MP_NotUsed) fhp().set_param(*param.get_elem(1));
    if (param.get_size()>2 && param.get_elem(2)->get_type()!=Module_Param::MP_NotUsed) basic().set_param(*param.get_elem(2));
    if (param.get_size()>3 && param.get_elem(3)->get_type()!=Module_Param::MP_NotUsed) extended().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(), "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(), "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(), "basic")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          basic().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(), "extended")) {
        if (curr_param->get_type()!=Module_Param::MP_NotUsed) {
          extended().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_SMSCB.CbchTestPars: %s", curr_param->get_id()->get_name());
      break;
    }
  } break;
  case Module_Param::MP_Implication_Template: {
    CbchTestPars_template* precondition = new CbchTestPars_template;
    precondition->set_param(*param.get_elem(0));
    CbchTestPars_template* implied_template = new CbchTestPars_template;
    implied_template->set_param(*param.get_elem(1));
    *this = CbchTestPars_template(precondition, implied_template);
  } break;
  default:
    param.type_error("record template", "@BTS_Tests_SMSCB.CbchTestPars");
  }
  is_ifpresent = param.get_ifpresent();
}

void CbchTestPars_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_SMSCB.CbchTestPars");
single_value->field_fhp.check_restriction(t_res, t_name ? t_name : "@BTS_Tests_SMSCB.CbchTestPars");
single_value->field_basic.check_restriction(t_res, t_name ? t_name : "@BTS_Tests_SMSCB.CbchTestPars");
single_value->field_extended.check_restriction(t_res, t_name ? t_name : "@BTS_Tests_SMSCB.CbchTestPars");
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_SMSCB.CbchTestPars");
}

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

boolean CbchTestPars_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;
}


/* Bodies of functions, altsteps and testcases */

boolean operator==(null_type, const CbchTestMsgs& other_value)
{
if (other_value.val_ptr == NULL)
TTCN_error("The right operand of comparison is an unbound value of type @BTS_Tests_SMSCB.CbchTestMsgs.");
return other_value.val_ptr->n_elements == 0;
}

boolean operator==(null_type, const CbchBlocks& other_value)
{
if (other_value.val_ptr == NULL)
TTCN_error("The right operand of comparison is an unbound value of type @BTS_Tests_SMSCB.CbchBlocks.");
return other_value.val_ptr->n_elements == 0;
}

CbchTestParsChan_template t__CbchPC(const CbchTestMsgs_template& msgs, const CbchTestMsg_template& def)
{
TTCN_Location current_location("BTS_Tests_SMSCB.ttcn", 49, TTCN_Location::LOCATION_TEMPLATE, "t_CbchPC");
CbchTestParsChan_template ret_val;
ret_val.msgs() = msgs;
ret_val.default__msg() = def;
return ret_val;
}

void f__cbch__compute__exp__blocks(CbchTestPars& pars)
{
TTCN_Location current_location("BTS_Tests_SMSCB.ttcn", 87, TTCN_Location::LOCATION_FUNCTION, "f_cbch_compute_exp_blocks");
current_location.update_lineno(88);
/* BTS_Tests_SMSCB.ttcn, line 88 */
f__cbch__compute__exp__blocks__chan(pars.basic());
current_location.update_lineno(89);
/* BTS_Tests_SMSCB.ttcn, line 89 */
{
boolean tmp_3;
{
boolean tmp_0 = pars.is_bound();
if(tmp_0) {
const OPTIONAL< CbchTestParsChan >& tmp_1 = pars.extended();
switch (tmp_1.get_selection()) {
case OPTIONAL_UNBOUND:
tmp_0 = FALSE;
break;
case OPTIONAL_OMIT:
tmp_0 = FALSE;
break;
default:
{
const CbchTestParsChan& tmp_2 = (const CbchTestParsChan&) tmp_1;
tmp_0 = tmp_2.is_present();
break;}
}
}
tmp_3 = tmp_0;
}
if (tmp_3) {
current_location.update_lineno(90);
/* BTS_Tests_SMSCB.ttcn, line 90 */
f__cbch__compute__exp__blocks__chan(pars.extended());
}
}
}

void f__cbch__compute__exp__blocks__chan(CbchTestParsChan& pars__chan)
{
TTCN_Location current_location("BTS_Tests_SMSCB.ttcn", 93, TTCN_Location::LOCATION_FUNCTION, "f_cbch_compute_exp_blocks_chan");
current_location.update_lineno(94);
/* BTS_Tests_SMSCB.ttcn, line 94 */
INTEGER i;
current_location.update_lineno(95);
/* BTS_Tests_SMSCB.ttcn, line 95 */
i = 0;
current_location.update_lineno(95);
/* BTS_Tests_SMSCB.ttcn, line 95 */
for ( ; ; ) {
current_location.update_lineno(95);
/* BTS_Tests_SMSCB.ttcn, line 95 */
if (!(i < const_cast< const CbchTestParsChan&>(pars__chan).msgs().lengthof())) break;
current_location.update_lineno(96);
/* BTS_Tests_SMSCB.ttcn, line 96 */
pars__chan.msgs()[i].blocks() = f__comp__blocks(const_cast< const CbchTestParsChan&>(pars__chan).msgs()[i]);
current_location.update_lineno(95);
/* BTS_Tests_SMSCB.ttcn, line 95 */
{
INTEGER tmp_6;
++i;
}
}
current_location.update_lineno(98);
/* BTS_Tests_SMSCB.ttcn, line 98 */
{
boolean tmp_10;
{
boolean tmp_7 = pars__chan.is_bound();
if(tmp_7) {
const OPTIONAL< CbchTestMsg >& tmp_8 = pars__chan.default__msg();
switch (tmp_8.get_selection()) {
case OPTIONAL_UNBOUND:
tmp_7 = FALSE;
break;
case OPTIONAL_OMIT:
tmp_7 = FALSE;
break;
default:
{
const CbchTestMsg& tmp_9 = (const CbchTestMsg&) tmp_8;
tmp_7 = tmp_9.is_present();
break;}
}
}
tmp_10 = tmp_7;
}
if (tmp_10) {
current_location.update_lineno(99);
/* BTS_Tests_SMSCB.ttcn, line 99 */
pars__chan.default__msg()().blocks() = f__comp__blocks(const_cast< const CbchTestParsChan&>(pars__chan).default__msg());
}
}
}

CbchBlocks f__comp__blocks(const CbchTestMsg& msg)
{
TTCN_Location current_location("BTS_Tests_SMSCB.ttcn", 102, TTCN_Location::LOCATION_FUNCTION, "f_comp_blocks");
current_location.update_lineno(103);
/* BTS_Tests_SMSCB.ttcn, line 103 */
CbchBlocks blocks(NULL_VALUE);
current_location.update_lineno(104);
/* BTS_Tests_SMSCB.ttcn, line 104 */
INTEGER i;
current_location.update_lineno(106);
/* BTS_Tests_SMSCB.ttcn, line 106 */
i = 0;
current_location.update_lineno(106);
/* BTS_Tests_SMSCB.ttcn, line 106 */
for ( ; ; ) {
current_location.update_lineno(106);
/* BTS_Tests_SMSCB.ttcn, line 106 */
if (!(i <= const_cast< const CbchTestMsg&>(msg).last__block())) break;
current_location.update_lineno(107);
/* BTS_Tests_SMSCB.ttcn, line 107 */
CbchBlock block;
block.seq__nr() = i;
block.is__last() = FALSE;
block.payload() = substr(const_cast< const CbchTestMsg&>(msg).payload(), (22 * i), 22);
block.seen__once() = FALSE;
current_location.update_lineno(113);
/* BTS_Tests_SMSCB.ttcn, line 113 */
{
boolean tmp_13;
tmp_13 = (const_cast< const CbchTestMsg&>(msg).rsl__cb__cmd() == RSL__Types::RSL__CbCommand::RSL__CB__CMD__SCHEDULE);
if (tmp_13) tmp_13 = (i == 0);
if (tmp_13) {
current_location.update_lineno(114);
/* BTS_Tests_SMSCB.ttcn, line 114 */
block.seq__nr() = 8;
}
}
current_location.update_lineno(116);
/* BTS_Tests_SMSCB.ttcn, line 116 */
if ((i == const_cast< const CbchTestMsg&>(msg).last__block())) {
current_location.update_lineno(117);
/* BTS_Tests_SMSCB.ttcn, line 117 */
block.is__last() = TRUE;
}
current_location.update_lineno(119);
/* BTS_Tests_SMSCB.ttcn, line 119 */
{
CbchBlocks tmp_16;
{
CbchBlocks tmp_17;
tmp_17.set_size(1);
tmp_17[0] = block;
tmp_16 = (blocks + tmp_17);
}
blocks = tmp_16;
}
current_location.update_lineno(106);
/* BTS_Tests_SMSCB.ttcn, line 106 */
{
INTEGER tmp_18;
++i;
}
}
current_location.update_lineno(122);
/* BTS_Tests_SMSCB.ttcn, line 122 */
return blocks;
}

INTEGER f__cbch__block__nr2rsl(const INTEGER& nr)
{
TTCN_Location current_location("BTS_Tests_SMSCB.ttcn", 126, TTCN_Location::LOCATION_FUNCTION, "f_cbch_block_nr2rsl");
{
const INTEGER &tmp_20 = nr;
switch(tmp_20.get_long_long_val()) {
case(0):
{
current_location.update_lineno(128);
/* BTS_Tests_SMSCB.ttcn, line 128 */
return 1;
break;
}
case(1):
{
current_location.update_lineno(129);
/* BTS_Tests_SMSCB.ttcn, line 129 */
return 2;
break;
}
case(2):
{
current_location.update_lineno(130);
/* BTS_Tests_SMSCB.ttcn, line 130 */
return 3;
break;
}
case(3):
{
current_location.update_lineno(131);
/* BTS_Tests_SMSCB.ttcn, line 131 */
return 0;
break;
}
};}
current_location.update_lineno(133);
/* BTS_Tests_SMSCB.ttcn, line 133 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Invalid block number"),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(134);
/* BTS_Tests_SMSCB.ttcn, line 134 */
TTCN_Runtime::stop_component(MTC_COMPREF);
}

INTEGER f__cbch__fn2tb(const INTEGER& fn)
{
TTCN_Location current_location("BTS_Tests_SMSCB.ttcn", 137, TTCN_Location::LOCATION_FUNCTION, "f_cbch_fn2tb");
current_location.update_lineno(139);
/* BTS_Tests_SMSCB.ttcn, line 139 */
return mod((fn / 51), 8);
}

void f__cbch__fn__verify(const INTEGER& fn, const GSM__Types::CBCH__Block& cb)
{
TTCN_Location current_location("BTS_Tests_SMSCB.ttcn", 143, TTCN_Location::LOCATION_FUNCTION, "f_cbch_fn_verify");
current_location.update_lineno(145);
/* BTS_Tests_SMSCB.ttcn, line 145 */
INTEGER tb(f__cbch__fn2tb(fn));
current_location.update_lineno(146);
/* BTS_Tests_SMSCB.ttcn, line 146 */
if ((const_cast< const GSM__Types::CBCH__Block&>(cb).block__type().seq__nr() == 15)) {
current_location.update_lineno(148);
/* BTS_Tests_SMSCB.ttcn, line 148 */
return;
}
else {
current_location.update_lineno(149);
/* BTS_Tests_SMSCB.ttcn, line 149 */
if ((const_cast< const GSM__Types::CBCH__Block&>(cb).block__type().seq__nr() == 8)) {
current_location.update_lineno(150);
/* BTS_Tests_SMSCB.ttcn, line 150 */
if ((tb != 0)) {
current_location.update_lineno(151);
/* BTS_Tests_SMSCB.ttcn, line 151 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Schedule block at TB="),tb.log(),TTCN_Logger::end_event_log2str()));
}
}
else {
current_location.update_lineno(153);
/* BTS_Tests_SMSCB.ttcn, line 153 */
if ((const_cast< const GSM__Types::CBCH__Block&>(cb).block__type().seq__nr() < 4)) {
current_location.update_lineno(154);
/* BTS_Tests_SMSCB.ttcn, line 154 */
{
boolean tmp_21;
tmp_21 = (const_cast< const GSM__Types::CBCH__Block&>(cb).block__type().seq__nr() != tb);
if (tmp_21) tmp_21 = ((const_cast< const GSM__Types::CBCH__Block&>(cb).block__type().seq__nr() + 4) != tb);
if (tmp_21) {
current_location.update_lineno(155);
/* BTS_Tests_SMSCB.ttcn, line 155 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Normal block at wrong TB="),tb.log(),TTCN_Logger::log_event_str(": "),cb.log(),TTCN_Logger::end_event_log2str()));
}
}
}
}
}
}

void f__rsl__smscb__default__null()
{
TTCN_Location current_location("BTS_Tests_SMSCB.ttcn", 160, TTCN_Location::LOCATION_FUNCTION, "f_rsl_smscb_default_null");
current_location.update_lineno(162);
/* BTS_Tests_SMSCB.ttcn, line 162 */
RSL__Types::RSL__IE__CbCommandType cmd__type(RSL__Types::ts__RSL__IE__CbCmdType(RSL__Types::RSL__CbCommand::RSL__CB__CMD__DEFAULT, 1, TRUE).valueof());
current_location.update_lineno(164);
/* BTS_Tests_SMSCB.ttcn, line 164 */
BTS__Tests::test__CT_component_RSL__CCHAN.send(IPA__Emulation::ts__ASP__RSL__UD(RSL__Types::ts__RSL__SMSCB__CMD(RSL__Types::RSL__IE__CbCommandType_template(cmd__type), OCTETSTRING_template(os_0), RSL__Types::ts__RSL__SMSCB__CMD_chan__nr_defval), IPA__Emulation::ts__ASP__RSL__UD_sid_defval, IPA__Emulation::ts__ASP__RSL__UD_conn__id_defval), FALSE, NULL);
}

void start_f__rsl__smscb__default__null(const COMPONENT& component_reference)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_rsl_smscb_default_null(");
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_SMSCB", "f_rsl_smscb_default_null", text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__smscb__setup__rsl__chan(CbchTestParsChan& pars__chan, const BOOLEAN& extd)
{
TTCN_Location current_location("BTS_Tests_SMSCB.ttcn", 169, TTCN_Location::LOCATION_FUNCTION, "f_smscb_setup_rsl_chan");
current_location.update_lineno(171);
/* BTS_Tests_SMSCB.ttcn, line 171 */
INTEGER i;
current_location.update_lineno(172);
/* BTS_Tests_SMSCB.ttcn, line 172 */
CbchTestMsg msg;
current_location.update_lineno(173);
/* BTS_Tests_SMSCB.ttcn, line 173 */
INTEGER rsl__last__block;
current_location.update_lineno(174);
/* BTS_Tests_SMSCB.ttcn, line 174 */
RSL__Types::RSL__IE__CbCommandType cmd__type;
current_location.update_lineno(175);
/* BTS_Tests_SMSCB.ttcn, line 175 */
RSL__Types::RSL__Message rsl;
current_location.update_lineno(178);
/* BTS_Tests_SMSCB.ttcn, line 178 */
i = 0;
current_location.update_lineno(178);
/* BTS_Tests_SMSCB.ttcn, line 178 */
for ( ; ; ) {
current_location.update_lineno(178);
/* BTS_Tests_SMSCB.ttcn, line 178 */
if (!(i < const_cast< const CbchTestParsChan&>(pars__chan).msgs().lengthof())) break;
current_location.update_lineno(179);
/* BTS_Tests_SMSCB.ttcn, line 179 */
msg = const_cast< const CbchTestParsChan&>(pars__chan).msgs()[i];
current_location.update_lineno(180);
/* BTS_Tests_SMSCB.ttcn, line 180 */
rsl__last__block = f__cbch__block__nr2rsl(const_cast< const CbchTestMsg&>(msg).last__block());
current_location.update_lineno(181);
/* BTS_Tests_SMSCB.ttcn, line 181 */
cmd__type = RSL__Types::ts__RSL__IE__CbCmdType(const_cast< const CbchTestMsg&>(msg).rsl__cb__cmd(), rsl__last__block, RSL__Types::ts__RSL__IE__CbCmdType_def__bcast__null_defval).valueof();
current_location.update_lineno(182);
/* BTS_Tests_SMSCB.ttcn, line 182 */
rsl = RSL__Types::ts__RSL__SMSCB__CMD(RSL__Types::RSL__IE__CbCommandType_template(cmd__type), OCTETSTRING_template(const_cast< const CbchTestMsg&>(msg).payload()), RSL__Types::ts__RSL__SMSCB__CMD_chan__nr_defval).valueof();
current_location.update_lineno(183);
/* BTS_Tests_SMSCB.ttcn, line 183 */
if (extd) {
current_location.update_lineno(184);
/* BTS_Tests_SMSCB.ttcn, line 184 */
{
OPTIONAL< RSL__Types::RSL__IE__List > tmp_28;
{
RSL__Types::RSL__IE__List tmp_30;
tmp_30.set_size(1);
tmp_30[0] = t__RSL__IE__SMSCB__EXT.valueof();
tmp_28() = (const_cast< const RSL__Types::RSL__Message&>(rsl).ies()() + tmp_30);
}
{
RSL__Types::RSL__IE__List& tmp_29 = rsl.ies(); /* 7388 */
tmp_29 = tmp_28;
}
}
}
current_location.update_lineno(186);
/* BTS_Tests_SMSCB.ttcn, line 186 */
BTS__Tests::test__CT_component_RSL__CCHAN.send(IPA__Emulation::ts__ASP__RSL__UD(RSL__Types::RSL__Message_template(rsl), IPA__Emulation::ts__ASP__RSL__UD_sid_defval, IPA__Emulation::ts__ASP__RSL__UD_conn__id_defval), FALSE, NULL);
current_location.update_lineno(178);
/* BTS_Tests_SMSCB.ttcn, line 178 */
{
INTEGER tmp_31;
++i;
}
}
current_location.update_lineno(188);
/* BTS_Tests_SMSCB.ttcn, line 188 */
{
boolean tmp_35;
{
boolean tmp_32 = pars__chan.is_bound();
if(tmp_32) {
const OPTIONAL< CbchTestMsg >& tmp_33 = pars__chan.default__msg();
switch (tmp_33.get_selection()) {
case OPTIONAL_UNBOUND:
tmp_32 = FALSE;
break;
case OPTIONAL_OMIT:
tmp_32 = FALSE;
break;
default:
{
const CbchTestMsg& tmp_34 = (const CbchTestMsg&) tmp_33;
tmp_32 = tmp_34.is_present();
break;}
}
}
tmp_35 = tmp_32;
}
if (tmp_35) {
current_location.update_lineno(189);
/* BTS_Tests_SMSCB.ttcn, line 189 */
msg = const_cast< const CbchTestParsChan&>(pars__chan).default__msg();
current_location.update_lineno(190);
/* BTS_Tests_SMSCB.ttcn, line 190 */
rsl__last__block = f__cbch__block__nr2rsl(const_cast< const CbchTestMsg&>(msg).last__block());
current_location.update_lineno(191);
/* BTS_Tests_SMSCB.ttcn, line 191 */
cmd__type = RSL__Types::ts__RSL__IE__CbCmdType(const_cast< const CbchTestMsg&>(msg).rsl__cb__cmd(), rsl__last__block, FALSE).valueof();
current_location.update_lineno(192);
/* BTS_Tests_SMSCB.ttcn, line 192 */
rsl = RSL__Types::ts__RSL__SMSCB__CMD(RSL__Types::RSL__IE__CbCommandType_template(cmd__type), OCTETSTRING_template(const_cast< const CbchTestMsg&>(msg).payload()), RSL__Types::ts__RSL__SMSCB__CMD_chan__nr_defval).valueof();
current_location.update_lineno(193);
/* BTS_Tests_SMSCB.ttcn, line 193 */
if (extd) {
current_location.update_lineno(194);
/* BTS_Tests_SMSCB.ttcn, line 194 */
{
OPTIONAL< RSL__Types::RSL__IE__List > tmp_40;
{
RSL__Types::RSL__IE__List tmp_42;
tmp_42.set_size(1);
tmp_42[0] = t__RSL__IE__SMSCB__EXT.valueof();
tmp_40() = (const_cast< const RSL__Types::RSL__Message&>(rsl).ies()() + tmp_42);
}
{
RSL__Types::RSL__IE__List& tmp_41 = rsl.ies(); /* 7388 */
tmp_41 = tmp_40;
}
}
}
current_location.update_lineno(196);
/* BTS_Tests_SMSCB.ttcn, line 196 */
BTS__Tests::test__CT_component_RSL__CCHAN.send(IPA__Emulation::ts__ASP__RSL__UD(RSL__Types::RSL__Message_template(rsl), IPA__Emulation::ts__ASP__RSL__UD_sid_defval, IPA__Emulation::ts__ASP__RSL__UD_conn__id_defval), FALSE, NULL);
}
}
}

void start_f__smscb__setup__rsl__chan(const COMPONENT& component_reference, CbchTestParsChan& pars__chan, const BOOLEAN& extd)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_smscb_setup_rsl_chan(");
pars__chan.log();
TTCN_Logger::log_event_str(", ");
extd.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_SMSCB", "f_smscb_setup_rsl_chan", text_buf);
pars__chan.encode_text(text_buf);
extd.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__vty__cbch__setup(const GSM__Types::RslChannelNr& chan__nr)
{
TTCN_Location current_location("BTS_Tests_SMSCB.ttcn", 200, TTCN_Location::LOCATION_FUNCTION, "f_vty_cbch_setup");
current_location.update_lineno(202);
/* BTS_Tests_SMSCB.ttcn, line 202 */
if (GSM__Types::t__RslChanNr__CBCH4(INTEGER_template(0)).match(chan__nr)) {
current_location.update_lineno(203);
/* BTS_Tests_SMSCB.ttcn, line 203 */
{
Osmocom__VTY__Functions::rof__charstring tmp_43;
tmp_43.set_size(4);
tmp_43[0] = cs_0;
tmp_43[1] = cs_1;
tmp_43[2] = cs_2;
tmp_43[3] = cs_3;
Osmocom__VTY__Functions::f__vty__config2(BTS__Tests::test__CT_component_BSCVTY, tmp_43, cs_4);
}
{
current_location.update_lineno(206);
/* BTS_Tests_SMSCB.ttcn, line 206 */
INTEGER tn(1);
current_location.update_lineno(206);
/* BTS_Tests_SMSCB.ttcn, line 206 */
for ( ; ; ) {
current_location.update_lineno(206);
/* BTS_Tests_SMSCB.ttcn, line 206 */
if (!(tn <= 3)) break;
current_location.update_lineno(207);
/* BTS_Tests_SMSCB.ttcn, line 207 */
{
Osmocom__VTY__Functions::rof__charstring tmp_44;
tmp_44.set_size(4);
tmp_44[0] = cs_0;
tmp_44[1] = cs_1;
tmp_44[2] = cs_2;
tmp_44[3] = (cs_5 + int2str(tn));
Osmocom__VTY__Functions::f__vty__config2(BTS__Tests::test__CT_component_BSCVTY, tmp_44, cs_6);
}
current_location.update_lineno(206);
/* BTS_Tests_SMSCB.ttcn, line 206 */
{
INTEGER tmp_45;
++tn;
}
}
}
}
else {
current_location.update_lineno(211);
/* BTS_Tests_SMSCB.ttcn, line 211 */
if (GSM__Types::t__RslChanNr__CBCH8(INTEGER_template(ANY_VALUE)).match(chan__nr)) {
current_location.update_lineno(212);
/* BTS_Tests_SMSCB.ttcn, line 212 */
{
Osmocom__VTY__Functions::rof__charstring tmp_46;
tmp_46.set_size(4);
tmp_46[0] = cs_0;
tmp_46[1] = cs_1;
tmp_46[2] = cs_2;
tmp_46[3] = cs_3;
Osmocom__VTY__Functions::f__vty__config2(BTS__Tests::test__CT_component_BSCVTY, tmp_46, cs_7);
}
current_location.update_lineno(214);
/* BTS_Tests_SMSCB.ttcn, line 214 */
{
Osmocom__VTY__Functions::rof__charstring tmp_47;
tmp_47.set_size(4);
tmp_47[0] = cs_0;
tmp_47[1] = cs_1;
tmp_47[2] = cs_2;
tmp_47[3] = (cs_5 + int2str(const_cast< const GSM__Types::RslChannelNr&>(chan__nr).tn()));
Osmocom__VTY__Functions::f__vty__config2(BTS__Tests::test__CT_component_BSCVTY, tmp_47, cs_8);
}
{
current_location.update_lineno(219);
/* BTS_Tests_SMSCB.ttcn, line 219 */
INTEGER tn(1);
current_location.update_lineno(219);
/* BTS_Tests_SMSCB.ttcn, line 219 */
for ( ; ; ) {
current_location.update_lineno(219);
/* BTS_Tests_SMSCB.ttcn, line 219 */
if (!(tn <= 3)) break;
{
current_location.update_lineno(220);
/* BTS_Tests_SMSCB.ttcn, line 220 */
if ((tn == const_cast< const GSM__Types::RslChannelNr&>(chan__nr).tn())) {
current_location.update_lineno(221);
/* BTS_Tests_SMSCB.ttcn, line 221 */
goto tmp_48;
}
current_location.update_lineno(222);
/* BTS_Tests_SMSCB.ttcn, line 222 */
{
Osmocom__VTY__Functions::rof__charstring tmp_49;
tmp_49.set_size(4);
tmp_49[0] = cs_0;
tmp_49[1] = cs_1;
tmp_49[2] = cs_2;
tmp_49[3] = (cs_5 + int2str(tn));
Osmocom__VTY__Functions::f__vty__config2(BTS__Tests::test__CT_component_BSCVTY, tmp_49, cs_6);
}
}
tmp_48:
current_location.update_lineno(219);
/* BTS_Tests_SMSCB.ttcn, line 219 */
{
INTEGER tmp_50;
++tn;
}
}
}
}
}
current_location.update_lineno(227);
/* BTS_Tests_SMSCB.ttcn, line 227 */
Osmocom__VTY__Functions::f__vty__transceive(BTS__Tests::test__CT_component_BSCVTY, cs_9, Osmocom__VTY__Functions::f__vty__transceive_strict_defval);
current_location.update_lineno(228);
/* BTS_Tests_SMSCB.ttcn, line 228 */
Osmocom__Types::f__sleep(2.0);
}

void start_f__vty__cbch__setup(const COMPONENT& component_reference, const GSM__Types::RslChannelNr& chan__nr)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_vty_cbch_setup(");
chan__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_SMSCB", "f_vty_cbch_setup", text_buf);
chan__nr.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__smscb__setup(CbchTestPars& pars)
{
TTCN_Location current_location("BTS_Tests_SMSCB.ttcn", 230, TTCN_Location::LOCATION_FUNCTION, "f_smscb_setup");
current_location.update_lineno(234);
/* BTS_Tests_SMSCB.ttcn, line 234 */
{
boolean tmp_52;
{
GSM__Types::RslChannelNr_template tmp_51;
tmp_51.set_type(VALUE_LIST, 4);
tmp_51.list_item(0) = GSM__Types::t__RslChanNr__CBCH4(INTEGER_template(0));
tmp_51.list_item(1) = GSM__Types::t__RslChanNr__CBCH8(INTEGER_template(1));
tmp_51.list_item(2) = GSM__Types::t__RslChanNr__CBCH8(INTEGER_template(2));
tmp_51.list_item(3) = GSM__Types::t__RslChanNr__CBCH8(INTEGER_template(3));
tmp_52 = (!(tmp_51.match(const_cast< const CbchTestPars&>(pars).chan__nr())));
}
if (tmp_52) {
current_location.update_lineno(236);
/* BTS_Tests_SMSCB.ttcn, line 236 */
TTCN_Runtime::setverdict(INCONC,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Unhandled channel number: "),const_cast< const CbchTestPars&>(pars).chan__nr().log(),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(237);
/* BTS_Tests_SMSCB.ttcn, line 237 */
TTCN_Runtime::stop_component(MTC_COMPREF);
}
}
current_location.update_lineno(241);
/* BTS_Tests_SMSCB.ttcn, line 241 */
{
boolean tmp_53;
tmp_53 = BTS__Tests::mp__freq__hop__enabled;
if (tmp_53) tmp_53 = (BTS__Tests::mp__transceiver__num > 1);
if (tmp_53) {
current_location.update_lineno(242);
/* BTS_Tests_SMSCB.ttcn, line 242 */
BTS__Tests::f__resolve__fh__params(pars.fhp(), INTEGER(const_cast< const CbchTestPars&>(pars).chan__nr().tn()), BTS__Tests::f__resolve__fh__params_trx__nr_defval);
}
else {
current_location.update_lineno(244);
/* BTS_Tests_SMSCB.ttcn, line 244 */
pars.fhp().enabled() = FALSE;
}
}
current_location.update_lineno(246);
/* BTS_Tests_SMSCB.ttcn, line 246 */
f__cbch__compute__exp__blocks(pars);
current_location.update_lineno(248);
/* BTS_Tests_SMSCB.ttcn, line 248 */
BTS__Tests::f__init__vty__bsc();
current_location.update_lineno(250);
/* BTS_Tests_SMSCB.ttcn, line 250 */
f__vty__cbch__setup(GSM__Types::RslChannelNr(const_cast< const CbchTestPars&>(pars).chan__nr()));
current_location.update_lineno(251);
/* BTS_Tests_SMSCB.ttcn, line 251 */
BTS__Tests::f__init(BTS__Tests::f__init_trx__nr_defval);
current_location.update_lineno(253);
/* BTS_Tests_SMSCB.ttcn, line 253 */
BTS__Tests::f__init__l1ctl();
current_location.update_lineno(256);
/* BTS_Tests_SMSCB.ttcn, line 256 */
if (GSM__Types::t__RslChanNr__CBCH4(INTEGER_template(0)).match(const_cast< const CbchTestPars&>(pars).chan__nr())) {
current_location.update_lineno(257);
/* BTS_Tests_SMSCB.ttcn, line 257 */
BTS__Tests::f__l1__tune(BTS__Tests::test__CT_component_L1CTL, L1CTL__Types::L1ctlCcchMode::CCCH__MODE__COMBINED__CBCH);
}
else {
current_location.update_lineno(259);
/* BTS_Tests_SMSCB.ttcn, line 259 */
BTS__Tests::f__l1__tune(BTS__Tests::test__CT_component_L1CTL, L1CTL__Types::L1ctlCcchMode::CCCH__MODE__COMBINED);
current_location.update_lineno(261);
/* BTS_Tests_SMSCB.ttcn, line 261 */
if (const_cast< const CbchTestPars&>(pars).fhp().enabled()) {
current_location.update_lineno(262);
/* BTS_Tests_SMSCB.ttcn, line 262 */
BTS__Tests::test__CT_component_L1CTL.send(L1CTL__Types::ts__L1CTL__DM__EST__REQ__H1(GSM__Types::RslChannelNr_template(const_cast< const CbchTestPars&>(pars).chan__nr()), INTEGER_template(BTS__Tests::mp__tsc__def), INTEGER_template(const_cast< const CbchTestPars&>(pars).fhp().maio__hsn().hsn()), INTEGER_template(const_cast< const CbchTestPars&>(pars).fhp().maio__hsn().maio()), L1CTL__Types::L1ctlMA_template(const_cast< const CbchTestPars&>(pars).fhp().ma())), FALSE, NULL);
}
else {
current_location.update_lineno(267);
/* BTS_Tests_SMSCB.ttcn, line 267 */
BTS__Tests::test__CT_component_L1CTL.send(L1CTL__Types::ts__L1CTL__DM__EST__REQ__H0(GSM__Types::RslChannelNr_template(const_cast< const CbchTestPars&>(pars).chan__nr()), INTEGER_template(BTS__Tests::mp__tsc__def), INTEGER_template(const_cast< const BTS__Tests::TrxPars&>(BTS__Tests::mp__trx__pars)[0].arfcn())), FALSE, NULL);
}
}
current_location.update_lineno(273);
/* BTS_Tests_SMSCB.ttcn, line 273 */
f__smscb__setup__rsl__chan(pars.basic(), FALSE);
current_location.update_lineno(274);
/* BTS_Tests_SMSCB.ttcn, line 274 */
{
boolean tmp_58;
{
boolean tmp_55 = pars.is_bound();
if(tmp_55) {
const OPTIONAL< CbchTestParsChan >& tmp_56 = pars.extended();
switch (tmp_56.get_selection()) {
case OPTIONAL_UNBOUND:
tmp_55 = FALSE;
break;
case OPTIONAL_OMIT:
tmp_55 = FALSE;
break;
default:
{
const CbchTestParsChan& tmp_57 = (const CbchTestParsChan&) tmp_56;
tmp_55 = tmp_57.is_present();
break;}
}
}
tmp_58 = tmp_55;
}
if (tmp_58) {
current_location.update_lineno(275);
/* BTS_Tests_SMSCB.ttcn, line 275 */
f__smscb__setup__rsl__chan(pars.extended(), TRUE);
}
}
}

void start_f__smscb__setup(const COMPONENT& component_reference, CbchTestPars& pars)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_smscb_setup(");
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_SMSCB", "f_smscb_setup", text_buf);
pars.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

GSM__Types::CBCH__Block_template f__get__block__template(const CbchTestMsg& msg, const INTEGER& block__nr)
{
TTCN_Location current_location("BTS_Tests_SMSCB.ttcn", 280, TTCN_Location::LOCATION_FUNCTION, "f_get_block_template");
current_location.update_lineno(281);
/* BTS_Tests_SMSCB.ttcn, line 281 */
GSM__Types::CBCH__Block_template tr;
current_location.update_lineno(282);
/* BTS_Tests_SMSCB.ttcn, line 282 */
if ((block__nr < const_cast< const CbchTestMsg&>(msg).blocks()().lengthof())) {
current_location.update_lineno(283);
/* BTS_Tests_SMSCB.ttcn, line 283 */
CbchBlock b(const_cast< const CbchTestMsg&>(msg).blocks()()[block__nr]);
current_location.update_lineno(284);
/* BTS_Tests_SMSCB.ttcn, line 284 */
tr = GSM__Types::tr__CBCH__Block(INTEGER_template(const_cast< const CbchBlock&>(b).seq__nr()), BOOLEAN_template(const_cast< const CbchBlock&>(b).is__last()), OCTETSTRING_template(const_cast< const CbchBlock&>(b).payload()));
}
else {
current_location.update_lineno(286);
/* BTS_Tests_SMSCB.ttcn, line 286 */
tr = GSM__Types::tr__CBCH__Block(INTEGER_template(15), BOOLEAN_template(ANY_VALUE), OCTETSTRING_template(ANY_VALUE));
}
current_location.update_lineno(288);
/* BTS_Tests_SMSCB.ttcn, line 288 */
return tr;
}

void f__cbch__match(CbchTestParsChan& pars__chan, const GSM__Types::CBCH__Block& cb, const INTEGER& tb)
{
TTCN_Location current_location("BTS_Tests_SMSCB.ttcn", 292, TTCN_Location::LOCATION_FUNCTION, "f_cbch_match");
current_location.update_lineno(294);
/* BTS_Tests_SMSCB.ttcn, line 294 */
INTEGER block__nr(mod(tb, 4));
current_location.update_lineno(295);
/* BTS_Tests_SMSCB.ttcn, line 295 */
INTEGER i;
current_location.update_lineno(297);
/* BTS_Tests_SMSCB.ttcn, line 297 */
if ((!(GSM__Types::tr__CBCH__Block(GSM__Types::tr__CBCH__Block_seq__nr_defval, GSM__Types::tr__CBCH__Block_last__block_defval, GSM__Types::tr__CBCH__Block_payload_defval).match(cb)))) {
current_location.update_lineno(298);
/* BTS_Tests_SMSCB.ttcn, line 298 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Illegal CBCH Block received: "),cb.log(),TTCN_Logger::end_event_log2str()));
}
else {
current_location.update_lineno(300);
/* BTS_Tests_SMSCB.ttcn, line 300 */
BOOLEAN matched(FALSE);
current_location.update_lineno(302);
/* BTS_Tests_SMSCB.ttcn, line 302 */
i = 0;
current_location.update_lineno(302);
/* BTS_Tests_SMSCB.ttcn, line 302 */
for ( ; ; ) {
current_location.update_lineno(302);
/* BTS_Tests_SMSCB.ttcn, line 302 */
if (!(i < const_cast< const CbchTestParsChan&>(pars__chan).msgs().lengthof())) break;
current_location.update_lineno(303);
/* BTS_Tests_SMSCB.ttcn, line 303 */
if ((block__nr < const_cast< const CbchTestParsChan&>(pars__chan).msgs()[i].blocks()().lengthof())) {
current_location.update_lineno(304);
/* BTS_Tests_SMSCB.ttcn, line 304 */
if (f__get__block__template(const_cast< const CbchTestParsChan&>(pars__chan).msgs()[i], block__nr).match(cb)) {
current_location.update_lineno(305);
/* BTS_Tests_SMSCB.ttcn, line 305 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("Found block_nr ");
block__nr.log();
TTCN_Logger::log_event_str(" of msg ");
i.log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(306);
/* BTS_Tests_SMSCB.ttcn, line 306 */
if ((!(const_cast< const CbchTestParsChan&>(pars__chan).msgs()[i].blocks()()[block__nr].seen__once()))) {
current_location.update_lineno(307);
/* BTS_Tests_SMSCB.ttcn, line 307 */
pars__chan.msgs()[i].blocks()()[block__nr].seen__once() = TRUE;
current_location.update_lineno(308);
/* BTS_Tests_SMSCB.ttcn, line 308 */
TTCN_Runtime::setverdict(PASS);
}
else {
current_location.update_lineno(310);
/* BTS_Tests_SMSCB.ttcn, line 310 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Received SMSCB twice! "),cb.log(),TTCN_Logger::end_event_log2str()));
}
current_location.update_lineno(312);
/* BTS_Tests_SMSCB.ttcn, line 312 */
matched = TRUE;
current_location.update_lineno(313);
/* BTS_Tests_SMSCB.ttcn, line 313 */
break;
}
}
current_location.update_lineno(302);
/* BTS_Tests_SMSCB.ttcn, line 302 */
{
INTEGER tmp_64;
++i;
}
}
current_location.update_lineno(317);
/* BTS_Tests_SMSCB.ttcn, line 317 */
if ((!(matched))) {
current_location.update_lineno(318);
/* BTS_Tests_SMSCB.ttcn, line 318 */
GSM__Types::CBCH__Block_template tr;
current_location.update_lineno(319);
/* BTS_Tests_SMSCB.ttcn, line 319 */
{
boolean tmp_68;
{
boolean tmp_65 = pars__chan.is_bound();
if(tmp_65) {
const OPTIONAL< CbchTestMsg >& tmp_66 = pars__chan.default__msg();
switch (tmp_66.get_selection()) {
case OPTIONAL_UNBOUND:
tmp_65 = FALSE;
break;
case OPTIONAL_OMIT:
tmp_65 = FALSE;
break;
default:
{
const CbchTestMsg& tmp_67 = (const CbchTestMsg&) tmp_66;
tmp_65 = tmp_67.is_present();
break;}
}
}
tmp_68 = tmp_65;
}
if (tmp_68) {
current_location.update_lineno(321);
/* BTS_Tests_SMSCB.ttcn, line 321 */
tr = f__get__block__template(const_cast< const CbchTestParsChan&>(pars__chan).default__msg(), block__nr);
}
else {
current_location.update_lineno(324);
/* BTS_Tests_SMSCB.ttcn, line 324 */
tr = GSM__Types::tr__CBCH__Block(INTEGER_template(15), BOOLEAN_template(ANY_VALUE), OCTETSTRING_template(ANY_VALUE));
}
}
current_location.update_lineno(326);
/* BTS_Tests_SMSCB.ttcn, line 326 */
if ((!(tr.match(cb)))) {
current_location.update_lineno(327);
/* BTS_Tests_SMSCB.ttcn, line 327 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Received unexpected CBCH block: "),cb.log(),TTCN_Logger::end_event_log2str()));
}
else {
current_location.update_lineno(329);
/* BTS_Tests_SMSCB.ttcn, line 329 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("Found block_nr ");
block__nr.log();
TTCN_Logger::log_event_str(" of DEFAULT/NULL");
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(330);
/* BTS_Tests_SMSCB.ttcn, line 330 */
{
boolean tmp_71;
{
boolean tmp_72 = pars__chan.is_bound();
if(tmp_72) {
const OPTIONAL< CbchTestMsg >& tmp_73 = pars__chan.default__msg();
switch (tmp_73.get_selection()) {
case OPTIONAL_UNBOUND:
tmp_72 = FALSE;
break;
case OPTIONAL_OMIT:
tmp_72 = FALSE;
break;
default:
{
const CbchTestMsg& tmp_74 = (const CbchTestMsg&) tmp_73;
tmp_72 = tmp_74.is_present();
break;}
}
}
tmp_71 = tmp_72;
}
if (tmp_71) tmp_71 = (block__nr < const_cast< const CbchTestParsChan&>(pars__chan).default__msg()().blocks()().lengthof());
if (tmp_71) {
current_location.update_lineno(332);
/* BTS_Tests_SMSCB.ttcn, line 332 */
pars__chan.default__msg()().blocks()()[block__nr].seen__once() = TRUE;
}
}
}
}
}
}

void f__cbch__report(const CbchTestParsChan& pars__chan, const CHARSTRING& id)
{
TTCN_Location current_location("BTS_Tests_SMSCB.ttcn", 340, TTCN_Location::LOCATION_FUNCTION, "f_cbch_report");
current_location.update_lineno(342);
/* BTS_Tests_SMSCB.ttcn, line 342 */
INTEGER i;
current_location.update_lineno(342);
/* BTS_Tests_SMSCB.ttcn, line 342 */
INTEGER j;
current_location.update_lineno(345);
/* BTS_Tests_SMSCB.ttcn, line 345 */
i = 0;
current_location.update_lineno(345);
/* BTS_Tests_SMSCB.ttcn, line 345 */
for ( ; ; ) {
current_location.update_lineno(345);
/* BTS_Tests_SMSCB.ttcn, line 345 */
if (!(i < const_cast< const CbchTestParsChan&>(pars__chan).msgs().lengthof())) break;
current_location.update_lineno(346);
/* BTS_Tests_SMSCB.ttcn, line 346 */
j = 0;
current_location.update_lineno(346);
/* BTS_Tests_SMSCB.ttcn, line 346 */
for ( ; ; ) {
current_location.update_lineno(346);
/* BTS_Tests_SMSCB.ttcn, line 346 */
if (!(j < const_cast< const CbchTestParsChan&>(pars__chan).msgs()[i].blocks()().lengthof())) break;
current_location.update_lineno(347);
/* BTS_Tests_SMSCB.ttcn, line 347 */
CbchBlock b(const_cast< const CbchTestParsChan&>(pars__chan).msgs()[i].blocks()()[j]);
current_location.update_lineno(348);
/* BTS_Tests_SMSCB.ttcn, line 348 */
if ((!(const_cast< const CbchBlock&>(b).seen__once()))) {
current_location.update_lineno(349);
/* BTS_Tests_SMSCB.ttcn, line 349 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Timeout waiting for "),id.log(),TTCN_Logger::log_event_str(" CBCH block "),j.log(),TTCN_Logger::log_event_str(" of msg "),i.log(),TTCN_Logger::end_event_log2str()));
}
current_location.update_lineno(346);
/* BTS_Tests_SMSCB.ttcn, line 346 */
{
INTEGER tmp_78;
++j;
}
}
current_location.update_lineno(345);
/* BTS_Tests_SMSCB.ttcn, line 345 */
{
INTEGER tmp_79;
++i;
}
}
current_location.update_lineno(354);
/* BTS_Tests_SMSCB.ttcn, line 354 */
{
boolean tmp_83;
{
boolean tmp_80 = pars__chan.is_bound();
if(tmp_80) {
const OPTIONAL< CbchTestMsg >& tmp_81 = pars__chan.default__msg();
switch (tmp_81.get_selection()) {
case OPTIONAL_UNBOUND:
tmp_80 = FALSE;
break;
case OPTIONAL_OMIT:
tmp_80 = FALSE;
break;
default:
{
const CbchTestMsg& tmp_82 = (const CbchTestMsg&) tmp_81;
tmp_80 = tmp_82.is_present();
break;}
}
}
tmp_83 = tmp_80;
}
if (tmp_83) {
current_location.update_lineno(356);
/* BTS_Tests_SMSCB.ttcn, line 356 */
j = 0;
current_location.update_lineno(356);
/* BTS_Tests_SMSCB.ttcn, line 356 */
for ( ; ; ) {
current_location.update_lineno(356);
/* BTS_Tests_SMSCB.ttcn, line 356 */
if (!(j < const_cast< const CbchTestParsChan&>(pars__chan).default__msg()().blocks()().lengthof())) break;
current_location.update_lineno(357);
/* BTS_Tests_SMSCB.ttcn, line 357 */
CbchBlock b(const_cast< const CbchTestParsChan&>(pars__chan).default__msg()().blocks()()[j]);
current_location.update_lineno(358);
/* BTS_Tests_SMSCB.ttcn, line 358 */
if ((!(const_cast< const CbchBlock&>(b).seen__once()))) {
current_location.update_lineno(359);
/* BTS_Tests_SMSCB.ttcn, line 359 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Timeout waiting for at leaset one instance of CBCH block "),j.log(),TTCN_Logger::log_event_str(" of DEFAULT msg"),TTCN_Logger::end_event_log2str()));
}
current_location.update_lineno(356);
/* BTS_Tests_SMSCB.ttcn, line 356 */
{
INTEGER tmp_85;
++j;
}
}
}
}
}

void f__TC__smscb(const CbchTestPars& pars)
{
CbchTestPars pars_shadow(pars);
TTCN_Location current_location("BTS_Tests_SMSCB.ttcn", 367, TTCN_Location::LOCATION_FUNCTION, "f_TC_smscb");
current_location.update_lineno(368);
/* BTS_Tests_SMSCB.ttcn, line 368 */
L1CTL__Types::L1ctlMessage dl;
current_location.update_lineno(369);
/* BTS_Tests_SMSCB.ttcn, line 369 */
INTEGER msg__count;
current_location.update_lineno(370);
/* BTS_Tests_SMSCB.ttcn, line 370 */
TIMER T("T");
current_location.update_lineno(372);
/* BTS_Tests_SMSCB.ttcn, line 372 */
msg__count = const_cast< const CbchTestPars&>(pars_shadow).basic().msgs().lengthof();
current_location.update_lineno(373);
/* BTS_Tests_SMSCB.ttcn, line 373 */
{
boolean tmp_92;
{
boolean tmp_87 = pars_shadow.is_bound();
if(tmp_87) {
const CbchTestPars& tmp_88 = pars_shadow;
const CbchTestParsChan& tmp_89 = tmp_88.basic();
tmp_87 = tmp_89.is_bound();
if(tmp_87) {
const OPTIONAL< CbchTestMsg >& tmp_90 = tmp_89.default__msg();
switch (tmp_90.get_selection()) {
case OPTIONAL_UNBOUND:
tmp_87 = FALSE;
break;
case OPTIONAL_OMIT:
tmp_87 = FALSE;
break;
default:
{
const CbchTestMsg& tmp_91 = (const CbchTestMsg&) tmp_90;
tmp_87 = tmp_91.is_present();
break;}
}
}
}
tmp_92 = tmp_87;
}
if (tmp_92) {
current_location.update_lineno(374);
/* BTS_Tests_SMSCB.ttcn, line 374 */
{
INTEGER tmp_93;
++msg__count;
}
}
}
current_location.update_lineno(376);
/* BTS_Tests_SMSCB.ttcn, line 376 */
{
boolean tmp_97;
{
boolean tmp_94 = pars_shadow.is_bound();
if(tmp_94) {
const OPTIONAL< CbchTestParsChan >& tmp_95 = pars_shadow.extended();
switch (tmp_95.get_selection()) {
case OPTIONAL_UNBOUND:
tmp_94 = FALSE;
break;
case OPTIONAL_OMIT:
tmp_94 = FALSE;
break;
default:
{
const CbchTestParsChan& tmp_96 = (const CbchTestParsChan&) tmp_95;
tmp_94 = tmp_96.is_present();
break;}
}
}
tmp_97 = tmp_94;
}
if (tmp_97) {
current_location.update_lineno(377);
/* BTS_Tests_SMSCB.ttcn, line 377 */
{
INTEGER tmp_98;
tmp_98 = (msg__count + const_cast< const CbchTestPars&>(pars_shadow).extended()().msgs().lengthof());
msg__count = tmp_98;
}
current_location.update_lineno(378);
/* BTS_Tests_SMSCB.ttcn, line 378 */
{
boolean tmp_104;
{
boolean tmp_99 = pars_shadow.is_bound();
if(tmp_99) {
const OPTIONAL< CbchTestParsChan >& tmp_100 = pars_shadow.extended();
switch (tmp_100.get_selection()) {
case OPTIONAL_UNBOUND:
case OPTIONAL_OMIT:
tmp_99 = FALSE;
break;
default:
break;
}
if(tmp_99) {
const CbchTestParsChan& tmp_101 = (const CbchTestParsChan&) tmp_100;
tmp_99 = tmp_101.is_bound();
if(tmp_99) {
const OPTIONAL< CbchTestMsg >& tmp_102 = tmp_101.default__msg();
switch (tmp_102.get_selection()) {
case OPTIONAL_UNBOUND:
tmp_99 = FALSE;
break;
case OPTIONAL_OMIT:
tmp_99 = FALSE;
break;
default:
{
const CbchTestMsg& tmp_103 = (const CbchTestMsg&) tmp_102;
tmp_99 = tmp_103.is_present();
break;}
}
}
}
}
tmp_104 = tmp_99;
}
if (tmp_104) {
current_location.update_lineno(379);
/* BTS_Tests_SMSCB.ttcn, line 379 */
{
INTEGER tmp_105;
++msg__count;
}
}
}
}
}
current_location.update_lineno(383);
/* BTS_Tests_SMSCB.ttcn, line 383 */
f__smscb__setup(pars_shadow);
current_location.update_lineno(386);
/* BTS_Tests_SMSCB.ttcn, line 386 */
T.start((5.0 + (3.0 * int2float(msg__count))));
current_location.update_lineno(388);
/* BTS_Tests_SMSCB.ttcn, line 388 */
{
tmp_106:
alt_status tmp_106_alt_flag_0 = ALT_MAYBE;
alt_status tmp_106_alt_flag_1 = ALT_MAYBE;
alt_status tmp_106_alt_flag_2 = ALT_MAYBE;
alt_status tmp_106_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_106_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(389);
/* BTS_Tests_SMSCB.ttcn, line 389 */
tmp_106_alt_flag_0 = BTS__Tests::test__CT_component_L1CTL.receive(L1CTL__Types::tr__L1CTL__DATA__IND(GSM__Types::RslChannelNr_template(const_cast< const CbchTestPars&>(pars_shadow).chan__nr()), L1CTL__Types::tr__L1CTL__DATA__IND_link__id_defval, 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_106_alt_flag_0 == ALT_YES) {
current_location.update_lineno(390);
/* BTS_Tests_SMSCB.ttcn, line 390 */
INTEGER tb(f__cbch__fn2tb(const_cast< const L1CTL__Types::L1ctlMessage&>(dl).dl__info()().frame__nr()));
current_location.update_lineno(391);
/* BTS_Tests_SMSCB.ttcn, line 391 */
GSM__Types::CBCH__Block cb(GSM__Types::dec__CBCH__Block(const_cast< const L1CTL__Types::L1ctlMessage&>(dl).payload()().data__ind().payload()));
current_location.update_lineno(392);
/* BTS_Tests_SMSCB.ttcn, line 392 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("Tb=");
tb.log();
TTCN_Logger::log_event_str(", CBCH: ");
dl.log();
TTCN_Logger::log_event_str(", block: ");
cb.log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(395);
/* BTS_Tests_SMSCB.ttcn, line 395 */
f__cbch__fn__verify(const_cast< const L1CTL__Types::L1ctlMessage&>(dl).dl__info()().frame__nr(), cb);
current_location.update_lineno(397);
/* BTS_Tests_SMSCB.ttcn, line 397 */
if ((tb < 4)) {
current_location.update_lineno(398);
/* BTS_Tests_SMSCB.ttcn, line 398 */
f__cbch__match(pars_shadow.basic(), cb, tb);
}
else {
current_location.update_lineno(400);
/* BTS_Tests_SMSCB.ttcn, line 400 */
{
boolean tmp_110;
{
boolean tmp_107 = pars_shadow.is_bound();
if(tmp_107) {
const OPTIONAL< CbchTestParsChan >& tmp_108 = pars_shadow.extended();
switch (tmp_108.get_selection()) {
case OPTIONAL_UNBOUND:
tmp_107 = FALSE;
break;
case OPTIONAL_OMIT:
tmp_107 = FALSE;
break;
default:
{
const CbchTestParsChan& tmp_109 = (const CbchTestParsChan&) tmp_108;
tmp_107 = tmp_109.is_present();
break;}
}
}
tmp_110 = (!(tmp_107));
}
if (tmp_110) {
current_location.update_lineno(402);
/* BTS_Tests_SMSCB.ttcn, line 402 */
goto tmp_106;
}
}
current_location.update_lineno(404);
/* BTS_Tests_SMSCB.ttcn, line 404 */
f__cbch__match(pars_shadow.extended(), cb, tb);
}
current_location.update_lineno(406);
/* BTS_Tests_SMSCB.ttcn, line 406 */
goto tmp_106;
}
}
if (tmp_106_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(408);
/* BTS_Tests_SMSCB.ttcn, line 408 */
tmp_106_alt_flag_1 = BTS__Tests::test__CT_component_L1CTL.receive(any_compref, NULL, NULL, NULL);
if (tmp_106_alt_flag_1 == ALT_YES) {
current_location.update_lineno(408);
/* BTS_Tests_SMSCB.ttcn, line 408 */
goto tmp_106;
}
}
if (tmp_106_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(409);
/* BTS_Tests_SMSCB.ttcn, line 409 */
tmp_106_alt_flag_2 = T.timeout(NULL);
if (tmp_106_alt_flag_2 == ALT_YES) {
current_location.update_lineno(410);
/* BTS_Tests_SMSCB.ttcn, line 410 */
f__cbch__report(const_cast< const CbchTestPars&>(pars_shadow).basic(), cs_10);
current_location.update_lineno(411);
/* BTS_Tests_SMSCB.ttcn, line 411 */
{
boolean tmp_114;
{
boolean tmp_111 = pars_shadow.is_bound();
if(tmp_111) {
const OPTIONAL< CbchTestParsChan >& tmp_112 = pars_shadow.extended();
switch (tmp_112.get_selection()) {
case OPTIONAL_UNBOUND:
tmp_111 = FALSE;
break;
case OPTIONAL_OMIT:
tmp_111 = FALSE;
break;
default:
{
const CbchTestParsChan& tmp_113 = (const CbchTestParsChan&) tmp_112;
tmp_111 = tmp_113.is_present();
break;}
}
}
tmp_114 = tmp_111;
}
if (tmp_114) {
current_location.update_lineno(412);
/* BTS_Tests_SMSCB.ttcn, line 412 */
f__cbch__report(const_cast< const CbchTestPars&>(pars_shadow).extended(), cs_11);
}
}
break;
}
}
if (tmp_106_default_flag == ALT_MAYBE) {
tmp_106_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_106_default_flag == ALT_YES || tmp_106_default_flag == ALT_BREAK) break;
else if (tmp_106_default_flag == ALT_REPEAT) goto tmp_106;
}
current_location.update_lineno(388);
/* BTS_Tests_SMSCB.ttcn, line 388 */
if (tmp_106_alt_flag_0 == ALT_NO && tmp_106_alt_flag_1 == ALT_NO && tmp_106_alt_flag_2 == ALT_NO && tmp_106_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file BTS_Tests_SMSCB.ttcn between lines 388 and 415.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(417);
/* BTS_Tests_SMSCB.ttcn, line 417 */
Misc__Helpers::f__shutdown(cs_12, 417, PASS, Misc__Helpers::f__shutdown_text_defval);
}

void start_f__TC__smscb(const COMPONENT& component_reference, const CbchTestPars& pars)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_TC_smscb(");
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_SMSCB", "f_TC_smscb", text_buf);
pars.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

void f__TC__smscb__default__only(const CbchTestPars& pars)
{
CbchTestPars pars_shadow(pars);
TTCN_Location current_location("BTS_Tests_SMSCB.ttcn", 420, TTCN_Location::LOCATION_FUNCTION, "f_TC_smscb_default_only");
current_location.update_lineno(421);
/* BTS_Tests_SMSCB.ttcn, line 421 */
L1CTL__Types::L1ctlMessage dl;
current_location.update_lineno(422);
/* BTS_Tests_SMSCB.ttcn, line 422 */
TIMER T("T", 5.0);
current_location.update_lineno(424);
/* BTS_Tests_SMSCB.ttcn, line 424 */
f__smscb__setup(pars_shadow);
current_location.update_lineno(427);
/* BTS_Tests_SMSCB.ttcn, line 427 */
Osmocom__Types::f__sleep(5.0);
current_location.update_lineno(428);
/* BTS_Tests_SMSCB.ttcn, line 428 */
BTS__Tests::test__CT_component_L1CTL.clear();
current_location.update_lineno(430);
/* BTS_Tests_SMSCB.ttcn, line 430 */
T.start();
current_location.update_lineno(431);
/* BTS_Tests_SMSCB.ttcn, line 431 */
{
tmp_115:
alt_status tmp_115_alt_flag_0 = ALT_MAYBE;
alt_status tmp_115_alt_flag_1 = ALT_MAYBE;
alt_status tmp_115_alt_flag_2 = ALT_MAYBE;
alt_status tmp_115_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_115_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(432);
/* BTS_Tests_SMSCB.ttcn, line 432 */
tmp_115_alt_flag_0 = BTS__Tests::test__CT_component_L1CTL.receive(L1CTL__Types::tr__L1CTL__DATA__IND(GSM__Types::RslChannelNr_template(const_cast< const CbchTestPars&>(pars_shadow).chan__nr()), L1CTL__Types::tr__L1CTL__DATA__IND_link__id_defval, 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_115_alt_flag_0 == ALT_YES) {
current_location.update_lineno(433);
/* BTS_Tests_SMSCB.ttcn, line 433 */
INTEGER tb(f__cbch__fn2tb(const_cast< const L1CTL__Types::L1ctlMessage&>(dl).dl__info()().frame__nr()));
current_location.update_lineno(434);
/* BTS_Tests_SMSCB.ttcn, line 434 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("CBCH: ");
dl.log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(435);
/* BTS_Tests_SMSCB.ttcn, line 435 */
GSM__Types::CBCH__Block cb(GSM__Types::dec__CBCH__Block(const_cast< const L1CTL__Types::L1ctlMessage&>(dl).payload()().data__ind().payload()));
current_location.update_lineno(437);
/* BTS_Tests_SMSCB.ttcn, line 437 */
f__cbch__fn__verify(const_cast< const L1CTL__Types::L1ctlMessage&>(dl).dl__info()().frame__nr(), cb);
current_location.update_lineno(438);
/* BTS_Tests_SMSCB.ttcn, line 438 */
if ((tb >= 4)) {
current_location.update_lineno(440);
/* BTS_Tests_SMSCB.ttcn, line 440 */
goto tmp_115;
}
current_location.update_lineno(442);
/* BTS_Tests_SMSCB.ttcn, line 442 */
if ((!(GSM__Types::tr__CBCH__Block(GSM__Types::tr__CBCH__Block_seq__nr_defval, GSM__Types::tr__CBCH__Block_last__block_defval, GSM__Types::tr__CBCH__Block_payload_defval).match(cb)))) {
current_location.update_lineno(443);
/* BTS_Tests_SMSCB.ttcn, line 443 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Illegal CBCH Block received: "),cb.log(),TTCN_Logger::end_event_log2str()));
}
else {
current_location.update_lineno(445);
/* BTS_Tests_SMSCB.ttcn, line 445 */
INTEGER rx__seq__nr(const_cast< const GSM__Types::CBCH__Block&>(cb).block__type().seq__nr());
current_location.update_lineno(446);
/* BTS_Tests_SMSCB.ttcn, line 446 */
GSM__Types::CBCH__Block_template tr;
current_location.update_lineno(447);
/* BTS_Tests_SMSCB.ttcn, line 447 */
if ((rx__seq__nr < const_cast< const CbchTestPars&>(pars_shadow).basic().msgs()[0].blocks()().lengthof())) {
current_location.update_lineno(448);
/* BTS_Tests_SMSCB.ttcn, line 448 */
CbchBlock b(const_cast< const CbchTestPars&>(pars_shadow).basic().msgs()[0].blocks()()[rx__seq__nr]);
current_location.update_lineno(449);
/* BTS_Tests_SMSCB.ttcn, line 449 */
tr = GSM__Types::tr__CBCH__Block(INTEGER_template(const_cast< const CbchBlock&>(b).seq__nr()), BOOLEAN_template(const_cast< const CbchBlock&>(b).is__last()), OCTETSTRING_template(const_cast< const CbchBlock&>(b).payload()));
}
else {
current_location.update_lineno(451);
/* BTS_Tests_SMSCB.ttcn, line 451 */
tr = GSM__Types::tr__CBCH__Block(INTEGER_template(15), BOOLEAN_template(ANY_VALUE), OCTETSTRING_template(ANY_VALUE));
}
current_location.update_lineno(453);
/* BTS_Tests_SMSCB.ttcn, line 453 */
if (tr.match(cb)) {
current_location.update_lineno(454);
/* BTS_Tests_SMSCB.ttcn, line 454 */
TTCN_Runtime::setverdict(PASS);
current_location.update_lineno(455);
/* BTS_Tests_SMSCB.ttcn, line 455 */
goto tmp_115;
}
else {
current_location.update_lineno(457);
/* BTS_Tests_SMSCB.ttcn, line 457 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Unexpected CBCH block "),cb.log(),TTCN_Logger::log_event_str(", expected "),tr.log(),TTCN_Logger::end_event_log2str()));
}
}
break;
}
}
if (tmp_115_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(461);
/* BTS_Tests_SMSCB.ttcn, line 461 */
tmp_115_alt_flag_1 = BTS__Tests::test__CT_component_L1CTL.receive(any_compref, NULL, NULL, NULL);
if (tmp_115_alt_flag_1 == ALT_YES) {
current_location.update_lineno(461);
/* BTS_Tests_SMSCB.ttcn, line 461 */
goto tmp_115;
}
}
if (tmp_115_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(462);
/* BTS_Tests_SMSCB.ttcn, line 462 */
tmp_115_alt_flag_2 = T.timeout(NULL);
if (tmp_115_alt_flag_2 == ALT_YES) break;
}
if (tmp_115_default_flag == ALT_MAYBE) {
tmp_115_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_115_default_flag == ALT_YES || tmp_115_default_flag == ALT_BREAK) break;
else if (tmp_115_default_flag == ALT_REPEAT) goto tmp_115;
}
current_location.update_lineno(431);
/* BTS_Tests_SMSCB.ttcn, line 431 */
if (tmp_115_alt_flag_0 == ALT_NO && tmp_115_alt_flag_1 == ALT_NO && tmp_115_alt_flag_2 == ALT_NO && tmp_115_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file BTS_Tests_SMSCB.ttcn between lines 431 and 463.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
}

void start_f__TC__smscb__default__only(const COMPONENT& component_reference, const CbchTestPars& pars)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_TC_smscb_default_only(");
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_SMSCB", "f_TC_smscb_default_only", text_buf);
pars.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

verdicttype testcase_TC__sms__cb__cmd__sdcch4__1block(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests_SMSCB.ttcn", 531, TTCN_Location::LOCATION_TESTCASE, "TC_sms_cb_cmd_sdcch4_1block");
try {
TTCN_Runtime::begin_testcase("BTS_Tests_SMSCB", "TC_sms_cb_cmd_sdcch4_1block", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(532);
/* BTS_Tests_SMSCB.ttcn, line 532 */
CbchTestPars pars;
pars.chan__nr() = GSM__Types::ts__RslChanNr__CBCH4(0).valueof();
pars.basic() = t__CbchPC(CbchTestMsgs_template(msgs__1m__1b__norm), t__CbchPC_def_defval).valueof();
pars.extended() = OMIT_VALUE;
current_location.update_lineno(537);
/* BTS_Tests_SMSCB.ttcn, line 537 */
f__TC__smscb(pars);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_sms_cb_cmd_sdcch4_1block was stopped.");
}
return TTCN_Runtime::end_testcase();
}

verdicttype testcase_TC__sms__cb__cmd__sdcch8__1block(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests_SMSCB.ttcn", 539, TTCN_Location::LOCATION_TESTCASE, "TC_sms_cb_cmd_sdcch8_1block");
try {
TTCN_Runtime::begin_testcase("BTS_Tests_SMSCB", "TC_sms_cb_cmd_sdcch8_1block", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(540);
/* BTS_Tests_SMSCB.ttcn, line 540 */
CbchTestPars pars;
pars.chan__nr() = GSM__Types::ts__RslChanNr__CBCH8(2).valueof();
pars.basic() = t__CbchPC(CbchTestMsgs_template(msgs__1m__1b__norm), t__CbchPC_def_defval).valueof();
pars.extended() = OMIT_VALUE;
current_location.update_lineno(545);
/* BTS_Tests_SMSCB.ttcn, line 545 */
f__TC__smscb(pars);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_sms_cb_cmd_sdcch8_1block was stopped.");
}
return TTCN_Runtime::end_testcase();
}

verdicttype testcase_TC__sms__cb__cmd__sdcch4__2block(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests_SMSCB.ttcn", 549, TTCN_Location::LOCATION_TESTCASE, "TC_sms_cb_cmd_sdcch4_2block");
try {
TTCN_Runtime::begin_testcase("BTS_Tests_SMSCB", "TC_sms_cb_cmd_sdcch4_2block", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(550);
/* BTS_Tests_SMSCB.ttcn, line 550 */
CbchTestPars pars;
pars.chan__nr() = GSM__Types::ts__RslChanNr__CBCH4(0).valueof();
pars.basic() = t__CbchPC(CbchTestMsgs_template(msgs__1m__2b__norm), t__CbchPC_def_defval).valueof();
pars.extended() = OMIT_VALUE;
current_location.update_lineno(555);
/* BTS_Tests_SMSCB.ttcn, line 555 */
f__TC__smscb(pars);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_sms_cb_cmd_sdcch4_2block was stopped.");
}
return TTCN_Runtime::end_testcase();
}

verdicttype testcase_TC__sms__cb__cmd__sdcch8__2block(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests_SMSCB.ttcn", 557, TTCN_Location::LOCATION_TESTCASE, "TC_sms_cb_cmd_sdcch8_2block");
try {
TTCN_Runtime::begin_testcase("BTS_Tests_SMSCB", "TC_sms_cb_cmd_sdcch8_2block", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(558);
/* BTS_Tests_SMSCB.ttcn, line 558 */
CbchTestPars pars;
pars.chan__nr() = GSM__Types::ts__RslChanNr__CBCH8(2).valueof();
pars.basic() = t__CbchPC(CbchTestMsgs_template(msgs__1m__2b__norm), t__CbchPC_def_defval).valueof();
pars.extended() = OMIT_VALUE;
current_location.update_lineno(563);
/* BTS_Tests_SMSCB.ttcn, line 563 */
f__TC__smscb(pars);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_sms_cb_cmd_sdcch8_2block was stopped.");
}
return TTCN_Runtime::end_testcase();
}

verdicttype testcase_TC__sms__cb__cmd__sdcch4__3block(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests_SMSCB.ttcn", 567, TTCN_Location::LOCATION_TESTCASE, "TC_sms_cb_cmd_sdcch4_3block");
try {
TTCN_Runtime::begin_testcase("BTS_Tests_SMSCB", "TC_sms_cb_cmd_sdcch4_3block", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(568);
/* BTS_Tests_SMSCB.ttcn, line 568 */
CbchTestPars pars;
pars.chan__nr() = GSM__Types::ts__RslChanNr__CBCH4(0).valueof();
pars.basic() = t__CbchPC(CbchTestMsgs_template(msgs__1m__3b__norm), t__CbchPC_def_defval).valueof();
pars.extended() = OMIT_VALUE;
current_location.update_lineno(573);
/* BTS_Tests_SMSCB.ttcn, line 573 */
f__TC__smscb(pars);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_sms_cb_cmd_sdcch4_3block was stopped.");
}
return TTCN_Runtime::end_testcase();
}

verdicttype testcase_TC__sms__cb__cmd__sdcch8__3block(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests_SMSCB.ttcn", 575, TTCN_Location::LOCATION_TESTCASE, "TC_sms_cb_cmd_sdcch8_3block");
try {
TTCN_Runtime::begin_testcase("BTS_Tests_SMSCB", "TC_sms_cb_cmd_sdcch8_3block", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(576);
/* BTS_Tests_SMSCB.ttcn, line 576 */
CbchTestPars pars;
pars.chan__nr() = GSM__Types::ts__RslChanNr__CBCH8(2).valueof();
pars.basic() = t__CbchPC(CbchTestMsgs_template(msgs__1m__3b__norm), t__CbchPC_def_defval).valueof();
pars.extended() = OMIT_VALUE;
current_location.update_lineno(581);
/* BTS_Tests_SMSCB.ttcn, line 581 */
f__TC__smscb(pars);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_sms_cb_cmd_sdcch8_3block was stopped.");
}
return TTCN_Runtime::end_testcase();
}

verdicttype testcase_TC__sms__cb__cmd__sdcch4__4block(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests_SMSCB.ttcn", 585, TTCN_Location::LOCATION_TESTCASE, "TC_sms_cb_cmd_sdcch4_4block");
try {
TTCN_Runtime::begin_testcase("BTS_Tests_SMSCB", "TC_sms_cb_cmd_sdcch4_4block", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(586);
/* BTS_Tests_SMSCB.ttcn, line 586 */
CbchTestPars pars;
pars.chan__nr() = GSM__Types::ts__RslChanNr__CBCH4(0).valueof();
pars.basic() = t__CbchPC(CbchTestMsgs_template(msgs__1m__4b__norm), t__CbchPC_def_defval).valueof();
pars.extended() = OMIT_VALUE;
current_location.update_lineno(591);
/* BTS_Tests_SMSCB.ttcn, line 591 */
f__TC__smscb(pars);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_sms_cb_cmd_sdcch4_4block was stopped.");
}
return TTCN_Runtime::end_testcase();
}

verdicttype testcase_TC__sms__cb__cmd__sdcch8__4block(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests_SMSCB.ttcn", 593, TTCN_Location::LOCATION_TESTCASE, "TC_sms_cb_cmd_sdcch8_4block");
try {
TTCN_Runtime::begin_testcase("BTS_Tests_SMSCB", "TC_sms_cb_cmd_sdcch8_4block", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(594);
/* BTS_Tests_SMSCB.ttcn, line 594 */
CbchTestPars pars;
pars.chan__nr() = GSM__Types::ts__RslChanNr__CBCH8(2).valueof();
pars.basic() = t__CbchPC(CbchTestMsgs_template(msgs__1m__4b__norm), t__CbchPC_def_defval).valueof();
pars.extended() = OMIT_VALUE;
current_location.update_lineno(599);
/* BTS_Tests_SMSCB.ttcn, line 599 */
f__TC__smscb(pars);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_sms_cb_cmd_sdcch8_4block was stopped.");
}
return TTCN_Runtime::end_testcase();
}

verdicttype testcase_TC__sms__cb__cmd__sdcch4__multi(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests_SMSCB.ttcn", 603, TTCN_Location::LOCATION_TESTCASE, "TC_sms_cb_cmd_sdcch4_multi");
try {
TTCN_Runtime::begin_testcase("BTS_Tests_SMSCB", "TC_sms_cb_cmd_sdcch4_multi", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(604);
/* BTS_Tests_SMSCB.ttcn, line 604 */
CbchTestPars pars;
pars.chan__nr() = GSM__Types::ts__RslChanNr__CBCH4(0).valueof();
pars.basic() = t__CbchPC(CbchTestMsgs_template(msgs__3m__4b__norm), t__CbchPC_def_defval).valueof();
pars.extended() = OMIT_VALUE;
current_location.update_lineno(609);
/* BTS_Tests_SMSCB.ttcn, line 609 */
f__TC__smscb(pars);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_sms_cb_cmd_sdcch4_multi was stopped.");
}
return TTCN_Runtime::end_testcase();
}

verdicttype testcase_TC__sms__cb__cmd__sdcch8__multi(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests_SMSCB.ttcn", 611, TTCN_Location::LOCATION_TESTCASE, "TC_sms_cb_cmd_sdcch8_multi");
try {
TTCN_Runtime::begin_testcase("BTS_Tests_SMSCB", "TC_sms_cb_cmd_sdcch8_multi", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(612);
/* BTS_Tests_SMSCB.ttcn, line 612 */
CbchTestPars pars;
pars.chan__nr() = GSM__Types::ts__RslChanNr__CBCH8(2).valueof();
pars.basic() = t__CbchPC(CbchTestMsgs_template(msgs__3m__4b__norm), t__CbchPC_def_defval).valueof();
pars.extended() = OMIT_VALUE;
current_location.update_lineno(617);
/* BTS_Tests_SMSCB.ttcn, line 617 */
f__TC__smscb(pars);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_sms_cb_cmd_sdcch8_multi was stopped.");
}
return TTCN_Runtime::end_testcase();
}

verdicttype testcase_TC__sms__cb__cmd__sdcch4__extd__multi(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests_SMSCB.ttcn", 621, TTCN_Location::LOCATION_TESTCASE, "TC_sms_cb_cmd_sdcch4_extd_multi");
try {
TTCN_Runtime::begin_testcase("BTS_Tests_SMSCB", "TC_sms_cb_cmd_sdcch4_extd_multi", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(622);
/* BTS_Tests_SMSCB.ttcn, line 622 */
CbchTestPars pars;
pars.chan__nr() = GSM__Types::ts__RslChanNr__CBCH4(0).valueof();
pars.basic() = t__CbchPC(CbchTestMsgs_template(NULL_VALUE), t__CbchPC_def_defval).valueof();
pars.extended() = t__CbchPC(CbchTestMsgs_template(msgs__3m__4b__norm), t__CbchPC_def_defval).valueof();
current_location.update_lineno(627);
/* BTS_Tests_SMSCB.ttcn, line 627 */
f__TC__smscb(pars);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_sms_cb_cmd_sdcch4_extd_multi was stopped.");
}
return TTCN_Runtime::end_testcase();
}

verdicttype testcase_TC__sms__cb__cmd__sdcch8__extd__multi(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests_SMSCB.ttcn", 629, TTCN_Location::LOCATION_TESTCASE, "TC_sms_cb_cmd_sdcch8_extd_multi");
try {
TTCN_Runtime::begin_testcase("BTS_Tests_SMSCB", "TC_sms_cb_cmd_sdcch8_extd_multi", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(630);
/* BTS_Tests_SMSCB.ttcn, line 630 */
CbchTestPars pars;
pars.chan__nr() = GSM__Types::ts__RslChanNr__CBCH8(2).valueof();
pars.basic() = t__CbchPC(CbchTestMsgs_template(NULL_VALUE), t__CbchPC_def_defval).valueof();
pars.extended() = t__CbchPC(CbchTestMsgs_template(msgs__3m__4b__norm), t__CbchPC_def_defval).valueof();
current_location.update_lineno(635);
/* BTS_Tests_SMSCB.ttcn, line 635 */
f__TC__smscb(pars);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_sms_cb_cmd_sdcch8_extd_multi was stopped.");
}
return TTCN_Runtime::end_testcase();
}

verdicttype testcase_TC__sms__cb__cmd__sdcch4__schedule(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests_SMSCB.ttcn", 639, TTCN_Location::LOCATION_TESTCASE, "TC_sms_cb_cmd_sdcch4_schedule");
try {
TTCN_Runtime::begin_testcase("BTS_Tests_SMSCB", "TC_sms_cb_cmd_sdcch4_schedule", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(640);
/* BTS_Tests_SMSCB.ttcn, line 640 */
CbchTestPars pars;
pars.chan__nr() = GSM__Types::ts__RslChanNr__CBCH4(0).valueof();
pars.basic() = t__CbchPC(CbchTestMsgs_template(msgs__1m__4b__sched), t__CbchPC_def_defval).valueof();
pars.extended() = OMIT_VALUE;
current_location.update_lineno(645);
/* BTS_Tests_SMSCB.ttcn, line 645 */
f__TC__smscb(pars);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_sms_cb_cmd_sdcch4_schedule was stopped.");
}
return TTCN_Runtime::end_testcase();
}

verdicttype testcase_TC__sms__cb__cmd__sdcch8__schedule(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests_SMSCB.ttcn", 647, TTCN_Location::LOCATION_TESTCASE, "TC_sms_cb_cmd_sdcch8_schedule");
try {
TTCN_Runtime::begin_testcase("BTS_Tests_SMSCB", "TC_sms_cb_cmd_sdcch8_schedule", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(648);
/* BTS_Tests_SMSCB.ttcn, line 648 */
CbchTestPars pars;
pars.chan__nr() = GSM__Types::ts__RslChanNr__CBCH8(2).valueof();
pars.basic() = t__CbchPC(CbchTestMsgs_template(msgs__1m__4b__sched), t__CbchPC_def_defval).valueof();
pars.extended() = OMIT_VALUE;
current_location.update_lineno(653);
/* BTS_Tests_SMSCB.ttcn, line 653 */
f__TC__smscb(pars);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_sms_cb_cmd_sdcch8_schedule was stopped.");
}
return TTCN_Runtime::end_testcase();
}

verdicttype testcase_TC__sms__cb__cmd__sdcch4__default__only(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests_SMSCB.ttcn", 657, TTCN_Location::LOCATION_TESTCASE, "TC_sms_cb_cmd_sdcch4_default_only");
try {
TTCN_Runtime::begin_testcase("BTS_Tests_SMSCB", "TC_sms_cb_cmd_sdcch4_default_only", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(658);
/* BTS_Tests_SMSCB.ttcn, line 658 */
CbchTestPars pars;
pars.chan__nr() = GSM__Types::ts__RslChanNr__CBCH4(0).valueof();
pars.basic() = t__CbchPC(CbchTestMsgs_template(msgs__1m__3b__default), t__CbchPC_def_defval).valueof();
pars.extended() = OMIT_VALUE;
current_location.update_lineno(663);
/* BTS_Tests_SMSCB.ttcn, line 663 */
f__TC__smscb__default__only(pars);
current_location.update_lineno(664);
/* BTS_Tests_SMSCB.ttcn, line 664 */
Misc__Helpers::f__shutdown(cs_12, 664, PASS, 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_sms_cb_cmd_sdcch4_default_only was stopped.");
}
return TTCN_Runtime::end_testcase();
}

verdicttype testcase_TC__sms__cb__cmd__sdcch8__default__only(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests_SMSCB.ttcn", 666, TTCN_Location::LOCATION_TESTCASE, "TC_sms_cb_cmd_sdcch8_default_only");
try {
TTCN_Runtime::begin_testcase("BTS_Tests_SMSCB", "TC_sms_cb_cmd_sdcch8_default_only", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(667);
/* BTS_Tests_SMSCB.ttcn, line 667 */
CbchTestPars pars;
pars.chan__nr() = GSM__Types::ts__RslChanNr__CBCH4(0).valueof();
pars.basic() = t__CbchPC(CbchTestMsgs_template(msgs__1m__3b__default), t__CbchPC_def_defval).valueof();
pars.extended() = OMIT_VALUE;
current_location.update_lineno(672);
/* BTS_Tests_SMSCB.ttcn, line 672 */
f__TC__smscb__default__only(pars);
current_location.update_lineno(673);
/* BTS_Tests_SMSCB.ttcn, line 673 */
Misc__Helpers::f__shutdown(cs_12, 673, PASS, 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_sms_cb_cmd_sdcch8_default_only was stopped.");
}
return TTCN_Runtime::end_testcase();
}

verdicttype testcase_TC__sms__cb__cmd__sdcch4__default__and__normal(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests_SMSCB.ttcn", 676, TTCN_Location::LOCATION_TESTCASE, "TC_sms_cb_cmd_sdcch4_default_and_normal");
try {
TTCN_Runtime::begin_testcase("BTS_Tests_SMSCB", "TC_sms_cb_cmd_sdcch4_default_and_normal", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(677);
/* BTS_Tests_SMSCB.ttcn, line 677 */
CbchTestPars pars;
pars.chan__nr() = GSM__Types::ts__RslChanNr__CBCH4(0).valueof();
pars.basic() = t__CbchPC(CbchTestMsgs_template(msgs__1m__3b__norm), CbchTestMsg_template(msg__default)).valueof();
pars.extended() = OMIT_VALUE;
current_location.update_lineno(682);
/* BTS_Tests_SMSCB.ttcn, line 682 */
f__TC__smscb(pars);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_sms_cb_cmd_sdcch4_default_and_normal was stopped.");
}
return TTCN_Runtime::end_testcase();
}

verdicttype testcase_TC__sms__cb__cmd__sdcch8__default__and__normal(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests_SMSCB.ttcn", 684, TTCN_Location::LOCATION_TESTCASE, "TC_sms_cb_cmd_sdcch8_default_and_normal");
try {
TTCN_Runtime::begin_testcase("BTS_Tests_SMSCB", "TC_sms_cb_cmd_sdcch8_default_and_normal", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(685);
/* BTS_Tests_SMSCB.ttcn, line 685 */
CbchTestPars pars;
pars.chan__nr() = GSM__Types::ts__RslChanNr__CBCH8(2).valueof();
pars.basic() = t__CbchPC(CbchTestMsgs_template(msgs__1m__3b__norm), CbchTestMsg_template(msg__default)).valueof();
pars.extended() = OMIT_VALUE;
current_location.update_lineno(690);
/* BTS_Tests_SMSCB.ttcn, line 690 */
f__TC__smscb(pars);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_sms_cb_cmd_sdcch8_default_and_normal was stopped.");
}
return TTCN_Runtime::end_testcase();
}

verdicttype testcase_TC__sms__cb__cmd__sdcch4__default__then__null(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests_SMSCB.ttcn", 694, TTCN_Location::LOCATION_TESTCASE, "TC_sms_cb_cmd_sdcch4_default_then_null");
try {
TTCN_Runtime::begin_testcase("BTS_Tests_SMSCB", "TC_sms_cb_cmd_sdcch4_default_then_null", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(695);
/* BTS_Tests_SMSCB.ttcn, line 695 */
CbchTestPars pars;
pars.chan__nr() = GSM__Types::ts__RslChanNr__CBCH4(0).valueof();
pars.basic() = t__CbchPC(CbchTestMsgs_template(msgs__1m__3b__default), t__CbchPC_def_defval).valueof();
pars.extended() = OMIT_VALUE;
current_location.update_lineno(700);
/* BTS_Tests_SMSCB.ttcn, line 700 */
L1CTL__Types::L1ctlMessage dl;
current_location.update_lineno(701);
/* BTS_Tests_SMSCB.ttcn, line 701 */
TIMER T("T", 5.0);
current_location.update_lineno(703);
/* BTS_Tests_SMSCB.ttcn, line 703 */
f__TC__smscb__default__only(pars);
current_location.update_lineno(706);
/* BTS_Tests_SMSCB.ttcn, line 706 */
f__rsl__smscb__default__null();
current_location.update_lineno(709);
/* BTS_Tests_SMSCB.ttcn, line 709 */
Osmocom__Types::f__sleep(5.0);
current_location.update_lineno(710);
/* BTS_Tests_SMSCB.ttcn, line 710 */
BTS__Tests::test__CT_component_L1CTL.clear();
current_location.update_lineno(712);
/* BTS_Tests_SMSCB.ttcn, line 712 */
T.start();
current_location.update_lineno(713);
/* BTS_Tests_SMSCB.ttcn, line 713 */
{
tmp_127:
alt_status tmp_127_alt_flag_0 = ALT_MAYBE;
alt_status tmp_127_alt_flag_1 = ALT_MAYBE;
alt_status tmp_127_alt_flag_2 = ALT_MAYBE;
alt_status tmp_127_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_127_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(714);
/* BTS_Tests_SMSCB.ttcn, line 714 */
tmp_127_alt_flag_0 = BTS__Tests::test__CT_component_L1CTL.receive(L1CTL__Types::tr__L1CTL__DATA__IND(GSM__Types::t__RslChanNr__CBCH4(INTEGER_template(0)), L1CTL__Types::tr__L1CTL__DATA__IND_link__id_defval, 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_127_alt_flag_0 == ALT_YES) {
current_location.update_lineno(715);
/* BTS_Tests_SMSCB.ttcn, line 715 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("CBCH: ");
dl.log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(716);
/* BTS_Tests_SMSCB.ttcn, line 716 */
GSM__Types::CBCH__Block cb(GSM__Types::dec__CBCH__Block(const_cast< const L1CTL__Types::L1ctlMessage&>(dl).payload()().data__ind().payload()));
current_location.update_lineno(718);
/* BTS_Tests_SMSCB.ttcn, line 718 */
f__cbch__fn__verify(const_cast< const L1CTL__Types::L1ctlMessage&>(dl).dl__info()().frame__nr(), cb);
current_location.update_lineno(719);
/* BTS_Tests_SMSCB.ttcn, line 719 */
if ((!(GSM__Types::tr__CBCH__Block(GSM__Types::tr__CBCH__Block_seq__nr_defval, GSM__Types::tr__CBCH__Block_last__block_defval, GSM__Types::tr__CBCH__Block_payload_defval).match(cb)))) {
current_location.update_lineno(720);
/* BTS_Tests_SMSCB.ttcn, line 720 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Illegal CBCH Block received: "),cb.log(),TTCN_Logger::end_event_log2str()));
}
else {
current_location.update_lineno(722);
/* BTS_Tests_SMSCB.ttcn, line 722 */
if ((!(GSM__Types::tr__CBCH__Block(INTEGER_template(15), BOOLEAN_template(ANY_VALUE), OCTETSTRING_template(ANY_VALUE)).match(cb)))) {
current_location.update_lineno(723);
/* BTS_Tests_SMSCB.ttcn, line 723 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Unexpected non-NULL CBCH block received"),TTCN_Logger::end_event_log2str()));
}
current_location.update_lineno(725);
/* BTS_Tests_SMSCB.ttcn, line 725 */
goto tmp_127;
}
break;
}
}
if (tmp_127_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(728);
/* BTS_Tests_SMSCB.ttcn, line 728 */
tmp_127_alt_flag_1 = BTS__Tests::test__CT_component_L1CTL.receive(any_compref, NULL, NULL, NULL);
if (tmp_127_alt_flag_1 == ALT_YES) {
current_location.update_lineno(728);
/* BTS_Tests_SMSCB.ttcn, line 728 */
goto tmp_127;
}
}
if (tmp_127_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(729);
/* BTS_Tests_SMSCB.ttcn, line 729 */
tmp_127_alt_flag_2 = T.timeout(NULL);
if (tmp_127_alt_flag_2 == ALT_YES) {
current_location.update_lineno(730);
/* BTS_Tests_SMSCB.ttcn, line 730 */
TTCN_Runtime::setverdict(PASS);
break;
}
}
if (tmp_127_default_flag == ALT_MAYBE) {
tmp_127_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_127_default_flag == ALT_YES || tmp_127_default_flag == ALT_BREAK) break;
else if (tmp_127_default_flag == ALT_REPEAT) goto tmp_127;
}
current_location.update_lineno(713);
/* BTS_Tests_SMSCB.ttcn, line 713 */
if (tmp_127_alt_flag_0 == ALT_NO && tmp_127_alt_flag_1 == ALT_NO && tmp_127_alt_flag_2 == ALT_NO && tmp_127_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file BTS_Tests_SMSCB.ttcn between lines 713 and 732.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(734);
/* BTS_Tests_SMSCB.ttcn, line 734 */
Misc__Helpers::f__shutdown(cs_12, 734, PASS, 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_sms_cb_cmd_sdcch4_default_then_null was stopped.");
}
return TTCN_Runtime::end_testcase();
}

verdicttype testcase_TC__cbch__load__idle__no__cbch(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests_SMSCB.ttcn", 738, TTCN_Location::LOCATION_TESTCASE, "TC_cbch_load_idle_no_cbch");
try {
TTCN_Runtime::begin_testcase("BTS_Tests_SMSCB", "TC_cbch_load_idle_no_cbch", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(739);
/* BTS_Tests_SMSCB.ttcn, line 739 */
IPA__Emulation::ASP__RSL__Unitdata rx__ud;
current_location.update_lineno(740);
/* BTS_Tests_SMSCB.ttcn, line 740 */
TIMER T("T", 1.0e1);
current_location.update_lineno(742);
/* BTS_Tests_SMSCB.ttcn, line 742 */
BTS__Tests::f__init(BTS__Tests::f__init_trx__nr_defval);
current_location.update_lineno(743);
/* BTS_Tests_SMSCB.ttcn, line 743 */
BTS__Tests::f__init__vty__bsc();
current_location.update_lineno(745);
/* BTS_Tests_SMSCB.ttcn, line 745 */
T.start();
current_location.update_lineno(746);
/* BTS_Tests_SMSCB.ttcn, line 746 */
{
tmp_128:
alt_status tmp_128_alt_flag_0 = ALT_MAYBE;
alt_status tmp_128_alt_flag_1 = ALT_MAYBE;
alt_status tmp_128_alt_flag_2 = ALT_MAYBE;
alt_status tmp_128_alt_flag_3 = ALT_MAYBE;
alt_status tmp_128_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_128_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(747);
/* BTS_Tests_SMSCB.ttcn, line 747 */
tmp_128_alt_flag_0 = BTS__Tests::test__CT_component_RSL__CCHAN.receive(IPA__Emulation::tr__ASP__RSL__UD(RSL__Types::tr__RSL__CBCH__LOAD__IND__BASIC(RSL__Types::tr__RSL__CBCH__LOAD__IND__BASIC_overflow_defval, RSL__Types::tr__RSL__CBCH__LOAD__IND__BASIC_slot__count_defval, RSL__Types::tr__RSL__CBCH__LOAD__IND__BASIC_chan__nr_defval), 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_128_alt_flag_0 == ALT_YES) {
current_location.update_lineno(748);
/* BTS_Tests_SMSCB.ttcn, line 748 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Received unexpected CBCH LOAD IND: "),rx__ud.log(),TTCN_Logger::end_event_log2str()));
break;
}
}
if (tmp_128_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(750);
/* BTS_Tests_SMSCB.ttcn, line 750 */
tmp_128_alt_flag_1 = BTS__Tests::test__CT_component_RSL__CCHAN.receive(IPA__Emulation::tr__ASP__RSL__UD(RSL__Types::tr__RSL__CBCH__LOAD__IND__EXTD(RSL__Types::tr__RSL__CBCH__LOAD__IND__EXTD_overflow_defval, RSL__Types::tr__RSL__CBCH__LOAD__IND__EXTD_slot__count_defval, RSL__Types::tr__RSL__CBCH__LOAD__IND__EXTD_chan__nr_defval), 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_128_alt_flag_1 == ALT_YES) {
current_location.update_lineno(751);
/* BTS_Tests_SMSCB.ttcn, line 751 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Received unexpected CBCH LOAD IND: "),rx__ud.log(),TTCN_Logger::end_event_log2str()));
break;
}
}
if (tmp_128_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(753);
/* BTS_Tests_SMSCB.ttcn, line 753 */
tmp_128_alt_flag_2 = BTS__Tests::test__CT_component_RSL__CCHAN.receive(any_compref, NULL, NULL, NULL);
if (tmp_128_alt_flag_2 == ALT_YES) {
current_location.update_lineno(753);
/* BTS_Tests_SMSCB.ttcn, line 753 */
goto tmp_128;
}
}
if (tmp_128_alt_flag_3 == ALT_MAYBE) {
current_location.update_lineno(754);
/* BTS_Tests_SMSCB.ttcn, line 754 */
tmp_128_alt_flag_3 = T.timeout(NULL);
if (tmp_128_alt_flag_3 == ALT_YES) {
current_location.update_lineno(755);
/* BTS_Tests_SMSCB.ttcn, line 755 */
TTCN_Runtime::setverdict(PASS);
break;
}
}
if (tmp_128_default_flag == ALT_MAYBE) {
tmp_128_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_128_default_flag == ALT_YES || tmp_128_default_flag == ALT_BREAK) break;
else if (tmp_128_default_flag == ALT_REPEAT) goto tmp_128;
}
current_location.update_lineno(746);
/* BTS_Tests_SMSCB.ttcn, line 746 */
if (tmp_128_alt_flag_0 == ALT_NO && tmp_128_alt_flag_1 == ALT_NO && tmp_128_alt_flag_2 == ALT_NO && tmp_128_alt_flag_3 == ALT_NO && tmp_128_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file BTS_Tests_SMSCB.ttcn between lines 746 and 757.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(758);
/* BTS_Tests_SMSCB.ttcn, line 758 */
Misc__Helpers::f__shutdown(cs_12, 758, 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_cbch_load_idle_no_cbch was stopped.");
}
return TTCN_Runtime::end_testcase();
}

void f__TC__cbc__load__idle()
{
TTCN_Location current_location("BTS_Tests_SMSCB.ttcn", 762, TTCN_Location::LOCATION_FUNCTION, "f_TC_cbc_load_idle");
current_location.update_lineno(763);
/* BTS_Tests_SMSCB.ttcn, line 763 */
INTEGER_template tr__slot__count;
tr__slot__count.set_type(VALUE_RANGE);
tr__slot__count.set_min(2);
tr__slot__count.set_max(15);
current_location.update_lineno(764);
/* BTS_Tests_SMSCB.ttcn, line 764 */
INTEGER min__load__ind(4);
current_location.update_lineno(765);
/* BTS_Tests_SMSCB.ttcn, line 765 */
INTEGER basic__count(0);
current_location.update_lineno(766);
/* BTS_Tests_SMSCB.ttcn, line 766 */
INTEGER extd__count(0);
current_location.update_lineno(767);
/* BTS_Tests_SMSCB.ttcn, line 767 */
IPA__Emulation::ASP__RSL__Unitdata rx__ud;
current_location.update_lineno(768);
/* BTS_Tests_SMSCB.ttcn, line 768 */
TIMER T("T", 1.0e1);
current_location.update_lineno(770);
/* BTS_Tests_SMSCB.ttcn, line 770 */
BTS__Tests::f__init(BTS__Tests::f__init_trx__nr_defval);
current_location.update_lineno(772);
/* BTS_Tests_SMSCB.ttcn, line 772 */
BTS__Tests::test__CT_component_RSL__CCHAN.clear();
current_location.update_lineno(773);
/* BTS_Tests_SMSCB.ttcn, line 773 */
T.start();
current_location.update_lineno(774);
/* BTS_Tests_SMSCB.ttcn, line 774 */
{
tmp_129:
alt_status tmp_129_alt_flag_0 = ALT_MAYBE;
alt_status tmp_129_alt_flag_1 = ALT_MAYBE;
alt_status tmp_129_alt_flag_2 = ALT_MAYBE;
alt_status tmp_129_alt_flag_3 = ALT_MAYBE;
alt_status tmp_129_alt_flag_4 = ALT_MAYBE;
alt_status tmp_129_alt_flag_5 = ALT_MAYBE;
alt_status tmp_129_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_129_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(775);
/* BTS_Tests_SMSCB.ttcn, line 775 */
tmp_129_alt_flag_0 = BTS__Tests::test__CT_component_RSL__CCHAN.receive(IPA__Emulation::tr__ASP__RSL__UD(RSL__Types::tr__RSL__CBCH__LOAD__IND__BASIC(BOOLEAN_template(FALSE), tr__slot__count, RSL__Types::tr__RSL__CBCH__LOAD__IND__BASIC_chan__nr_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_129_alt_flag_0 == ALT_YES) {
current_location.update_lineno(776);
/* BTS_Tests_SMSCB.ttcn, line 776 */
{
INTEGER tmp_130;
++basic__count;
}
current_location.update_lineno(777);
/* BTS_Tests_SMSCB.ttcn, line 777 */
goto tmp_129;
}
}
if (tmp_129_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(779);
/* BTS_Tests_SMSCB.ttcn, line 779 */
tmp_129_alt_flag_1 = BTS__Tests::test__CT_component_RSL__CCHAN.receive(IPA__Emulation::tr__ASP__RSL__UD(RSL__Types::tr__RSL__CBCH__LOAD__IND__EXTD(BOOLEAN_template(FALSE), tr__slot__count, RSL__Types::tr__RSL__CBCH__LOAD__IND__EXTD_chan__nr_defval), 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_129_alt_flag_1 == ALT_YES) {
current_location.update_lineno(780);
/* BTS_Tests_SMSCB.ttcn, line 780 */
{
INTEGER tmp_131;
++extd__count;
}
current_location.update_lineno(781);
/* BTS_Tests_SMSCB.ttcn, line 781 */
goto tmp_129;
}
}
if (tmp_129_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(783);
/* BTS_Tests_SMSCB.ttcn, line 783 */
tmp_129_alt_flag_2 = BTS__Tests::test__CT_component_RSL__CCHAN.receive(IPA__Emulation::tr__ASP__RSL__UD(RSL__Types::tr__RSL__CBCH__LOAD__IND__BASIC(RSL__Types::tr__RSL__CBCH__LOAD__IND__BASIC_overflow_defval, RSL__Types::tr__RSL__CBCH__LOAD__IND__BASIC_slot__count_defval, RSL__Types::tr__RSL__CBCH__LOAD__IND__BASIC_chan__nr_defval), 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_129_alt_flag_2 == ALT_YES) {
current_location.update_lineno(784);
/* BTS_Tests_SMSCB.ttcn, line 784 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Received unexpected CBCH LOAD IND: "),rx__ud.log(),TTCN_Logger::end_event_log2str()));
break;
}
}
if (tmp_129_alt_flag_3 == ALT_MAYBE) {
current_location.update_lineno(786);
/* BTS_Tests_SMSCB.ttcn, line 786 */
tmp_129_alt_flag_3 = BTS__Tests::test__CT_component_RSL__CCHAN.receive(IPA__Emulation::tr__ASP__RSL__UD(RSL__Types::tr__RSL__CBCH__LOAD__IND__EXTD(RSL__Types::tr__RSL__CBCH__LOAD__IND__EXTD_overflow_defval, RSL__Types::tr__RSL__CBCH__LOAD__IND__EXTD_slot__count_defval, RSL__Types::tr__RSL__CBCH__LOAD__IND__EXTD_chan__nr_defval), 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_129_alt_flag_3 == ALT_YES) {
current_location.update_lineno(787);
/* BTS_Tests_SMSCB.ttcn, line 787 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Received unexpected CBCH LOAD IND: "),rx__ud.log(),TTCN_Logger::end_event_log2str()));
break;
}
}
if (tmp_129_alt_flag_4 == ALT_MAYBE) {
current_location.update_lineno(789);
/* BTS_Tests_SMSCB.ttcn, line 789 */
tmp_129_alt_flag_4 = BTS__Tests::test__CT_component_RSL__CCHAN.receive(any_compref, NULL, NULL, NULL);
if (tmp_129_alt_flag_4 == ALT_YES) {
current_location.update_lineno(789);
/* BTS_Tests_SMSCB.ttcn, line 789 */
goto tmp_129;
}
}
if (tmp_129_alt_flag_5 == ALT_MAYBE) {
current_location.update_lineno(790);
/* BTS_Tests_SMSCB.ttcn, line 790 */
tmp_129_alt_flag_5 = T.timeout(NULL);
if (tmp_129_alt_flag_5 == ALT_YES) {
current_location.update_lineno(791);
/* BTS_Tests_SMSCB.ttcn, line 791 */
{
boolean tmp_132;
tmp_132 = (basic__count >= 4);
if (tmp_132) tmp_132 = (extd__count >= 4);
if (tmp_132) {
current_location.update_lineno(792);
/* BTS_Tests_SMSCB.ttcn, line 792 */
TTCN_Runtime::setverdict(PASS);
}
else {
current_location.update_lineno(794);
/* BTS_Tests_SMSCB.ttcn, line 794 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Insufficient number of CBCH LOAD IND: BASIC="),basic__count.log(),TTCN_Logger::log_event_str(" EXTD="),extd__count.log(),TTCN_Logger::end_event_log2str()));
}
}
break;
}
}
if (tmp_129_default_flag == ALT_MAYBE) {
tmp_129_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_129_default_flag == ALT_YES || tmp_129_default_flag == ALT_BREAK) break;
else if (tmp_129_default_flag == ALT_REPEAT) goto tmp_129;
}
current_location.update_lineno(774);
/* BTS_Tests_SMSCB.ttcn, line 774 */
if (tmp_129_alt_flag_0 == ALT_NO && tmp_129_alt_flag_1 == ALT_NO && tmp_129_alt_flag_2 == ALT_NO && tmp_129_alt_flag_3 == ALT_NO && tmp_129_alt_flag_4 == ALT_NO && tmp_129_alt_flag_5 == ALT_NO && tmp_129_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file BTS_Tests_SMSCB.ttcn between lines 774 and 798.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(800);
/* BTS_Tests_SMSCB.ttcn, line 800 */
Misc__Helpers::f__shutdown(cs_12, 800, Misc__Helpers::f__shutdown_verdict_defval, Misc__Helpers::f__shutdown_text_defval);
}

void start_f__TC__cbc__load__idle(const COMPONENT& component_reference)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_TC_cbc_load_idle(");
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_SMSCB", "f_TC_cbc_load_idle", text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

verdicttype testcase_TC__cbc__sdcch4__load__idle(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests_SMSCB.ttcn", 802, TTCN_Location::LOCATION_TESTCASE, "TC_cbc_sdcch4_load_idle");
try {
TTCN_Runtime::begin_testcase("BTS_Tests_SMSCB", "TC_cbc_sdcch4_load_idle", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(803);
/* BTS_Tests_SMSCB.ttcn, line 803 */
BTS__Tests::f__init__vty__bsc();
current_location.update_lineno(804);
/* BTS_Tests_SMSCB.ttcn, line 804 */
f__vty__cbch__setup(GSM__Types::ts__RslChanNr__CBCH4(0).valueof());
current_location.update_lineno(805);
/* BTS_Tests_SMSCB.ttcn, line 805 */
f__TC__cbc__load__idle();
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_cbc_sdcch4_load_idle was stopped.");
}
return TTCN_Runtime::end_testcase();
}

verdicttype testcase_TC__cbc__sdcch8__load__idle(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests_SMSCB.ttcn", 807, TTCN_Location::LOCATION_TESTCASE, "TC_cbc_sdcch8_load_idle");
try {
TTCN_Runtime::begin_testcase("BTS_Tests_SMSCB", "TC_cbc_sdcch8_load_idle", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(808);
/* BTS_Tests_SMSCB.ttcn, line 808 */
BTS__Tests::f__init__vty__bsc();
current_location.update_lineno(809);
/* BTS_Tests_SMSCB.ttcn, line 809 */
f__vty__cbch__setup(GSM__Types::ts__RslChanNr__CBCH8(2).valueof());
current_location.update_lineno(810);
/* BTS_Tests_SMSCB.ttcn, line 810 */
f__TC__cbc__load__idle();
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_cbc_sdcch8_load_idle was stopped.");
}
return TTCN_Runtime::end_testcase();
}

void f__TC__cbc__load__overload(const CbchTestPars& pars)
{
CbchTestPars pars_shadow(pars);
TTCN_Location current_location("BTS_Tests_SMSCB.ttcn", 814, TTCN_Location::LOCATION_FUNCTION, "f_TC_cbc_load_overload");
current_location.update_lineno(815);
/* BTS_Tests_SMSCB.ttcn, line 815 */
INTEGER_template tr__slot__count__basic;
tr__slot__count__basic.set_type(VALUE_RANGE);
tr__slot__count__basic.set_min(11);
tr__slot__count__basic.set_max(13);
current_location.update_lineno(816);
/* BTS_Tests_SMSCB.ttcn, line 816 */
INTEGER_template tr__slot__count__extd;
tr__slot__count__extd.set_type(VALUE_RANGE);
tr__slot__count__extd.set_min(2);
tr__slot__count__extd.set_max(15);
current_location.update_lineno(817);
/* BTS_Tests_SMSCB.ttcn, line 817 */
INTEGER min__load__ind(4);
current_location.update_lineno(818);
/* BTS_Tests_SMSCB.ttcn, line 818 */
INTEGER basic__count(0);
current_location.update_lineno(819);
/* BTS_Tests_SMSCB.ttcn, line 819 */
INTEGER extd__count(0);
current_location.update_lineno(820);
/* BTS_Tests_SMSCB.ttcn, line 820 */
IPA__Emulation::ASP__RSL__Unitdata rx__ud;
current_location.update_lineno(821);
/* BTS_Tests_SMSCB.ttcn, line 821 */
TIMER T__total("T_total", 1.0e1);
current_location.update_lineno(822);
/* BTS_Tests_SMSCB.ttcn, line 822 */
TIMER T__retransmit("T_retransmit", 2.0e-1);
current_location.update_lineno(823);
/* BTS_Tests_SMSCB.ttcn, line 823 */
TIMER T__initial__guard("T_initial_guard", 2.0);
current_location.update_lineno(824);
/* BTS_Tests_SMSCB.ttcn, line 824 */
INTEGER i;
current_location.update_lineno(826);
/* BTS_Tests_SMSCB.ttcn, line 826 */
BTS__Tests::f__init(BTS__Tests::f__init_trx__nr_defval);
current_location.update_lineno(829);
/* BTS_Tests_SMSCB.ttcn, line 829 */
i = 0;
current_location.update_lineno(829);
/* BTS_Tests_SMSCB.ttcn, line 829 */
for ( ; ; ) {
current_location.update_lineno(829);
/* BTS_Tests_SMSCB.ttcn, line 829 */
if (!(i < 30)) break;
current_location.update_lineno(830);
/* BTS_Tests_SMSCB.ttcn, line 830 */
f__smscb__setup__rsl__chan(pars_shadow.basic(), f__smscb__setup__rsl__chan_extd_defval);
current_location.update_lineno(829);
/* BTS_Tests_SMSCB.ttcn, line 829 */
{
INTEGER tmp_134;
++i;
}
}
current_location.update_lineno(834);
/* BTS_Tests_SMSCB.ttcn, line 834 */
T__initial__guard.start();
current_location.update_lineno(835);
/* BTS_Tests_SMSCB.ttcn, line 835 */
T__retransmit.start();
current_location.update_lineno(836);
/* BTS_Tests_SMSCB.ttcn, line 836 */
{
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(837);
/* BTS_Tests_SMSCB.ttcn, line 837 */
tmp_135_alt_flag_0 = T__retransmit.timeout(NULL);
if (tmp_135_alt_flag_0 == ALT_YES) {
current_location.update_lineno(838);
/* BTS_Tests_SMSCB.ttcn, line 838 */
f__smscb__setup__rsl__chan(pars_shadow.basic(), f__smscb__setup__rsl__chan_extd_defval);
current_location.update_lineno(839);
/* BTS_Tests_SMSCB.ttcn, line 839 */
T__retransmit.start();
current_location.update_lineno(840);
/* BTS_Tests_SMSCB.ttcn, line 840 */
goto tmp_135;
}
}
if (tmp_135_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(842);
/* BTS_Tests_SMSCB.ttcn, line 842 */
tmp_135_alt_flag_1 = T__initial__guard.timeout(NULL);
if (tmp_135_alt_flag_1 == ALT_YES) 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(836);
/* BTS_Tests_SMSCB.ttcn, line 836 */
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_SMSCB.ttcn between lines 836 and 843.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(845);
/* BTS_Tests_SMSCB.ttcn, line 845 */
BTS__Tests::test__CT_component_RSL__CCHAN.clear();
current_location.update_lineno(848);
/* BTS_Tests_SMSCB.ttcn, line 848 */
T__total.start();
current_location.update_lineno(849);
/* BTS_Tests_SMSCB.ttcn, line 849 */
T__retransmit.start();
current_location.update_lineno(850);
/* BTS_Tests_SMSCB.ttcn, line 850 */
{
tmp_136:
alt_status tmp_136_alt_flag_0 = ALT_MAYBE;
alt_status tmp_136_alt_flag_1 = ALT_MAYBE;
alt_status tmp_136_alt_flag_2 = ALT_MAYBE;
alt_status tmp_136_alt_flag_3 = ALT_MAYBE;
alt_status tmp_136_alt_flag_4 = ALT_MAYBE;
alt_status tmp_136_alt_flag_5 = ALT_MAYBE;
alt_status tmp_136_alt_flag_6 = ALT_MAYBE;
alt_status tmp_136_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_136_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(851);
/* BTS_Tests_SMSCB.ttcn, line 851 */
tmp_136_alt_flag_0 = BTS__Tests::test__CT_component_RSL__CCHAN.receive(IPA__Emulation::tr__ASP__RSL__UD(RSL__Types::tr__RSL__CBCH__LOAD__IND__BASIC(BOOLEAN_template(TRUE), tr__slot__count__basic, RSL__Types::tr__RSL__CBCH__LOAD__IND__BASIC_chan__nr_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_136_alt_flag_0 == ALT_YES) {
current_location.update_lineno(852);
/* BTS_Tests_SMSCB.ttcn, line 852 */
{
INTEGER tmp_137;
++basic__count;
}
current_location.update_lineno(853);
/* BTS_Tests_SMSCB.ttcn, line 853 */
goto tmp_136;
}
}
if (tmp_136_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(855);
/* BTS_Tests_SMSCB.ttcn, line 855 */
tmp_136_alt_flag_1 = BTS__Tests::test__CT_component_RSL__CCHAN.receive(IPA__Emulation::tr__ASP__RSL__UD(RSL__Types::tr__RSL__CBCH__LOAD__IND__EXTD(BOOLEAN_template(FALSE), tr__slot__count__extd, RSL__Types::tr__RSL__CBCH__LOAD__IND__EXTD_chan__nr_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_136_alt_flag_1 == ALT_YES) {
current_location.update_lineno(856);
/* BTS_Tests_SMSCB.ttcn, line 856 */
{
INTEGER tmp_138;
++extd__count;
}
current_location.update_lineno(857);
/* BTS_Tests_SMSCB.ttcn, line 857 */
goto tmp_136;
}
}
if (tmp_136_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(859);
/* BTS_Tests_SMSCB.ttcn, line 859 */
tmp_136_alt_flag_2 = BTS__Tests::test__CT_component_RSL__CCHAN.receive(IPA__Emulation::tr__ASP__RSL__UD(RSL__Types::tr__RSL__CBCH__LOAD__IND__BASIC(RSL__Types::tr__RSL__CBCH__LOAD__IND__BASIC_overflow_defval, RSL__Types::tr__RSL__CBCH__LOAD__IND__BASIC_slot__count_defval, RSL__Types::tr__RSL__CBCH__LOAD__IND__BASIC_chan__nr_defval), 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_136_alt_flag_2 == ALT_YES) {
current_location.update_lineno(860);
/* BTS_Tests_SMSCB.ttcn, line 860 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Received unexpected CBCH LOAD IND: "),rx__ud.log(),TTCN_Logger::end_event_log2str()));
break;
}
}
if (tmp_136_alt_flag_3 == ALT_MAYBE) {
current_location.update_lineno(862);
/* BTS_Tests_SMSCB.ttcn, line 862 */
tmp_136_alt_flag_3 = BTS__Tests::test__CT_component_RSL__CCHAN.receive(IPA__Emulation::tr__ASP__RSL__UD(RSL__Types::tr__RSL__CBCH__LOAD__IND__EXTD(RSL__Types::tr__RSL__CBCH__LOAD__IND__EXTD_overflow_defval, RSL__Types::tr__RSL__CBCH__LOAD__IND__EXTD_slot__count_defval, RSL__Types::tr__RSL__CBCH__LOAD__IND__EXTD_chan__nr_defval), 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_136_alt_flag_3 == ALT_YES) {
current_location.update_lineno(863);
/* BTS_Tests_SMSCB.ttcn, line 863 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Received unexpected CBCH LOAD IND: "),rx__ud.log(),TTCN_Logger::end_event_log2str()));
break;
}
}
if (tmp_136_alt_flag_4 == ALT_MAYBE) {
current_location.update_lineno(865);
/* BTS_Tests_SMSCB.ttcn, line 865 */
tmp_136_alt_flag_4 = BTS__Tests::test__CT_component_RSL__CCHAN.receive(any_compref, NULL, NULL, NULL);
if (tmp_136_alt_flag_4 == ALT_YES) {
current_location.update_lineno(865);
/* BTS_Tests_SMSCB.ttcn, line 865 */
goto tmp_136;
}
}
if (tmp_136_alt_flag_5 == ALT_MAYBE) {
current_location.update_lineno(866);
/* BTS_Tests_SMSCB.ttcn, line 866 */
tmp_136_alt_flag_5 = T__retransmit.timeout(NULL);
if (tmp_136_alt_flag_5 == ALT_YES) {
current_location.update_lineno(867);
/* BTS_Tests_SMSCB.ttcn, line 867 */
f__smscb__setup__rsl__chan(pars_shadow.basic(), f__smscb__setup__rsl__chan_extd_defval);
current_location.update_lineno(868);
/* BTS_Tests_SMSCB.ttcn, line 868 */
T__retransmit.start();
current_location.update_lineno(869);
/* BTS_Tests_SMSCB.ttcn, line 869 */
goto tmp_136;
}
}
if (tmp_136_alt_flag_6 == ALT_MAYBE) {
current_location.update_lineno(871);
/* BTS_Tests_SMSCB.ttcn, line 871 */
tmp_136_alt_flag_6 = T__total.timeout(NULL);
if (tmp_136_alt_flag_6 == ALT_YES) {
current_location.update_lineno(872);
/* BTS_Tests_SMSCB.ttcn, line 872 */
{
boolean tmp_139;
tmp_139 = (basic__count >= 4);
if (tmp_139) tmp_139 = (extd__count >= 4);
if (tmp_139) {
current_location.update_lineno(873);
/* BTS_Tests_SMSCB.ttcn, line 873 */
TTCN_Runtime::setverdict(PASS);
}
else {
current_location.update_lineno(875);
/* BTS_Tests_SMSCB.ttcn, line 875 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Insufficient number of CBCH LOAD IND: BASIC="),basic__count.log(),TTCN_Logger::log_event_str(" EXTD="),extd__count.log(),TTCN_Logger::end_event_log2str()));
}
}
break;
}
}
if (tmp_136_default_flag == ALT_MAYBE) {
tmp_136_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_136_default_flag == ALT_YES || tmp_136_default_flag == ALT_BREAK) break;
else if (tmp_136_default_flag == ALT_REPEAT) goto tmp_136;
}
current_location.update_lineno(850);
/* BTS_Tests_SMSCB.ttcn, line 850 */
if (tmp_136_alt_flag_0 == ALT_NO && tmp_136_alt_flag_1 == ALT_NO && tmp_136_alt_flag_2 == ALT_NO && tmp_136_alt_flag_3 == ALT_NO && tmp_136_alt_flag_4 == ALT_NO && tmp_136_alt_flag_5 == ALT_NO && tmp_136_alt_flag_6 == ALT_NO && tmp_136_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file BTS_Tests_SMSCB.ttcn between lines 850 and 879.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(881);
/* BTS_Tests_SMSCB.ttcn, line 881 */
Misc__Helpers::f__shutdown(cs_12, 881, Misc__Helpers::f__shutdown_verdict_defval, Misc__Helpers::f__shutdown_text_defval);
}

void start_f__TC__cbc__load__overload(const COMPONENT& component_reference, const CbchTestPars& pars)
{
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_TC_cbc_load_overload(");
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_SMSCB", "f_TC_cbc_load_overload", text_buf);
pars.encode_text(text_buf);
TTCN_Runtime::send_start_component(text_buf);
}

verdicttype testcase_TC__cbc__sdcch4__load__overload(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests_SMSCB.ttcn", 883, TTCN_Location::LOCATION_TESTCASE, "TC_cbc_sdcch4_load_overload");
try {
TTCN_Runtime::begin_testcase("BTS_Tests_SMSCB", "TC_cbc_sdcch4_load_overload", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(884);
/* BTS_Tests_SMSCB.ttcn, line 884 */
CbchTestPars pars;
pars.chan__nr() = GSM__Types::ts__RslChanNr__CBCH4(0).valueof();
pars.basic() = t__CbchPC(CbchTestMsgs_template(msgs__1m__3b__norm), t__CbchPC_def_defval).valueof();
pars.extended() = OMIT_VALUE;
current_location.update_lineno(890);
/* BTS_Tests_SMSCB.ttcn, line 890 */
BTS__Tests::f__init__vty__bsc();
current_location.update_lineno(891);
/* BTS_Tests_SMSCB.ttcn, line 891 */
f__vty__cbch__setup(const_cast< const CbchTestPars&>(pars).chan__nr());
current_location.update_lineno(892);
/* BTS_Tests_SMSCB.ttcn, line 892 */
f__TC__cbc__load__overload(pars);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_cbc_sdcch4_load_overload was stopped.");
}
return TTCN_Runtime::end_testcase();
}

verdicttype testcase_TC__cbc__sdcch8__load__overload(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests_SMSCB.ttcn", 894, TTCN_Location::LOCATION_TESTCASE, "TC_cbc_sdcch8_load_overload");
try {
TTCN_Runtime::begin_testcase("BTS_Tests_SMSCB", "TC_cbc_sdcch8_load_overload", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(895);
/* BTS_Tests_SMSCB.ttcn, line 895 */
CbchTestPars pars;
pars.chan__nr() = GSM__Types::ts__RslChanNr__CBCH4(2).valueof();
pars.basic() = t__CbchPC(CbchTestMsgs_template(msgs__1m__3b__norm), t__CbchPC_def_defval).valueof();
pars.extended() = OMIT_VALUE;
current_location.update_lineno(901);
/* BTS_Tests_SMSCB.ttcn, line 901 */
BTS__Tests::f__init__vty__bsc();
current_location.update_lineno(902);
/* BTS_Tests_SMSCB.ttcn, line 902 */
f__vty__cbch__setup(const_cast< const CbchTestPars&>(pars).chan__nr());
current_location.update_lineno(903);
/* BTS_Tests_SMSCB.ttcn, line 903 */
f__TC__cbc__load__overload(pars);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case TC_cbc_sdcch8_load_overload was stopped.");
}
return TTCN_Runtime::end_testcase();
}

verdicttype testcase_TC__etws__p1ro(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests_SMSCB.ttcn", 920, TTCN_Location::LOCATION_TESTCASE, "TC_etws_p1ro");
try {
TTCN_Runtime::begin_testcase("BTS_Tests_SMSCB", "TC_etws_p1ro", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(923);
/* BTS_Tests_SMSCB.ttcn, line 923 */
BITSTRING c__P1RO__hdr(bs_0);
current_location.update_lineno(924);
/* BTS_Tests_SMSCB.ttcn, line 924 */
VALUE_ARRAY<INTEGER, 4, 0> seg__received;
seg__received[0] = 0;
seg__received[1] = 0;
seg__received[2] = 0;
seg__received[3] = 0;
current_location.update_lineno(925);
/* BTS_Tests_SMSCB.ttcn, line 925 */
L1CTL__Types::L1ctlMessage dl;
current_location.update_lineno(926);
/* BTS_Tests_SMSCB.ttcn, line 926 */
TIMER T("T", 1.0e1);
current_location.update_lineno(928);
/* BTS_Tests_SMSCB.ttcn, line 928 */
BTS__Tests::f__init(BTS__Tests::f__init_trx__nr_defval);
current_location.update_lineno(929);
/* BTS_Tests_SMSCB.ttcn, line 929 */
BTS__Tests::f__init__l1ctl();
current_location.update_lineno(930);
/* BTS_Tests_SMSCB.ttcn, line 930 */
BTS__Tests::f__l1__tune(BTS__Tests::test__CT_component_L1CTL, L1CTL__Types::L1ctlCcchMode::CCCH__MODE__COMBINED__CBCH);
current_location.update_lineno(932);
/* BTS_Tests_SMSCB.ttcn, line 932 */
BTS__Tests::test__CT_component_RSL__CCHAN.send(IPA__Emulation::ts__ASP__RSL__UD(RSL__Types::ts__RSL__OSMO__ETWS__CMD(OCTETSTRING_template(os_13), RSL__Types::ts__RSL__OSMO__ETWS__CMD_chan__nr_defval), IPA__Emulation::ts__ASP__RSL__UD_sid_defval, IPA__Emulation::ts__ASP__RSL__UD_conn__id_defval), FALSE, NULL);
current_location.update_lineno(934);
/* BTS_Tests_SMSCB.ttcn, line 934 */
Osmocom__Types::f__sleep(1.0);
current_location.update_lineno(935);
/* BTS_Tests_SMSCB.ttcn, line 935 */
BTS__Tests::test__CT_component_L1CTL.clear();
current_location.update_lineno(936);
/* BTS_Tests_SMSCB.ttcn, line 936 */
T.start();
current_location.update_lineno(937);
/* BTS_Tests_SMSCB.ttcn, line 937 */
{
tmp_140:
alt_status tmp_140_alt_flag_0 = ALT_MAYBE;
alt_status tmp_140_alt_flag_1 = ALT_MAYBE;
alt_status tmp_140_alt_flag_2 = ALT_MAYBE;
alt_status tmp_140_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_140_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(938);
/* BTS_Tests_SMSCB.ttcn, line 938 */
tmp_140_alt_flag_0 = BTS__Tests::test__CT_component_L1CTL.receive(L1CTL__Types::tr__L1CTL__DATA__IND(GSM__Types::t__RslChanNr__PCH__AGCH(INTEGER_template(0)), L1CTL__Types::tr__L1CTL__DATA__IND_link__id_defval, 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_140_alt_flag_0 == ALT_YES) {
current_location.update_lineno(939);
/* BTS_Tests_SMSCB.ttcn, line 939 */
GSM__RR__Types::GsmRrMessage l3(GSM__RR__Types::dec__GsmRrMessage(const_cast< const L1CTL__Types::L1ctlMessage&>(dl).payload()().data__ind().payload()));
{
const GSM__RR__Types::GsmRrMessage &tmp_142 = l3;
current_location.update_lineno(941);
/* BTS_Tests_SMSCB.ttcn, line 941 */
if(GSM__RR__Types::tr__PAG__REQ1(L3__Templates::tr__MI__LV(L3__Templates::t__MI__NoIdentity(L3__Templates::t__MI__NoIdentity_filler_defval)), GSM__RR__Types::tr__PAG__REQ1_mi2_defval).match(tmp_142)) goto tmp_141_0;
current_location.update_lineno(990);
/* BTS_Tests_SMSCB.ttcn, line 990 */
if(tr__PagingType1.match(tmp_142)) goto tmp_141_1;
goto tmp_141_end;
tmp_141_0:
{
current_location.update_lineno(942);
/* BTS_Tests_SMSCB.ttcn, line 942 */
OCTETSTRING p1ro(const_cast< const GSM__RR__Types::GsmRrMessage&>(l3).payload().pag__req__1().rest__octets());
current_location.update_lineno(943);
/* BTS_Tests_SMSCB.ttcn, line 943 */
BITSTRING midamble(oct2bit(substr(p1ro, 0, 3)));
current_location.update_lineno(944);
/* BTS_Tests_SMSCB.ttcn, line 944 */
OCTETSTRING segment(substr(p1ro, 3, (p1ro.lengthof() - 3)));
current_location.update_lineno(945);
/* BTS_Tests_SMSCB.ttcn, line 945 */
BITSTRING not__first(substr(midamble, 11, 1));
current_location.update_lineno(946);
/* BTS_Tests_SMSCB.ttcn, line 946 */
INTEGER seg__nr(bit2int(substr(midamble, 12, 4)));
current_location.update_lineno(947);
/* BTS_Tests_SMSCB.ttcn, line 947 */
BOOLEAN err(FALSE);
current_location.update_lineno(948);
/* BTS_Tests_SMSCB.ttcn, line 948 */
if ((substr(midamble, 0, 11) != bs_0)) {
current_location.update_lineno(949);
/* BTS_Tests_SMSCB.ttcn, line 949 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Received unexpected P1 RO header "),midamble.log(),TTCN_Logger::end_event_log2str()));
}
current_location.update_lineno(951);
/* BTS_Tests_SMSCB.ttcn, line 951 */
if ((not__first == bs_1)) {
{
const INTEGER &tmp_144 = seg__nr;
switch(tmp_144.get_long_long_val()) {
case(2):
{
current_location.update_lineno(954);
/* BTS_Tests_SMSCB.ttcn, line 954 */
if ((segment != os_10)) {
current_location.update_lineno(955);
/* BTS_Tests_SMSCB.ttcn, line 955 */
err = TRUE;
}
else {
current_location.update_lineno(957);
/* BTS_Tests_SMSCB.ttcn, line 957 */
{
INTEGER tmp_146;
tmp_146 = (const_cast< const VALUE_ARRAY<INTEGER, 4, 0>&>(seg__received)[1] + 1);
seg__received[1] = tmp_146;
}
}
break;
}
case(3):
{
current_location.update_lineno(960);
/* BTS_Tests_SMSCB.ttcn, line 960 */
if ((segment != os_11)) {
current_location.update_lineno(961);
/* BTS_Tests_SMSCB.ttcn, line 961 */
err = TRUE;
}
else {
current_location.update_lineno(963);
/* BTS_Tests_SMSCB.ttcn, line 963 */
{
INTEGER tmp_148;
tmp_148 = (const_cast< const VALUE_ARRAY<INTEGER, 4, 0>&>(seg__received)[2] + 1);
seg__received[2] = tmp_148;
}
}
break;
}
case(4):
{
current_location.update_lineno(966);
/* BTS_Tests_SMSCB.ttcn, line 966 */
if ((segment != os_12)) {
current_location.update_lineno(967);
/* BTS_Tests_SMSCB.ttcn, line 967 */
err = TRUE;
}
else {
current_location.update_lineno(969);
/* BTS_Tests_SMSCB.ttcn, line 969 */
{
INTEGER tmp_150;
tmp_150 = (const_cast< const VALUE_ARRAY<INTEGER, 4, 0>&>(seg__received)[3] + 1);
seg__received[3] = tmp_150;
}
}
break;
}
default:
{
current_location.update_lineno(971);
/* BTS_Tests_SMSCB.ttcn, line 971 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Unknown segment Nr "),seg__nr.log(),TTCN_Logger::end_event_log2str()));
break;
}
};}
current_location.update_lineno(973);
/* BTS_Tests_SMSCB.ttcn, line 973 */
if (err) {
current_location.update_lineno(974);
/* BTS_Tests_SMSCB.ttcn, line 974 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Unexpected segment "),seg__nr.log(),TTCN_Logger::log_event_str(": "),segment.log(),TTCN_Logger::end_event_log2str()));
}
}
else {
current_location.update_lineno(977);
/* BTS_Tests_SMSCB.ttcn, line 977 */
if ((seg__nr != 4)) {
current_location.update_lineno(978);
/* BTS_Tests_SMSCB.ttcn, line 978 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Invalid number of segments "),seg__nr.log(),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(979);
/* BTS_Tests_SMSCB.ttcn, line 979 */
err = TRUE;
}
current_location.update_lineno(981);
/* BTS_Tests_SMSCB.ttcn, line 981 */
if ((segment != os_9)) {
current_location.update_lineno(982);
/* BTS_Tests_SMSCB.ttcn, line 982 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Invalid first segment "),segment.log(),TTCN_Logger::end_event_log2str()));
current_location.update_lineno(983);
/* BTS_Tests_SMSCB.ttcn, line 983 */
err = TRUE;
}
current_location.update_lineno(985);
/* BTS_Tests_SMSCB.ttcn, line 985 */
if ((!(err))) {
current_location.update_lineno(986);
/* BTS_Tests_SMSCB.ttcn, line 986 */
{
INTEGER tmp_153;
tmp_153 = (const_cast< const VALUE_ARRAY<INTEGER, 4, 0>&>(seg__received)[0] + 1);
seg__received[0] = tmp_153;
}
}
}
goto tmp_141_end;
}
tmp_141_1:
{
current_location.update_lineno(991);
/* BTS_Tests_SMSCB.ttcn, line 991 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Received unexpected PAGING TYPE 1: "),l3.log(),TTCN_Logger::end_event_log2str()));
goto tmp_141_end;
}
tmp_141_end: /* empty */;
}
current_location.update_lineno(994);
/* BTS_Tests_SMSCB.ttcn, line 994 */
goto tmp_140;
}
}
if (tmp_140_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(996);
/* BTS_Tests_SMSCB.ttcn, line 996 */
tmp_140_alt_flag_1 = BTS__Tests::test__CT_component_L1CTL.receive(any_compref, NULL, NULL, NULL);
if (tmp_140_alt_flag_1 == ALT_YES) {
current_location.update_lineno(996);
/* BTS_Tests_SMSCB.ttcn, line 996 */
goto tmp_140;
}
}
if (tmp_140_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(997);
/* BTS_Tests_SMSCB.ttcn, line 997 */
tmp_140_alt_flag_2 = T.timeout(NULL);
if (tmp_140_alt_flag_2 == ALT_YES) {
current_location.update_lineno(998);
/* BTS_Tests_SMSCB.ttcn, line 998 */
TTCN_Runtime::setverdict(PASS);
break;
}
}
if (tmp_140_default_flag == ALT_MAYBE) {
tmp_140_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_140_default_flag == ALT_YES || tmp_140_default_flag == ALT_BREAK) break;
else if (tmp_140_default_flag == ALT_REPEAT) goto tmp_140;
}
current_location.update_lineno(937);
/* BTS_Tests_SMSCB.ttcn, line 937 */
if (tmp_140_alt_flag_0 == ALT_NO && tmp_140_alt_flag_1 == ALT_NO && tmp_140_alt_flag_2 == ALT_NO && tmp_140_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file BTS_Tests_SMSCB.ttcn between lines 937 and 1000.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(1001);
/* BTS_Tests_SMSCB.ttcn, line 1001 */
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("Quantity of received ETWS PN segments: ");
seg__received.log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(1002);
/* BTS_Tests_SMSCB.ttcn, line 1002 */
INTEGER i;
current_location.update_lineno(1003);
/* BTS_Tests_SMSCB.ttcn, line 1003 */
i = 0;
current_location.update_lineno(1003);
/* BTS_Tests_SMSCB.ttcn, line 1003 */
for ( ; ; ) {
current_location.update_lineno(1003);
/* BTS_Tests_SMSCB.ttcn, line 1003 */
if (!(i < 4)) break;
current_location.update_lineno(1004);
/* BTS_Tests_SMSCB.ttcn, line 1004 */
if ((const_cast< const VALUE_ARRAY<INTEGER, 4, 0>&>(seg__received)[i] < 15)) {
current_location.update_lineno(1005);
/* BTS_Tests_SMSCB.ttcn, line 1005 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Segment "),i.log(),TTCN_Logger::log_event_str(" not received often enough"),TTCN_Logger::end_event_log2str()));
}
current_location.update_lineno(1003);
/* BTS_Tests_SMSCB.ttcn, line 1003 */
{
INTEGER tmp_155;
++i;
}
}
current_location.update_lineno(1009);
/* BTS_Tests_SMSCB.ttcn, line 1009 */
Misc__Helpers::f__shutdown(cs_12, 1009, 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_etws_p1ro was stopped.");
}
return TTCN_Runtime::end_testcase();
}

verdicttype testcase_TC__etws__p1ro__end(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests_SMSCB.ttcn", 1013, TTCN_Location::LOCATION_TESTCASE, "TC_etws_p1ro_end");
try {
TTCN_Runtime::begin_testcase("BTS_Tests_SMSCB", "TC_etws_p1ro_end", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(1018);
/* BTS_Tests_SMSCB.ttcn, line 1018 */
BITSTRING c__P1RO__hdr(bs_0);
current_location.update_lineno(1019);
/* BTS_Tests_SMSCB.ttcn, line 1019 */
L1CTL__Types::L1ctlMessage dl;
current_location.update_lineno(1020);
/* BTS_Tests_SMSCB.ttcn, line 1020 */
TIMER T("T", 1.0e1);
current_location.update_lineno(1022);
/* BTS_Tests_SMSCB.ttcn, line 1022 */
BTS__Tests::f__init(BTS__Tests::f__init_trx__nr_defval);
current_location.update_lineno(1023);
/* BTS_Tests_SMSCB.ttcn, line 1023 */
BTS__Tests::f__init__l1ctl();
current_location.update_lineno(1024);
/* BTS_Tests_SMSCB.ttcn, line 1024 */
BTS__Tests::f__l1__tune(BTS__Tests::test__CT_component_L1CTL, L1CTL__Types::L1ctlCcchMode::CCCH__MODE__COMBINED__CBCH);
current_location.update_lineno(1026);
/* BTS_Tests_SMSCB.ttcn, line 1026 */
BTS__Tests::test__CT_component_RSL__CCHAN.send(IPA__Emulation::ts__ASP__RSL__UD(RSL__Types::ts__RSL__OSMO__ETWS__CMD(OCTETSTRING_template(os_13), RSL__Types::ts__RSL__OSMO__ETWS__CMD_chan__nr_defval), IPA__Emulation::ts__ASP__RSL__UD_sid_defval, IPA__Emulation::ts__ASP__RSL__UD_conn__id_defval), FALSE, NULL);
current_location.update_lineno(1028);
/* BTS_Tests_SMSCB.ttcn, line 1028 */
Osmocom__Types::f__sleep(3.0);
current_location.update_lineno(1030);
/* BTS_Tests_SMSCB.ttcn, line 1030 */
BTS__Tests::test__CT_component_RSL__CCHAN.send(IPA__Emulation::ts__ASP__RSL__UD(RSL__Types::ts__RSL__OSMO__ETWS__CMD(OCTETSTRING_template(os_0), RSL__Types::ts__RSL__OSMO__ETWS__CMD_chan__nr_defval), IPA__Emulation::ts__ASP__RSL__UD_sid_defval, IPA__Emulation::ts__ASP__RSL__UD_conn__id_defval), FALSE, NULL);
current_location.update_lineno(1031);
/* BTS_Tests_SMSCB.ttcn, line 1031 */
Osmocom__Types::f__sleep(2.0);
current_location.update_lineno(1032);
/* BTS_Tests_SMSCB.ttcn, line 1032 */
T.start();
current_location.update_lineno(1033);
/* BTS_Tests_SMSCB.ttcn, line 1033 */
BTS__Tests::test__CT_component_L1CTL.clear();
current_location.update_lineno(1034);
/* BTS_Tests_SMSCB.ttcn, line 1034 */
{
tmp_156:
alt_status tmp_156_alt_flag_0 = ALT_MAYBE;
alt_status tmp_156_alt_flag_1 = ALT_MAYBE;
alt_status tmp_156_alt_flag_2 = ALT_MAYBE;
alt_status tmp_156_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_156_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(1035);
/* BTS_Tests_SMSCB.ttcn, line 1035 */
tmp_156_alt_flag_0 = BTS__Tests::test__CT_component_L1CTL.receive(L1CTL__Types::tr__L1CTL__DATA__IND(GSM__Types::t__RslChanNr__PCH__AGCH(INTEGER_template(0)), L1CTL__Types::tr__L1CTL__DATA__IND_link__id_defval, 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_156_alt_flag_0 == ALT_YES) {
current_location.update_lineno(1036);
/* BTS_Tests_SMSCB.ttcn, line 1036 */
GSM__RR__Types::GsmRrMessage l3(GSM__RR__Types::dec__GsmRrMessage(const_cast< const L1CTL__Types::L1ctlMessage&>(dl).payload()().data__ind().payload()));
{
const GSM__RR__Types::GsmRrMessage &tmp_158 = l3;
current_location.update_lineno(1038);
/* BTS_Tests_SMSCB.ttcn, line 1038 */
if(GSM__RR__Types::tr__PAG__REQ1(L3__Templates::tr__MI__LV(L3__Templates::t__MI__NoIdentity(L3__Templates::t__MI__NoIdentity_filler_defval)), GSM__RR__Types::tr__PAG__REQ1_mi2_defval).match(tmp_158)) goto tmp_157_0;
current_location.update_lineno(1039);
/* BTS_Tests_SMSCB.ttcn, line 1039 */
if(tr__PagingType1.match(tmp_158)) goto tmp_157_1;
goto tmp_157_end;
tmp_157_0:
{
current_location.update_lineno(1038);
/* BTS_Tests_SMSCB.ttcn, line 1038 */
goto tmp_156;
}
tmp_157_1:
{
current_location.update_lineno(1040);
/* BTS_Tests_SMSCB.ttcn, line 1040 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("Received non-empty PT1 after disabling ETWS PN: "),l3.log(),TTCN_Logger::end_event_log2str()));
goto tmp_157_end;
}
tmp_157_end: /* empty */;
}
current_location.update_lineno(1043);
/* BTS_Tests_SMSCB.ttcn, line 1043 */
goto tmp_156;
}
}
if (tmp_156_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(1045);
/* BTS_Tests_SMSCB.ttcn, line 1045 */
tmp_156_alt_flag_1 = BTS__Tests::test__CT_component_L1CTL.receive(any_compref, NULL, NULL, NULL);
if (tmp_156_alt_flag_1 == ALT_YES) {
current_location.update_lineno(1045);
/* BTS_Tests_SMSCB.ttcn, line 1045 */
goto tmp_156;
}
}
if (tmp_156_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(1046);
/* BTS_Tests_SMSCB.ttcn, line 1046 */
tmp_156_alt_flag_2 = T.timeout(NULL);
if (tmp_156_alt_flag_2 == ALT_YES) {
current_location.update_lineno(1047);
/* BTS_Tests_SMSCB.ttcn, line 1047 */
TTCN_Runtime::setverdict(PASS);
break;
}
}
if (tmp_156_default_flag == ALT_MAYBE) {
tmp_156_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_156_default_flag == ALT_YES || tmp_156_default_flag == ALT_BREAK) break;
else if (tmp_156_default_flag == ALT_REPEAT) goto tmp_156;
}
current_location.update_lineno(1034);
/* BTS_Tests_SMSCB.ttcn, line 1034 */
if (tmp_156_alt_flag_0 == ALT_NO && tmp_156_alt_flag_1 == ALT_NO && tmp_156_alt_flag_2 == ALT_NO && tmp_156_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file BTS_Tests_SMSCB.ttcn between lines 1034 and 1049.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(1051);
/* BTS_Tests_SMSCB.ttcn, line 1051 */
Misc__Helpers::f__shutdown(cs_12, 1051, 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_etws_p1ro_end was stopped.");
}
return TTCN_Runtime::end_testcase();
}

verdicttype testcase_TC__etws__pcu(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("BTS_Tests_SMSCB.ttcn", 1055, TTCN_Location::LOCATION_TESTCASE, "TC_etws_pcu");
try {
TTCN_Runtime::begin_testcase("BTS_Tests_SMSCB", "TC_etws_pcu", "BTS_Tests", "test_CT", "BTS_Tests", "test_CT", has_timer, timer_value);
current_location.update_lineno(1056);
/* BTS_Tests_SMSCB.ttcn, line 1056 */
TIMER T("T", 1.0e1);
current_location.update_lineno(1058);
/* BTS_Tests_SMSCB.ttcn, line 1058 */
BTS__Tests::f__init__with__pcuif();
current_location.update_lineno(1059);
/* BTS_Tests_SMSCB.ttcn, line 1059 */
BTS__Tests::f__init__l1ctl();
current_location.update_lineno(1060);
/* BTS_Tests_SMSCB.ttcn, line 1060 */
BTS__Tests::f__l1__tune(BTS__Tests::test__CT_component_L1CTL, L1CTL__Types::L1ctlCcchMode::CCCH__MODE__COMBINED__CBCH);
current_location.update_lineno(1062);
/* BTS_Tests_SMSCB.ttcn, line 1062 */
BTS__Tests::test__CT_component_RSL__CCHAN.send(IPA__Emulation::ts__ASP__RSL__UD(RSL__Types::ts__RSL__OSMO__ETWS__CMD(OCTETSTRING_template(os_13), RSL__Types::ts__RSL__OSMO__ETWS__CMD_chan__nr_defval), IPA__Emulation::ts__ASP__RSL__UD_sid_defval, IPA__Emulation::ts__ASP__RSL__UD_conn__id_defval), FALSE, NULL);
current_location.update_lineno(1064);
/* BTS_Tests_SMSCB.ttcn, line 1064 */
T.start();
current_location.update_lineno(1065);
/* BTS_Tests_SMSCB.ttcn, line 1065 */
{
tmp_159:
alt_status tmp_159_alt_flag_0 = ALT_MAYBE;
alt_status tmp_159_alt_flag_1 = ALT_MAYBE;
alt_status tmp_159_alt_flag_2 = ALT_MAYBE;
alt_status tmp_159_alt_flag_3 = ALT_MAYBE;
alt_status tmp_159_default_flag = ALT_MAYBE;
boolean first_run = TRUE;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (tmp_159_alt_flag_0 == ALT_MAYBE) {
current_location.update_lineno(1066);
/* BTS_Tests_SMSCB.ttcn, line 1066 */
tmp_159_alt_flag_0 = BTS__Tests::test__CT_component_PCU.receive(PCUIF__CodecPort::t__SD__PCUIF(BTS__Tests::test__CT_component_g__pcu__conn__id, PCUIF__Types::tr__PCUIF__APP__INFO__REQ(INTEGER_template(0), INTEGER_template(0), OCTETSTRING_template(os_13))), NULL, any_compref, NULL, NULL, NULL);
if (tmp_159_alt_flag_0 == ALT_YES) {
current_location.update_lineno(1067);
/* BTS_Tests_SMSCB.ttcn, line 1067 */
TTCN_Runtime::setverdict(PASS);
break;
}
}
if (tmp_159_alt_flag_1 == ALT_MAYBE) {
current_location.update_lineno(1069);
/* BTS_Tests_SMSCB.ttcn, line 1069 */
tmp_159_alt_flag_1 = BTS__Tests::test__CT_component_PCU.receive(PCUIF__CodecPort::t__SD__PCUIF(BTS__Tests::test__CT_component_g__pcu__conn__id, PCUIF__Types::tr__PCUIF__APP__INFO__REQ(INTEGER_template(ANY_VALUE), INTEGER_template(ANY_VALUE), OCTETSTRING_template(ANY_VALUE))), NULL, any_compref, NULL, NULL, NULL);
if (tmp_159_alt_flag_1 == ALT_YES) {
current_location.update_lineno(1070);
/* BTS_Tests_SMSCB.ttcn, line 1070 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("PCU socket received invalid APP INFO"),TTCN_Logger::end_event_log2str()));
break;
}
}
if (tmp_159_alt_flag_2 == ALT_MAYBE) {
current_location.update_lineno(1072);
/* BTS_Tests_SMSCB.ttcn, line 1072 */
tmp_159_alt_flag_2 = BTS__Tests::test__CT_component_PCU.receive(any_compref, NULL, NULL, NULL);
if (tmp_159_alt_flag_2 == ALT_YES) {
current_location.update_lineno(1072);
/* BTS_Tests_SMSCB.ttcn, line 1072 */
goto tmp_159;
}
}
if (tmp_159_alt_flag_3 == ALT_MAYBE) {
current_location.update_lineno(1073);
/* BTS_Tests_SMSCB.ttcn, line 1073 */
tmp_159_alt_flag_3 = T.timeout(NULL);
if (tmp_159_alt_flag_3 == ALT_YES) {
current_location.update_lineno(1074);
/* BTS_Tests_SMSCB.ttcn, line 1074 */
TTCN_Runtime::setverdict(FAIL,(TTCN_Logger::begin_event_log2str(),TTCN_Logger::log_event_str("PCU socket timeout receiving APP INFO (ETWS)"),TTCN_Logger::end_event_log2str()));
break;
}
}
if (tmp_159_default_flag == ALT_MAYBE) {
tmp_159_default_flag = TTCN_Default::try_altsteps(first_run);
if (tmp_159_default_flag == ALT_YES || tmp_159_default_flag == ALT_BREAK) break;
else if (tmp_159_default_flag == ALT_REPEAT) goto tmp_159;
}
current_location.update_lineno(1065);
/* BTS_Tests_SMSCB.ttcn, line 1065 */
if (tmp_159_alt_flag_0 == ALT_NO && tmp_159_alt_flag_1 == ALT_NO && tmp_159_alt_flag_2 == ALT_NO && tmp_159_alt_flag_3 == ALT_NO && tmp_159_default_flag == ALT_NO) TTCN_error("None of the branches can be chosen in the alt statement in file BTS_Tests_SMSCB.ttcn between lines 1065 and 1076.");
TTCN_Snapshot::take_new(TRUE);
first_run = FALSE;
}
}
current_location.update_lineno(1078);
/* BTS_Tests_SMSCB.ttcn, line 1078 */
Misc__Helpers::f__shutdown(cs_12, 1078, 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_etws_pcu was stopped.");
}
return TTCN_Runtime::end_testcase();
}

void module_control_part()
{
TTCN_Location current_location("BTS_Tests_SMSCB.ttcn", 1089, TTCN_Location::LOCATION_CONTROLPART, "BTS_Tests_SMSCB");
TTCN_Runtime::begin_controlpart("BTS_Tests_SMSCB");
TTCN_ControlPartEnder ender_("BTS_Tests_SMSCB");
current_location.update_lineno(1090);
/* BTS_Tests_SMSCB.ttcn, line 1090 */
testcase_TC__cbch__load__idle__no__cbch(FALSE, 0.0);
current_location.update_lineno(1092);
/* BTS_Tests_SMSCB.ttcn, line 1092 */
testcase_TC__sms__cb__cmd__sdcch4__1block(FALSE, 0.0);
current_location.update_lineno(1093);
/* BTS_Tests_SMSCB.ttcn, line 1093 */
testcase_TC__sms__cb__cmd__sdcch4__2block(FALSE, 0.0);
current_location.update_lineno(1094);
/* BTS_Tests_SMSCB.ttcn, line 1094 */
testcase_TC__sms__cb__cmd__sdcch4__3block(FALSE, 0.0);
current_location.update_lineno(1095);
/* BTS_Tests_SMSCB.ttcn, line 1095 */
testcase_TC__sms__cb__cmd__sdcch4__4block(FALSE, 0.0);
current_location.update_lineno(1096);
/* BTS_Tests_SMSCB.ttcn, line 1096 */
testcase_TC__sms__cb__cmd__sdcch4__multi(FALSE, 0.0);
current_location.update_lineno(1097);
/* BTS_Tests_SMSCB.ttcn, line 1097 */
testcase_TC__sms__cb__cmd__sdcch4__schedule(FALSE, 0.0);
current_location.update_lineno(1098);
/* BTS_Tests_SMSCB.ttcn, line 1098 */
testcase_TC__sms__cb__cmd__sdcch4__default__only(FALSE, 0.0);
current_location.update_lineno(1099);
/* BTS_Tests_SMSCB.ttcn, line 1099 */
testcase_TC__sms__cb__cmd__sdcch4__default__and__normal(FALSE, 0.0);
current_location.update_lineno(1100);
/* BTS_Tests_SMSCB.ttcn, line 1100 */
testcase_TC__sms__cb__cmd__sdcch4__default__then__null(FALSE, 0.0);
current_location.update_lineno(1101);
/* BTS_Tests_SMSCB.ttcn, line 1101 */
testcase_TC__cbc__sdcch4__load__idle(FALSE, 0.0);
current_location.update_lineno(1102);
/* BTS_Tests_SMSCB.ttcn, line 1102 */
testcase_TC__cbc__sdcch4__load__overload(FALSE, 0.0);
current_location.update_lineno(1104);
/* BTS_Tests_SMSCB.ttcn, line 1104 */
testcase_TC__sms__cb__cmd__sdcch8__1block(FALSE, 0.0);
current_location.update_lineno(1105);
/* BTS_Tests_SMSCB.ttcn, line 1105 */
testcase_TC__sms__cb__cmd__sdcch8__2block(FALSE, 0.0);
current_location.update_lineno(1106);
/* BTS_Tests_SMSCB.ttcn, line 1106 */
testcase_TC__sms__cb__cmd__sdcch8__3block(FALSE, 0.0);
current_location.update_lineno(1107);
/* BTS_Tests_SMSCB.ttcn, line 1107 */
testcase_TC__sms__cb__cmd__sdcch8__4block(FALSE, 0.0);
current_location.update_lineno(1108);
/* BTS_Tests_SMSCB.ttcn, line 1108 */
testcase_TC__sms__cb__cmd__sdcch8__multi(FALSE, 0.0);
current_location.update_lineno(1109);
/* BTS_Tests_SMSCB.ttcn, line 1109 */
testcase_TC__sms__cb__cmd__sdcch8__schedule(FALSE, 0.0);
current_location.update_lineno(1110);
/* BTS_Tests_SMSCB.ttcn, line 1110 */
testcase_TC__sms__cb__cmd__sdcch8__default__only(FALSE, 0.0);
current_location.update_lineno(1111);
/* BTS_Tests_SMSCB.ttcn, line 1111 */
testcase_TC__sms__cb__cmd__sdcch8__default__and__normal(FALSE, 0.0);
current_location.update_lineno(1112);
/* BTS_Tests_SMSCB.ttcn, line 1112 */
testcase_TC__cbc__sdcch8__load__idle(FALSE, 0.0);
current_location.update_lineno(1113);
/* BTS_Tests_SMSCB.ttcn, line 1113 */
testcase_TC__cbc__sdcch8__load__overload(FALSE, 0.0);
current_location.update_lineno(1115);
/* BTS_Tests_SMSCB.ttcn, line 1115 */
testcase_TC__etws__p1ro(FALSE, 0.0);
current_location.update_lineno(1116);
/* BTS_Tests_SMSCB.ttcn, line 1116 */
testcase_TC__etws__p1ro__end(FALSE, 0.0);
current_location.update_lineno(1117);
/* BTS_Tests_SMSCB.ttcn, line 1117 */
testcase_TC__etws__pcu(FALSE, 0.0);
}


/* Bodies of static functions */

void pre_init_module()
{
TTCN_Location current_location("BTS_Tests_SMSCB.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "BTS_Tests_SMSCB");
BTS__Tests::module_object.pre_init_module();
module_object.add_function("f_cbch_compute_exp_blocks", (genericfunc_t)&f__cbch__compute__exp__blocks, NULL);
module_object.add_function("f_cbch_compute_exp_blocks_chan", (genericfunc_t)&f__cbch__compute__exp__blocks__chan, NULL);
module_object.add_function("f_comp_blocks", (genericfunc_t)&f__comp__blocks, NULL);
module_object.add_function("f_cbch_block_nr2rsl", (genericfunc_t)&f__cbch__block__nr2rsl, NULL);
module_object.add_function("f_cbch_fn2tb", (genericfunc_t)&f__cbch__fn2tb, NULL);
module_object.add_function("f_cbch_fn_verify", (genericfunc_t)&f__cbch__fn__verify, NULL);
module_object.add_function("f_rsl_smscb_default_null", (genericfunc_t)&f__rsl__smscb__default__null, (genericfunc_t)&start_f__rsl__smscb__default__null);
module_object.add_function("f_smscb_setup_rsl_chan", (genericfunc_t)&f__smscb__setup__rsl__chan, (genericfunc_t)&start_f__smscb__setup__rsl__chan);
module_object.add_function("f_vty_cbch_setup", (genericfunc_t)&f__vty__cbch__setup, (genericfunc_t)&start_f__vty__cbch__setup);
module_object.add_function("f_smscb_setup", (genericfunc_t)&f__smscb__setup, (genericfunc_t)&start_f__smscb__setup);
module_object.add_function("f_get_block_template", (genericfunc_t)&f__get__block__template, NULL);
module_object.add_function("f_cbch_match", (genericfunc_t)&f__cbch__match, NULL);
module_object.add_function("f_cbch_report", (genericfunc_t)&f__cbch__report, NULL);
module_object.add_function("f_TC_smscb", (genericfunc_t)&f__TC__smscb, (genericfunc_t)&start_f__TC__smscb);
module_object.add_function("f_TC_smscb_default_only", (genericfunc_t)&f__TC__smscb__default__only, (genericfunc_t)&start_f__TC__smscb__default__only);
current_location.update_lineno(468);
/* BTS_Tests_SMSCB.ttcn, line 468 */
const_msgs__1m__1b__norm.set_size(1);
{
CbchTestMsg& tmp_118 = const_msgs__1m__1b__norm[0];
tmp_118.rsl__cb__cmd() = RSL__Types::RSL__CbCommand::RSL__CB__CMD__NORMAL;
tmp_118.last__block() = 0;
tmp_118.payload() = os_1;
tmp_118.blocks() = OMIT_VALUE;
}
current_location.update_lineno(472);
/* BTS_Tests_SMSCB.ttcn, line 472 */
const_msgs__1m__2b__norm.set_size(1);
{
CbchTestMsg& tmp_119 = const_msgs__1m__2b__norm[0];
tmp_119.rsl__cb__cmd() = RSL__Types::RSL__CbCommand::RSL__CB__CMD__NORMAL;
tmp_119.last__block() = 1;
tmp_119.payload() = os_2;
tmp_119.blocks() = OMIT_VALUE;
}
current_location.update_lineno(478);
/* BTS_Tests_SMSCB.ttcn, line 478 */
const_msgs__1m__3b__norm.set_size(1);
{
CbchTestMsg& tmp_120 = const_msgs__1m__3b__norm[0];
tmp_120.rsl__cb__cmd() = RSL__Types::RSL__CbCommand::RSL__CB__CMD__NORMAL;
tmp_120.last__block() = 2;
tmp_120.payload() = os_3;
tmp_120.blocks() = OMIT_VALUE;
}
current_location.update_lineno(485);
/* BTS_Tests_SMSCB.ttcn, line 485 */
const_msgs__1m__4b__norm.set_size(1);
{
CbchTestMsg& tmp_121 = const_msgs__1m__4b__norm[0];
tmp_121.rsl__cb__cmd() = RSL__Types::RSL__CbCommand::RSL__CB__CMD__NORMAL;
tmp_121.last__block() = 3;
tmp_121.payload() = os_4;
tmp_121.blocks() = OMIT_VALUE;
}
current_location.update_lineno(493);
/* BTS_Tests_SMSCB.ttcn, line 493 */
const_msgs__1m__4b__sched.set_size(1);
{
CbchTestMsg& tmp_122 = const_msgs__1m__4b__sched[0];
tmp_122.rsl__cb__cmd() = RSL__Types::RSL__CbCommand::RSL__CB__CMD__SCHEDULE;
tmp_122.last__block() = 3;
tmp_122.payload() = os_4;
tmp_122.blocks() = OMIT_VALUE;
}
current_location.update_lineno(501);
/* BTS_Tests_SMSCB.ttcn, line 501 */
const_msgs__3m__4b__norm.set_size(3);
{
CbchTestMsg& tmp_123 = const_msgs__3m__4b__norm[0];
tmp_123.rsl__cb__cmd() = RSL__Types::RSL__CbCommand::RSL__CB__CMD__NORMAL;
tmp_123.last__block() = 3;
tmp_123.payload() = os_5;
tmp_123.blocks() = OMIT_VALUE;
}
{
CbchTestMsg& tmp_124 = const_msgs__3m__4b__norm[1];
tmp_124.rsl__cb__cmd() = RSL__Types::RSL__CbCommand::RSL__CB__CMD__NORMAL;
tmp_124.last__block() = 3;
tmp_124.payload() = os_6;
tmp_124.blocks() = OMIT_VALUE;
}
{
CbchTestMsg& tmp_125 = const_msgs__3m__4b__norm[2];
tmp_125.rsl__cb__cmd() = RSL__Types::RSL__CbCommand::RSL__CB__CMD__NORMAL;
tmp_125.last__block() = 3;
tmp_125.payload() = os_7;
tmp_125.blocks() = OMIT_VALUE;
}
current_location.update_lineno(519);
/* BTS_Tests_SMSCB.ttcn, line 519 */
const_msgs__1m__3b__default.set_size(1);
{
CbchTestMsg& tmp_126 = const_msgs__1m__3b__default[0];
tmp_126.rsl__cb__cmd() = RSL__Types::RSL__CbCommand::RSL__CB__CMD__DEFAULT;
tmp_126.last__block() = 2;
tmp_126.payload() = os_3;
tmp_126.blocks() = OMIT_VALUE;
}
current_location.update_lineno(525);
/* BTS_Tests_SMSCB.ttcn, line 525 */
const_msg__default.rsl__cb__cmd() = RSL__Types::RSL__CbCommand::RSL__CB__CMD__DEFAULT;
const_msg__default.last__block() = 0;
const_msg__default.payload() = os_8;
const_msg__default.blocks() = OMIT_VALUE;
module_object.add_testcase_nonpard("TC_sms_cb_cmd_sdcch4_1block", testcase_TC__sms__cb__cmd__sdcch4__1block);
module_object.add_testcase_nonpard("TC_sms_cb_cmd_sdcch8_1block", testcase_TC__sms__cb__cmd__sdcch8__1block);
module_object.add_testcase_nonpard("TC_sms_cb_cmd_sdcch4_2block", testcase_TC__sms__cb__cmd__sdcch4__2block);
module_object.add_testcase_nonpard("TC_sms_cb_cmd_sdcch8_2block", testcase_TC__sms__cb__cmd__sdcch8__2block);
module_object.add_testcase_nonpard("TC_sms_cb_cmd_sdcch4_3block", testcase_TC__sms__cb__cmd__sdcch4__3block);
module_object.add_testcase_nonpard("TC_sms_cb_cmd_sdcch8_3block", testcase_TC__sms__cb__cmd__sdcch8__3block);
module_object.add_testcase_nonpard("TC_sms_cb_cmd_sdcch4_4block", testcase_TC__sms__cb__cmd__sdcch4__4block);
module_object.add_testcase_nonpard("TC_sms_cb_cmd_sdcch8_4block", testcase_TC__sms__cb__cmd__sdcch8__4block);
module_object.add_testcase_nonpard("TC_sms_cb_cmd_sdcch4_multi", testcase_TC__sms__cb__cmd__sdcch4__multi);
module_object.add_testcase_nonpard("TC_sms_cb_cmd_sdcch8_multi", testcase_TC__sms__cb__cmd__sdcch8__multi);
module_object.add_testcase_nonpard("TC_sms_cb_cmd_sdcch4_extd_multi", testcase_TC__sms__cb__cmd__sdcch4__extd__multi);
module_object.add_testcase_nonpard("TC_sms_cb_cmd_sdcch8_extd_multi", testcase_TC__sms__cb__cmd__sdcch8__extd__multi);
module_object.add_testcase_nonpard("TC_sms_cb_cmd_sdcch4_schedule", testcase_TC__sms__cb__cmd__sdcch4__schedule);
module_object.add_testcase_nonpard("TC_sms_cb_cmd_sdcch8_schedule", testcase_TC__sms__cb__cmd__sdcch8__schedule);
module_object.add_testcase_nonpard("TC_sms_cb_cmd_sdcch4_default_only", testcase_TC__sms__cb__cmd__sdcch4__default__only);
module_object.add_testcase_nonpard("TC_sms_cb_cmd_sdcch8_default_only", testcase_TC__sms__cb__cmd__sdcch8__default__only);
module_object.add_testcase_nonpard("TC_sms_cb_cmd_sdcch4_default_and_normal", testcase_TC__sms__cb__cmd__sdcch4__default__and__normal);
module_object.add_testcase_nonpard("TC_sms_cb_cmd_sdcch8_default_and_normal", testcase_TC__sms__cb__cmd__sdcch8__default__and__normal);
module_object.add_testcase_nonpard("TC_sms_cb_cmd_sdcch4_default_then_null", testcase_TC__sms__cb__cmd__sdcch4__default__then__null);
module_object.add_testcase_nonpard("TC_cbch_load_idle_no_cbch", testcase_TC__cbch__load__idle__no__cbch);
module_object.add_function("f_TC_cbc_load_idle", (genericfunc_t)&f__TC__cbc__load__idle, (genericfunc_t)&start_f__TC__cbc__load__idle);
module_object.add_testcase_nonpard("TC_cbc_sdcch4_load_idle", testcase_TC__cbc__sdcch4__load__idle);
module_object.add_testcase_nonpard("TC_cbc_sdcch8_load_idle", testcase_TC__cbc__sdcch8__load__idle);
module_object.add_function("f_TC_cbc_load_overload", (genericfunc_t)&f__TC__cbc__load__overload, (genericfunc_t)&start_f__TC__cbc__load__overload);
module_object.add_testcase_nonpard("TC_cbc_sdcch4_load_overload", testcase_TC__cbc__sdcch4__load__overload);
module_object.add_testcase_nonpard("TC_cbc_sdcch8_load_overload", testcase_TC__cbc__sdcch8__load__overload);
current_location.update_lineno(913);
/* BTS_Tests_SMSCB.ttcn, line 913 */
const_c__etws__seg0 = os_9;
current_location.update_lineno(914);
/* BTS_Tests_SMSCB.ttcn, line 914 */
const_c__etws__seg1 = os_10;
current_location.update_lineno(915);
/* BTS_Tests_SMSCB.ttcn, line 915 */
const_c__etws__seg2 = os_11;
current_location.update_lineno(916);
/* BTS_Tests_SMSCB.ttcn, line 916 */
const_c__etws__seg3 = os_12;
current_location.update_lineno(917);
/* BTS_Tests_SMSCB.ttcn, line 917 */
const_c__etws = os_13;
module_object.add_testcase_nonpard("TC_etws_p1ro", testcase_TC__etws__p1ro);
module_object.add_testcase_nonpard("TC_etws_p1ro_end", testcase_TC__etws__p1ro__end);
module_object.add_testcase_nonpard("TC_etws_pcu", testcase_TC__etws__pcu);
}

void post_init_module()
{
TTCN_Location current_location("BTS_Tests_SMSCB.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "BTS_Tests_SMSCB");
BTS__Tests::module_object.post_init_module();
current_location.update_lineno(50);
/* BTS_Tests_SMSCB.ttcn, line 50 */
template_t__CbchPC_def_defval = OMIT_VALUE;
current_location.update_lineno(167);
/* BTS_Tests_SMSCB.ttcn, line 167 */
{
RSL__Types::RSL__IE__Body_template tmp_22;
tmp_22.smscb__chan__ind() = 1;
template_t__RSL__IE__SMSCB__EXT = RSL__Types::t__RSL__IE(RSL__Types::RSL__IE__Type::RSL__IE__SMSCB__CHAN__INDICATOR, tmp_22);
}
current_location.update_lineno(169);
/* BTS_Tests_SMSCB.ttcn, line 169 */
const_f__smscb__setup__rsl__chan_extd_defval = FALSE;
current_location.update_lineno(907);
/* BTS_Tests_SMSCB.ttcn, line 907 */
template_tr__PagingType1.header() = GSM__RR__Types::t__RrHeader(GSM__RR__Types::RrMessageType::PAGING__REQUEST__TYPE__1, INTEGER_template(ANY_VALUE));
template_tr__PagingType1.payload() = ANY_VALUE;
}

boolean start_ptc_function(const char *function_name, Text_Buf& function_arguments)
{
if (!strcmp(function_name, "f_rsl_smscb_default_null")) {
TTCN_Logger::log_str(TTCN_Logger::PARALLEL_PTC, "Starting function f_rsl_smscb_default_null().");
TTCN_Runtime::function_started(function_arguments);
f__rsl__smscb__default__null();
TTCN_Runtime::function_finished("f_rsl_smscb_default_null");
return TRUE;
} else if (!strcmp(function_name, "f_smscb_setup_rsl_chan")) {
CbchTestParsChan  pars__chan;
BOOLEAN extd;
pars__chan.decode_text(function_arguments);
extd.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_smscb_setup_rsl_chan(");
pars__chan.log();
TTCN_Logger::log_event_str(", ");
extd.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__smscb__setup__rsl__chan(pars__chan, extd);
TTCN_Runtime::function_finished("f_smscb_setup_rsl_chan");
return TRUE;
} else if (!strcmp(function_name, "f_vty_cbch_setup")) {
GSM__Types::RslChannelNr chan__nr;
chan__nr.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_vty_cbch_setup(");
chan__nr.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__vty__cbch__setup(chan__nr);
TTCN_Runtime::function_finished("f_vty_cbch_setup");
return TRUE;
} else if (!strcmp(function_name, "f_smscb_setup")) {
CbchTestPars  pars;
pars.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_smscb_setup(");
pars.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__smscb__setup(pars);
TTCN_Runtime::function_finished("f_smscb_setup");
return TRUE;
} else if (!strcmp(function_name, "f_TC_smscb")) {
CbchTestPars pars;
pars.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_TC_smscb(");
pars.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__TC__smscb(pars);
TTCN_Runtime::function_finished("f_TC_smscb");
return TRUE;
} else if (!strcmp(function_name, "f_TC_smscb_default_only")) {
CbchTestPars pars;
pars.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_TC_smscb_default_only(");
pars.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__TC__smscb__default__only(pars);
TTCN_Runtime::function_finished("f_TC_smscb_default_only");
return TRUE;
} else if (!strcmp(function_name, "f_TC_cbc_load_idle")) {
TTCN_Logger::log_str(TTCN_Logger::PARALLEL_PTC, "Starting function f_TC_cbc_load_idle().");
TTCN_Runtime::function_started(function_arguments);
f__TC__cbc__load__idle();
TTCN_Runtime::function_finished("f_TC_cbc_load_idle");
return TRUE;
} else if (!strcmp(function_name, "f_TC_cbc_load_overload")) {
CbchTestPars pars;
pars.decode_text(function_arguments);
TTCN_Logger::begin_event(TTCN_Logger::PARALLEL_PTC);
TTCN_Logger::log_event_str("Starting function f_TC_cbc_load_overload(");
pars.log();
TTCN_Logger::log_event_str(").");
TTCN_Logger::end_event();
TTCN_Runtime::function_started(function_arguments);
f__TC__cbc__load__overload(pars);
TTCN_Runtime::function_finished("f_TC_cbc_load_overload");
return TRUE;
} else return FALSE;
}


} /* end of namespace */
