blob: f5bc2ea1268a756feee99f5622f11b593c2d0209 [file] [log] [blame]
// This C++ source file was generated by the TTCN-3 compiler
// of the TTCN-3 Test Executor version CRL 113 200/6 R6A
// for Lénárd Nagy (elnrnag@elx78355y6x) on Thu Oct 24 10:29:40 2019
// Copyright (c) 2000-2019 Ericsson Telecom AB
// Do not edit this file unless you know what you are doing.
/* Including header files */
#include "CAN_matrix_test.hh"
namespace CAN__matrix__test {
/* Prototypes of static functions */
static void pre_init_module();
static void post_init_module();
static boolean init_comp_type(const char *component_type, boolean init_base_comps);
/* Literal string constants */
static const unsigned char bs_2_bits[] = { 170 },
bs_0_bits[] = { 170, 6 },
bs_3_bits[] = { 85 },
bs_1_bits[] = { 31 };
static const BITSTRING bs_2(8, bs_2_bits),
bs_0(11, bs_0_bits),
bs_3(8, bs_3_bits),
bs_1(5, bs_1_bits);
static const unsigned char os_12_octets[] = { 0, 0, 0, 21 },
os_0_octets[] = { 0, 0, 1, 34 },
os_3_octets[] = { 0, 0, 1, 35 },
os_2_octets[] = { 0, 0, 1, 36 },
os_4_octets[] = { 0, 0, 1, 37 },
os_9_octets[] = { 0, 0, 1, 38 },
os_10_octets[] = { 0, 0, 1, 39 },
os_11_octets[] = { 1, 35, 69, 103, 137, 171, 205, 239 },
os_13_octets[] = { 1, 35, 69, 103, 137, 171, 205, 239, 1, 35, 69, 103, 137, 171, 205, 239, 1, 35, 69, 103, 137, 171, 205, 239, 1, 35, 69, 103, 137, 171, 205, 239, 1, 35, 69, 103, 137, 171, 205, 239, 1, 35, 69, 103, 137, 171, 205, 239, 1, 35, 69, 103, 137, 171, 205, 239, 1, 35, 69, 103, 137, 171, 205, 239 },
os_1_octets[] = { 18, 52 },
os_6_octets[] = { 18, 63 },
os_7_octets[] = { 128, 0, 0, 1 },
os_5_octets[] = { 255 },
os_8_octets[] = { 255, 255 };
static const OCTETSTRING os_12(4, os_12_octets),
os_0(4, os_0_octets),
os_3(4, os_3_octets),
os_2(4, os_2_octets),
os_4(4, os_4_octets),
os_9(4, os_9_octets),
os_10(4, os_10_octets),
os_11(8, os_11_octets),
os_13(64, os_13_octets),
os_1(2, os_1_octets),
os_6(2, os_6_octets),
os_7(4, os_7_octets),
os_5(1, os_5_octets),
os_8(2, os_8_octets);
static const unsigned char module_checksum[] = { 0xc0, 0x4b, 0x3b, 0x6e, 0x4a, 0xdb, 0x3f, 0xaa, 0xa8, 0xe7, 0x99, 0x2a, 0x7e, 0x3f, 0xdf, 0x82 };
/* Global variable definitions */
const TTCN_Typedescriptor_t& MTC__CT_descr_ = COMPONENT_descr_;
TTCN_Module module_object("CAN_matrix_test", __DATE__, __TIME__, module_checksum, pre_init_module, NULL, 0U, 4294967295U, 4294967295U, 4294967295U, NULL, 0LU, 0, post_init_module, NULL, NULL, NULL, init_comp_type, NULL, NULL, NULL);
static const RuntimeVersionChecker ver_checker( current_runtime_version.requires_major_version_6,
current_runtime_version.requires_minor_version_6,
current_runtime_version.requires_patch_level_0, current_runtime_version.requires_runtime_1);
/* Bodies of functions, altsteps and testcases */
verdicttype testcase_tc__encdec(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("CAN_matrix_test.ttcn", 22, TTCN_Location::LOCATION_TESTCASE, "tc_encdec");
try {
TTCN_Runtime::begin_testcase("CAN_matrix_test", "tc_encdec", "CAN_matrix_test", "MTC_CT", "CAN_matrix_test", "MTC_CT", has_timer, timer_value);
current_location.update_lineno(25);
#line 25 "CAN_matrix_test.ttcn"
Can::CAN__frame my__can__id;
current_location.update_lineno(26);
#line 26 "CAN_matrix_test.ttcn"
my__can__id.can__id() = os_0;
my__can__id.can__pdu() = os_1;
current_location.update_lineno(27);
#line 27 "CAN_matrix_test.ttcn"
try {
TTCN_Logger::begin_event(TTCN_USER);
my__can__id.log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(28);
#line 28 "CAN_matrix_test.ttcn"
try {
TTCN_Logger::begin_event(TTCN_USER);
{
Can::CAN__frame tmp_1;
tmp_1.can__id() = os_0;
tmp_1.can__pdu() = os_1;
CAN__matrix::canframe2canmatrixframe(tmp_1).log();
}
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(29);
#line 29 "CAN_matrix_test.ttcn"
TTCN_Logger::log_str(TTCN_USER, "--------------------------------------------");
current_location.update_lineno(31);
#line 31 "CAN_matrix_test.ttcn"
CAN__matrix__messages::CAN__MatrixUnion my__can__message;
current_location.update_lineno(33);
#line 33 "CAN_matrix_test.ttcn"
my__can__message.can__id() = os_2;
{
CAN__matrix__messages::CAN__MESSAGE__TESTFRAME2__msg__type& tmp_3 = my__can__message.can__pdu().message__MyTestframe2();
tmp_3.test__sig__11__bit__integer__big__endian__coded() = 2047;
tmp_3.test__sig__5__bit__integer__big__endian__coded() = 2;
}
current_location.update_lineno(39);
#line 39 "CAN_matrix_test.ttcn"
try {
TTCN_Logger::begin_event(TTCN_USER);
my__can__message.log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(40);
#line 40 "CAN_matrix_test.ttcn"
try {
TTCN_Logger::begin_event(TTCN_USER);
CAN__matrix::canmatrixframe2can(my__can__message).log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(41);
#line 41 "CAN_matrix_test.ttcn"
TTCN_Logger::log_str(TTCN_USER, "--------------------------------------------");
current_location.update_lineno(44);
#line 44 "CAN_matrix_test.ttcn"
CAN__matrix__messages::CAN__MatrixUnion_template t__message__testFrame0__1;
t__message__testFrame0__1.can__id() = os_0;
{
CAN__matrix__messages::CAN__MESSAGE__TESTFRAME0__msg__type_template& tmp_4 = t__message__testFrame0__1.can__pdu().message__MyTestframe0();
tmp_4.test__sig__11__bit__bitstring__little__endian__coded() = bs_0;
tmp_4.test__sig__5__bit__bitstring__little__endian__coded() = bs_1;
}
current_location.update_lineno(55);
#line 55 "CAN_matrix_test.ttcn"
try {
TTCN_Logger::begin_event(TTCN_USER);
CAN__matrix::f__encode__can__matrix(t__message__testFrame0__1.valueof()).log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(56);
#line 56 "CAN_matrix_test.ttcn"
TTCN_Logger::log_str(TTCN_USER, "--------------------------------------------");
current_location.update_lineno(57);
#line 57 "CAN_matrix_test.ttcn"
try {
TTCN_Logger::begin_event(TTCN_USER);
CAN__matrix::f__decode__can__matrix(CAN__matrix::f__encode__can__matrix(t__message__testFrame0__1.valueof())).log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(58);
#line 58 "CAN_matrix_test.ttcn"
TTCN_Logger::log_str(TTCN_USER, "--------------------------------------------");
current_location.update_lineno(60);
#line 60 "CAN_matrix_test.ttcn"
CAN__matrix__messages::CAN__MatrixUnion_template t__message__testFrame1__1;
t__message__testFrame1__1.can__id() = os_3;
{
CAN__matrix__messages::CAN__MESSAGE__TESTFRAME1__msg__type_template& tmp_5 = t__message__testFrame1__1.can__pdu().message__MyTestframe1();
tmp_5.test__sig__11__bit__bitstring__big__endian__coded() = bs_0;
tmp_5.test__sig__5__bit__bitstring__big__endian__coded() = bs_1;
}
current_location.update_lineno(71);
#line 71 "CAN_matrix_test.ttcn"
try {
TTCN_Logger::begin_event(TTCN_USER);
CAN__matrix::f__encode__can__matrix(t__message__testFrame1__1.valueof()).log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(72);
#line 72 "CAN_matrix_test.ttcn"
TTCN_Logger::log_str(TTCN_USER, "--------------------------------------------");
current_location.update_lineno(73);
#line 73 "CAN_matrix_test.ttcn"
try {
TTCN_Logger::begin_event(TTCN_USER);
CAN__matrix::f__decode__can__matrix(CAN__matrix::f__encode__can__matrix(t__message__testFrame1__1.valueof())).log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(74);
#line 74 "CAN_matrix_test.ttcn"
TTCN_Logger::log_str(TTCN_USER, "--------------------------------------------");
current_location.update_lineno(76);
#line 76 "CAN_matrix_test.ttcn"
CAN__matrix__messages::CAN__MatrixUnion_template t__message__testFrame2__1;
t__message__testFrame2__1.can__id() = os_2;
{
CAN__matrix__messages::CAN__MESSAGE__TESTFRAME2__msg__type_template& tmp_6 = t__message__testFrame2__1.can__pdu().message__MyTestframe2();
tmp_6.test__sig__11__bit__integer__big__endian__coded() = 2047;
tmp_6.test__sig__5__bit__integer__big__endian__coded() = 2;
}
current_location.update_lineno(88);
#line 88 "CAN_matrix_test.ttcn"
try {
TTCN_Logger::begin_event(TTCN_USER);
CAN__matrix::f__encode__can__matrix(t__message__testFrame2__1.valueof()).log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(89);
#line 89 "CAN_matrix_test.ttcn"
TTCN_Logger::log_str(TTCN_USER, "--------------------------------------------");
current_location.update_lineno(90);
#line 90 "CAN_matrix_test.ttcn"
try {
TTCN_Logger::begin_event(TTCN_USER);
CAN__matrix::f__decode__can__matrix(CAN__matrix::f__encode__can__matrix(t__message__testFrame2__1.valueof())).log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(91);
#line 91 "CAN_matrix_test.ttcn"
TTCN_Logger::log_str(TTCN_USER, "--------------------------------------------");
current_location.update_lineno(94);
#line 94 "CAN_matrix_test.ttcn"
CAN__matrix__messages::CAN__MatrixUnion_template t__message__testFrame3__1;
t__message__testFrame3__1.can__id() = os_4;
{
CAN__matrix__messages::CAN__MESSAGE__TESTFRAME3__msg__type_template& tmp_7 = t__message__testFrame3__1.can__pdu().message__MyTestframe3();
tmp_7.test__sig__1__byte__octetstring__big__endian__coded() = os_5;
tmp_7.test__sig__2__byte__octetstring__big__endian__coded() = os_6;
}
current_location.update_lineno(105);
#line 105 "CAN_matrix_test.ttcn"
try {
TTCN_Logger::begin_event(TTCN_USER);
CAN__matrix::f__encode__can__matrix(t__message__testFrame3__1.valueof()).log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(106);
#line 106 "CAN_matrix_test.ttcn"
TTCN_Logger::log_str(TTCN_USER, "--------------------------------------------");
current_location.update_lineno(107);
#line 107 "CAN_matrix_test.ttcn"
try {
TTCN_Logger::begin_event(TTCN_USER);
CAN__matrix::f__decode__can__matrix(CAN__matrix::f__encode__can__matrix(t__message__testFrame3__1.valueof())).log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(108);
#line 108 "CAN_matrix_test.ttcn"
TTCN_Logger::log_str(TTCN_USER, "--------------------------------------------");
current_location.update_lineno(112);
#line 112 "CAN_matrix_test.ttcn"
CAN__matrix__messages::CAN__MatrixUnion_template t__message__extendedFrame1__1;
t__message__extendedFrame1__1.can__id() = os_7;
t__message__extendedFrame1__1.can__pdu().message__extendedFrame1().test__sig__2__byte__octetstring__msb__coded() = os_8;
current_location.update_lineno(122);
#line 122 "CAN_matrix_test.ttcn"
try {
TTCN_Logger::begin_event(TTCN_USER);
CAN__matrix::f__encode__can__matrix(t__message__extendedFrame1__1.valueof()).log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(123);
#line 123 "CAN_matrix_test.ttcn"
TTCN_Logger::log_str(TTCN_USER, "--------------------------------------------");
current_location.update_lineno(124);
#line 124 "CAN_matrix_test.ttcn"
try {
TTCN_Logger::begin_event(TTCN_USER);
CAN__matrix::f__decode__can__matrix(CAN__matrix::f__encode__can__matrix(t__message__extendedFrame1__1.valueof())).log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(125);
#line 125 "CAN_matrix_test.ttcn"
TTCN_Logger::log_str(TTCN_USER, "--------------------------------------------");
current_location.update_lineno(127);
#line 127 "CAN_matrix_test.ttcn"
CAN__matrix__messages::CAN__MESSAGE__TESTFRAME1__msg__type v__message__Frame1__2;
current_location.update_lineno(128);
#line 128 "CAN_matrix_test.ttcn"
CAN__matrix__messages::CAN__MESSAGE__TESTFRAME2__msg__type v__message__Frame2__2;
current_location.update_lineno(129);
#line 129 "CAN_matrix_test.ttcn"
CAN__matrix__messages::CAN__MESSAGE__TESTFRAME3__msg__type v__message__Frame3__2;
current_location.update_lineno(130);
#line 130 "CAN_matrix_test.ttcn"
CAN__matrix__messages::CAN__MESSAGE__TESTFRAME4__msg__type v__message__Frame4__2;
current_location.update_lineno(131);
#line 131 "CAN_matrix_test.ttcn"
CAN__matrix__messages::CAN__MESSAGE__TESTFRAME5__msg__type v__message__Frame5__2;
current_location.update_lineno(132);
#line 132 "CAN_matrix_test.ttcn"
CAN__matrix__messages::CAN__MESSAGE__EXTENDEDFRAME1__msg__type v__message__extendedFrame1__2;
current_location.update_lineno(134);
#line 134 "CAN_matrix_test.ttcn"
v__message__Frame1__2.test__sig__11__bit__bitstring__big__endian__coded() = bs_0;
v__message__Frame1__2.test__sig__5__bit__bitstring__big__endian__coded() = bs_1;
current_location.update_lineno(141);
#line 141 "CAN_matrix_test.ttcn"
CAN__matrix__messages::CAN__MatrixUnion_template t__message__Frame1__2;
t__message__Frame1__2.can__id() = os_3;
t__message__Frame1__2.can__pdu().message__MyTestframe1() = v__message__Frame1__2;
current_location.update_lineno(147);
#line 147 "CAN_matrix_test.ttcn"
try {
TTCN_Logger::begin_event(TTCN_USER);
CAN__matrix::f__encode__can__matrix(t__message__Frame1__2.valueof()).log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(148);
#line 148 "CAN_matrix_test.ttcn"
TTCN_Logger::log_str(TTCN_USER, "--------------------------------------------");
current_location.update_lineno(149);
#line 149 "CAN_matrix_test.ttcn"
try {
TTCN_Logger::begin_event(TTCN_USER);
CAN__matrix::f__decode__can__matrix(CAN__matrix::f__encode__can__matrix(t__message__Frame1__2.valueof())).log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(150);
#line 150 "CAN_matrix_test.ttcn"
TTCN_Logger::log_str(TTCN_USER, "--------------------------------------------");
current_location.update_lineno(152);
#line 152 "CAN_matrix_test.ttcn"
v__message__Frame2__2.test__sig__11__bit__integer__big__endian__coded() = 2047;
v__message__Frame2__2.test__sig__5__bit__integer__big__endian__coded() = 2;
current_location.update_lineno(159);
#line 159 "CAN_matrix_test.ttcn"
CAN__matrix__messages::CAN__MatrixUnion_template t__message__Frame2__2;
t__message__Frame2__2.can__id() = os_2;
t__message__Frame2__2.can__pdu().message__MyTestframe2() = v__message__Frame2__2;
current_location.update_lineno(165);
#line 165 "CAN_matrix_test.ttcn"
try {
TTCN_Logger::begin_event(TTCN_USER);
CAN__matrix::f__encode__can__matrix(t__message__Frame2__2.valueof()).log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(166);
#line 166 "CAN_matrix_test.ttcn"
TTCN_Logger::log_str(TTCN_USER, "--------------------------------------------");
current_location.update_lineno(167);
#line 167 "CAN_matrix_test.ttcn"
try {
TTCN_Logger::begin_event(TTCN_USER);
CAN__matrix::f__decode__can__matrix(CAN__matrix::f__encode__can__matrix(t__message__Frame2__2.valueof())).log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(168);
#line 168 "CAN_matrix_test.ttcn"
TTCN_Logger::log_str(TTCN_USER, "--------------------------------------------");
current_location.update_lineno(171);
#line 171 "CAN_matrix_test.ttcn"
v__message__Frame3__2.test__sig__1__byte__octetstring__big__endian__coded() = os_5;
v__message__Frame3__2.test__sig__2__byte__octetstring__big__endian__coded() = os_6;
current_location.update_lineno(178);
#line 178 "CAN_matrix_test.ttcn"
CAN__matrix__messages::CAN__MatrixUnion_template t__message__Frame3__2;
t__message__Frame3__2.can__id() = os_4;
t__message__Frame3__2.can__pdu().message__MyTestframe3() = v__message__Frame3__2;
current_location.update_lineno(184);
#line 184 "CAN_matrix_test.ttcn"
try {
TTCN_Logger::begin_event(TTCN_USER);
CAN__matrix::f__encode__can__matrix(t__message__Frame3__2.valueof()).log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(185);
#line 185 "CAN_matrix_test.ttcn"
TTCN_Logger::log_str(TTCN_USER, "--------------------------------------------");
current_location.update_lineno(186);
#line 186 "CAN_matrix_test.ttcn"
try {
TTCN_Logger::begin_event(TTCN_USER);
CAN__matrix::f__decode__can__matrix(CAN__matrix::f__encode__can__matrix(t__message__Frame3__2.valueof())).log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(187);
#line 187 "CAN_matrix_test.ttcn"
TTCN_Logger::log_str(TTCN_USER, "--------------------------------------------");
current_location.update_lineno(189);
#line 189 "CAN_matrix_test.ttcn"
v__message__Frame4__2.test__unsig__9__bit__2__padded__integer__big__endian__coded() = 511;
v__message__Frame4__2.test__sig__5__bit__integer__big__endian__coded() = 8;
current_location.update_lineno(195);
#line 195 "CAN_matrix_test.ttcn"
CAN__matrix__messages::CAN__MatrixUnion_template t__message__Frame4__2;
t__message__Frame4__2.can__id() = os_9;
t__message__Frame4__2.can__pdu().message__MyTestframe4() = v__message__Frame4__2;
current_location.update_lineno(201);
#line 201 "CAN_matrix_test.ttcn"
try {
TTCN_Logger::begin_event(TTCN_USER);
CAN__matrix::f__encode__can__matrix(t__message__Frame4__2.valueof()).log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(202);
#line 202 "CAN_matrix_test.ttcn"
TTCN_Logger::log_str(TTCN_USER, "--------------------------------------------");
current_location.update_lineno(203);
#line 203 "CAN_matrix_test.ttcn"
try {
TTCN_Logger::begin_event(TTCN_USER);
CAN__matrix::f__decode__can__matrix(CAN__matrix::f__encode__can__matrix(t__message__Frame4__2.valueof())).log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(204);
#line 204 "CAN_matrix_test.ttcn"
TTCN_Logger::log_str(TTCN_USER, "--------------------------------------------");
current_location.update_lineno(206);
#line 206 "CAN_matrix_test.ttcn"
v__message__Frame5__2.test__unsig__9__bit__2__padded__integer__big__endian__coded() = 127;
v__message__Frame5__2.test__sig__5__bit__integer__big__endian__coded() = 16;
current_location.update_lineno(212);
#line 212 "CAN_matrix_test.ttcn"
CAN__matrix__messages::CAN__MatrixUnion_template t__message__Frame5__2;
t__message__Frame5__2.can__id() = os_10;
t__message__Frame5__2.can__pdu().message__MyTestframe5() = v__message__Frame5__2;
current_location.update_lineno(218);
#line 218 "CAN_matrix_test.ttcn"
try {
TTCN_Logger::begin_event(TTCN_USER);
CAN__matrix::f__encode__can__matrix(t__message__Frame5__2.valueof()).log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(219);
#line 219 "CAN_matrix_test.ttcn"
TTCN_Logger::log_str(TTCN_USER, "--------------------------------------------");
current_location.update_lineno(220);
#line 220 "CAN_matrix_test.ttcn"
try {
TTCN_Logger::begin_event(TTCN_USER);
CAN__matrix::f__decode__can__matrix(CAN__matrix::f__encode__can__matrix(t__message__Frame5__2.valueof())).log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(221);
#line 221 "CAN_matrix_test.ttcn"
TTCN_Logger::log_str(TTCN_USER, "--------------------------------------------");
current_location.update_lineno(223);
#line 223 "CAN_matrix_test.ttcn"
TTCN_Logger::log_str(TTCN_USER, "********************************************");
current_location.update_lineno(225);
#line 225 "CAN_matrix_test.ttcn"
try {
TTCN_Logger::begin_event(TTCN_USER);
CAN__matrix::f__encode__can__matrix(CAN__matrix__templates::t__message__Frame5__2__parm(7, 1).valueof()).log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(226);
#line 226 "CAN_matrix_test.ttcn"
TTCN_Logger::log_str(TTCN_USER, "--------------------------------------------");
current_location.update_lineno(227);
#line 227 "CAN_matrix_test.ttcn"
try {
TTCN_Logger::begin_event(TTCN_USER);
CAN__matrix::f__decode__can__matrix(CAN__matrix::f__encode__can__matrix(CAN__matrix__templates::t__message__Frame5__2__parm(7, 1).valueof())).log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(228);
#line 228 "CAN_matrix_test.ttcn"
TTCN_Logger::log_str(TTCN_USER, "--------------------------------------------");
current_location.update_lineno(230);
#line 230 "CAN_matrix_test.ttcn"
TTCN_Logger::log_str(TTCN_USER, "********************************************");
current_location.update_lineno(232);
#line 232 "CAN_matrix_test.ttcn"
v__message__extendedFrame1__2.test__sig__2__byte__octetstring__msb__coded() = os_8;
current_location.update_lineno(238);
#line 238 "CAN_matrix_test.ttcn"
CAN__matrix__messages::CAN__MatrixUnion_template t__message__extendedFrame1__2;
t__message__extendedFrame1__2.can__id() = os_7;
t__message__extendedFrame1__2.can__pdu().message__extendedFrame1() = v__message__extendedFrame1__2;
current_location.update_lineno(244);
#line 244 "CAN_matrix_test.ttcn"
try {
TTCN_Logger::begin_event(TTCN_USER);
CAN__matrix::f__encode__can__matrix(t__message__extendedFrame1__2.valueof()).log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(245);
#line 245 "CAN_matrix_test.ttcn"
TTCN_Logger::log_str(TTCN_USER, "--------------------------------------------");
current_location.update_lineno(246);
#line 246 "CAN_matrix_test.ttcn"
try {
TTCN_Logger::begin_event(TTCN_USER);
CAN__matrix::f__decode__can__matrix(CAN__matrix::f__encode__can__matrix(t__message__extendedFrame1__2.valueof())).log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(247);
#line 247 "CAN_matrix_test.ttcn"
TTCN_Logger::log_str(TTCN_USER, "--------------------------------------------");
current_location.update_lineno(249);
#line 249 "CAN_matrix_test.ttcn"
SocketCAN__Types::SocketCAN__CAN__or__CAN__FD__frame v__frame__to__send1;
current_location.update_lineno(249);
#line 249 "CAN_matrix_test.ttcn"
SocketCAN__Types::SocketCAN__CAN__or__CAN__FD__frame v__frame__to__send2;
current_location.update_lineno(253);
#line 253 "CAN_matrix_test.ttcn"
{
Can::CAN__frame& tmp_15 = v__frame__to__send1.can__frame();
tmp_15.can__id() = os_0;
tmp_15.can__pdu() = os_11;
}
current_location.update_lineno(260);
#line 260 "CAN_matrix_test.ttcn"
Can::CAN__frame can__frame;
current_location.update_lineno(262);
#line 262 "CAN_matrix_test.ttcn"
can__frame = const_cast< const SocketCAN__Types::SocketCAN__CAN__or__CAN__FD__frame&>(v__frame__to__send1).can__frame();
current_location.update_lineno(266);
#line 266 "CAN_matrix_test.ttcn"
{
Can::CANFD__frame& tmp_18 = v__frame__to__send2.canfd__frame();
tmp_18.can__id() = os_12;
tmp_18.can__flags() = bs_2;
tmp_18.can__pdu() = os_13;
}
current_location.update_lineno(272);
#line 272 "CAN_matrix_test.ttcn"
TTCN_Runtime::setverdict(PASS);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case tc_encdec was stopped.");
}
return TTCN_Runtime::end_testcase();
}
verdicttype testcase_tc__can__raw__send__and__receive__can__frame(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("CAN_matrix_test.ttcn", 275, TTCN_Location::LOCATION_TESTCASE, "tc_can_raw_send_and_receive_can_frame");
try {
TTCN_Runtime::begin_testcase("CAN_matrix_test", "tc_can_raw_send_and_receive_can_frame", "SocketCANtest", "MTC", "SocketCANtest", "MTC", has_timer, timer_value);
current_location.update_lineno(276);
#line 276 "CAN_matrix_test.ttcn"
COMPONENT v__ptc__rawSendInitiator(TTCN_Runtime::create_component("SocketCANtest", "PTC", "PTC1_ptc_rawSendInitiator", NULL, TRUE));
current_location.update_lineno(277);
#line 277 "CAN_matrix_test.ttcn"
COMPONENT v__ptc__rawFrameReceiver(TTCN_Runtime::create_component("SocketCANtest", "PTC", "PTC2_ptc_rawFrameReceiver", NULL, TRUE));
current_location.update_lineno(279);
#line 279 "CAN_matrix_test.ttcn"
SocketCANtest::f__addSyncSlaveSet(v__ptc__rawSendInitiator, SocketCANtest::MTC_component_v__PTCSet);
current_location.update_lineno(280);
#line 280 "CAN_matrix_test.ttcn"
SocketCANtest::f__addSyncSlaveSet(v__ptc__rawFrameReceiver, SocketCANtest::MTC_component_v__PTCSet);
current_location.update_lineno(281);
#line 281 "CAN_matrix_test.ttcn"
TTCN_Runtime::connect_port(MTC_COMPREF, SocketCANtest::MTC_component_pt__sync.get_name(), v__ptc__rawSendInitiator, SocketCANtest::PTC_component_pt__sync.get_name());
current_location.update_lineno(282);
#line 282 "CAN_matrix_test.ttcn"
TTCN_Runtime::connect_port(MTC_COMPREF, SocketCANtest::MTC_component_pt__sync.get_name(), v__ptc__rawFrameReceiver, SocketCANtest::PTC_component_pt__sync.get_name());
current_location.update_lineno(285);
#line 285 "CAN_matrix_test.ttcn"
CAN__matrix__messages::CAN__MESSAGE__TESTFRAME1__msg__type v__message__Frame1__3;
current_location.update_lineno(287);
#line 287 "CAN_matrix_test.ttcn"
v__message__Frame1__3.test__sig__11__bit__bitstring__big__endian__coded() = bs_0;
v__message__Frame1__3.test__sig__5__bit__bitstring__big__endian__coded() = bs_1;
current_location.update_lineno(294);
#line 294 "CAN_matrix_test.ttcn"
CAN__matrix__messages::CAN__MatrixUnion_template t__message__Frame1__3;
t__message__Frame1__3.can__id() = os_3;
t__message__Frame1__3.can__pdu().message__MyTestframe1() = v__message__Frame1__3;
current_location.update_lineno(300);
#line 300 "CAN_matrix_test.ttcn"
SocketCAN__Types::SocketCAN__CAN__or__CAN__FD__frame v__frame__to__send;
current_location.update_lineno(301);
#line 301 "CAN_matrix_test.ttcn"
v__frame__to__send.can__frame() = CAN__matrix::canmatrixframe2can(t__message__Frame1__3.valueof());
current_location.update_lineno(303);
#line 303 "CAN_matrix_test.ttcn"
SocketCANtest::start_f__ptc__RawSendInitiator(v__ptc__rawSendInitiator, SocketCANtest::e__Phase::e__testbody1, v__frame__to__send);
current_location.update_lineno(304);
#line 304 "CAN_matrix_test.ttcn"
SocketCANtest::start_f__ptc__RawFrameReceiver(v__ptc__rawFrameReceiver, SocketCANtest::e__Phase::e__testbody3, SocketCAN__Types::SocketCAN__CAN__or__CAN__FD__frame_template(v__frame__to__send));
current_location.update_lineno(306);
#line 306 "CAN_matrix_test.ttcn"
SocketCANtest::e__Phase v__phase;
current_location.update_lineno(308);
#line 308 "CAN_matrix_test.ttcn"
v__phase = SocketCANtest::c__firstPhase;
current_location.update_lineno(308);
#line 308 "CAN_matrix_test.ttcn"
for ( ; ; ) {
current_location.update_lineno(308);
#line 308 "CAN_matrix_test.ttcn"
if (!(v__phase < SocketCANtest::e__Phase::e__testcase__complete)) break;
current_location.update_lineno(309);
#line 309 "CAN_matrix_test.ttcn"
SocketCANtest::f__startPhase(v__phase);
current_location.update_lineno(310);
#line 310 "CAN_matrix_test.ttcn"
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("MTC: ");
v__phase.log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(311);
#line 311 "CAN_matrix_test.ttcn"
SocketCANtest::f__awaitEndPhase(v__phase);
current_location.update_lineno(308);
#line 308 "CAN_matrix_test.ttcn"
v__phase = SocketCANtest::f__incMTCPhase(v__phase);
}
current_location.update_lineno(314);
#line 314 "CAN_matrix_test.ttcn"
{
tmp_23:
alt_status alt_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (alt_flag != ALT_NO) {
alt_flag = TTCN_Runtime::component_done(ALL_COMPREF);
if (alt_flag == ALT_YES) break;
else if (alt_flag == ALT_REPEAT) goto tmp_23;
}
if (default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps();
if (default_flag == ALT_YES || default_flag == ALT_BREAK) break;
else if (default_flag == ALT_REPEAT) goto tmp_23;
}
current_location.update_lineno(314);
#line 314 "CAN_matrix_test.ttcn"
if (alt_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("Stand-alone done statement failed in file CAN_matrix_test.ttcn, line 314.");
TTCN_Snapshot::take_new(TRUE);
}
}
current_location.update_lineno(315);
#line 315 "CAN_matrix_test.ttcn"
TTCN_Logger::log_str(TTCN_USER, "MTC done");
current_location.update_lineno(317);
#line 317 "CAN_matrix_test.ttcn"
TTCN_Runtime::disconnect_port(MTC_COMPREF, SocketCANtest::MTC_component_pt__sync.get_name(), v__ptc__rawSendInitiator, SocketCANtest::PTC_component_pt__sync.get_name());
current_location.update_lineno(318);
#line 318 "CAN_matrix_test.ttcn"
TTCN_Runtime::disconnect_port(MTC_COMPREF, SocketCANtest::MTC_component_pt__sync.get_name(), v__ptc__rawFrameReceiver, SocketCANtest::PTC_component_pt__sync.get_name());
current_location.update_lineno(320);
#line 320 "CAN_matrix_test.ttcn"
TTCN_Runtime::kill_component(ALL_COMPREF);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case tc_can_raw_send_and_receive_can_frame was stopped.");
}
return TTCN_Runtime::end_testcase();
}
verdicttype testcase_tc__can__raw__send__and__receive__canfd__frame(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("CAN_matrix_test.ttcn", 323, TTCN_Location::LOCATION_TESTCASE, "tc_can_raw_send_and_receive_canfd_frame");
try {
TTCN_Runtime::begin_testcase("CAN_matrix_test", "tc_can_raw_send_and_receive_canfd_frame", "SocketCANtest", "MTC", "SocketCANtest", "MTC", has_timer, timer_value);
current_location.update_lineno(324);
#line 324 "CAN_matrix_test.ttcn"
COMPONENT v__ptc__rawSendInitiator(TTCN_Runtime::create_component("SocketCANtest", "PTC", "PTC1_ptc_rawSendInitiator", NULL, TRUE));
current_location.update_lineno(325);
#line 325 "CAN_matrix_test.ttcn"
COMPONENT v__ptc__rawFrameReceiver(TTCN_Runtime::create_component("SocketCANtest", "PTC", "PTC2_ptc_rawFrameReceiver", NULL, TRUE));
current_location.update_lineno(328);
#line 328 "CAN_matrix_test.ttcn"
SocketCANtest::f__addSyncSlaveSet(v__ptc__rawSendInitiator, SocketCANtest::MTC_component_v__PTCSet);
current_location.update_lineno(329);
#line 329 "CAN_matrix_test.ttcn"
SocketCANtest::f__addSyncSlaveSet(v__ptc__rawFrameReceiver, SocketCANtest::MTC_component_v__PTCSet);
current_location.update_lineno(331);
#line 331 "CAN_matrix_test.ttcn"
TTCN_Runtime::connect_port(MTC_COMPREF, SocketCANtest::MTC_component_pt__sync.get_name(), v__ptc__rawSendInitiator, SocketCANtest::PTC_component_pt__sync.get_name());
current_location.update_lineno(332);
#line 332 "CAN_matrix_test.ttcn"
TTCN_Runtime::connect_port(MTC_COMPREF, SocketCANtest::MTC_component_pt__sync.get_name(), v__ptc__rawFrameReceiver, SocketCANtest::PTC_component_pt__sync.get_name());
current_location.update_lineno(334);
#line 334 "CAN_matrix_test.ttcn"
SocketCAN__Types::SocketCAN__CAN__or__CAN__FD__frame v__canfd__frame__to__send;
current_location.update_lineno(335);
#line 335 "CAN_matrix_test.ttcn"
{
Can::CANFD__frame& tmp_25 = v__canfd__frame__to__send.canfd__frame();
tmp_25.can__id() = os_12;
tmp_25.can__flags() = bs_3;
tmp_25.can__pdu() = os_13;
}
current_location.update_lineno(341);
#line 341 "CAN_matrix_test.ttcn"
CANFD__matrix__messages::CANFD__MESSAGE__TESTFRAME1__msg__type v__message__Frame1__4;
current_location.update_lineno(343);
#line 343 "CAN_matrix_test.ttcn"
v__message__Frame1__4.test__sig__11__bit__bitstring__msb__coded() = bs_0;
v__message__Frame1__4.test__sig__5__bit__bitstring__msb__coded() = bs_1;
current_location.update_lineno(350);
#line 350 "CAN_matrix_test.ttcn"
CANFD__matrix__messages::CANFD__MatrixUnion_template t__message__Frame1__4;
t__message__Frame1__4.can__id() = os_3;
t__message__Frame1__4.can__flags() = bs_3;
t__message__Frame1__4.can__pdu().message__MyTestframe1() = v__message__Frame1__4;
current_location.update_lineno(357);
#line 357 "CAN_matrix_test.ttcn"
SocketCAN__Types::SocketCAN__CAN__or__CAN__FD__frame v__frame__to__send;
current_location.update_lineno(358);
#line 358 "CAN_matrix_test.ttcn"
v__frame__to__send.canfd__frame() = CAN__matrix::canfdmatrixframe2canfd(t__message__Frame1__4.valueof());
current_location.update_lineno(361);
#line 361 "CAN_matrix_test.ttcn"
SocketCANtest::start_f__ptc__RawSendInitiator(v__ptc__rawSendInitiator, SocketCANtest::e__Phase::e__testbody2, v__canfd__frame__to__send);
current_location.update_lineno(362);
#line 362 "CAN_matrix_test.ttcn"
SocketCANtest::start_f__ptc__RawFrameReceiver(v__ptc__rawFrameReceiver, SocketCANtest::e__Phase::e__testbody3, SocketCAN__Types::SocketCAN__CAN__or__CAN__FD__frame_template(v__canfd__frame__to__send));
current_location.update_lineno(364);
#line 364 "CAN_matrix_test.ttcn"
SocketCANtest::e__Phase v__phase;
current_location.update_lineno(366);
#line 366 "CAN_matrix_test.ttcn"
v__phase = SocketCANtest::c__firstPhase;
current_location.update_lineno(366);
#line 366 "CAN_matrix_test.ttcn"
for ( ; ; ) {
current_location.update_lineno(366);
#line 366 "CAN_matrix_test.ttcn"
if (!(v__phase < SocketCANtest::e__Phase::e__testcase__complete)) break;
current_location.update_lineno(367);
#line 367 "CAN_matrix_test.ttcn"
SocketCANtest::f__startPhase(v__phase);
current_location.update_lineno(368);
#line 368 "CAN_matrix_test.ttcn"
try {
TTCN_Logger::begin_event(TTCN_USER);
TTCN_Logger::log_event_str("MTC: ");
v__phase.log();
TTCN_Logger::end_event();
} catch (...) {
TTCN_Logger::finish_event();
throw;
}
current_location.update_lineno(369);
#line 369 "CAN_matrix_test.ttcn"
SocketCANtest::f__awaitEndPhase(v__phase);
current_location.update_lineno(366);
#line 366 "CAN_matrix_test.ttcn"
v__phase = SocketCANtest::f__incMTCPhase(v__phase);
}
current_location.update_lineno(372);
#line 372 "CAN_matrix_test.ttcn"
{
tmp_30:
alt_status alt_flag = ALT_UNCHECKED, default_flag = ALT_UNCHECKED;
TTCN_Snapshot::take_new(FALSE);
for ( ; ; ) {
if (alt_flag != ALT_NO) {
alt_flag = TTCN_Runtime::component_done(ALL_COMPREF);
if (alt_flag == ALT_YES) break;
else if (alt_flag == ALT_REPEAT) goto tmp_30;
}
if (default_flag != ALT_NO) {
default_flag = TTCN_Default::try_altsteps();
if (default_flag == ALT_YES || default_flag == ALT_BREAK) break;
else if (default_flag == ALT_REPEAT) goto tmp_30;
}
current_location.update_lineno(372);
#line 372 "CAN_matrix_test.ttcn"
if (alt_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("Stand-alone done statement failed in file CAN_matrix_test.ttcn, line 372.");
TTCN_Snapshot::take_new(TRUE);
}
}
current_location.update_lineno(373);
#line 373 "CAN_matrix_test.ttcn"
TTCN_Logger::log_str(TTCN_USER, "MTC done");
current_location.update_lineno(376);
#line 376 "CAN_matrix_test.ttcn"
TTCN_Runtime::disconnect_port(MTC_COMPREF, SocketCANtest::MTC_component_pt__sync.get_name(), v__ptc__rawSendInitiator, SocketCANtest::PTC_component_pt__sync.get_name());
current_location.update_lineno(377);
#line 377 "CAN_matrix_test.ttcn"
TTCN_Runtime::disconnect_port(MTC_COMPREF, SocketCANtest::MTC_component_pt__sync.get_name(), v__ptc__rawFrameReceiver, SocketCANtest::PTC_component_pt__sync.get_name());
current_location.update_lineno(379);
#line 379 "CAN_matrix_test.ttcn"
TTCN_Runtime::kill_component(ALL_COMPREF);
} catch (const TC_Error& tc_error) {
} catch (const TC_End& tc_end) {
TTCN_Logger::log_str(TTCN_FUNCTION, "Test case tc_can_raw_send_and_receive_canfd_frame was stopped.");
}
return TTCN_Runtime::end_testcase();
}
/* Bodies of static functions */
static void pre_init_module()
{
TTCN_Location current_location("CAN_matrix_test.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "CAN_matrix_test");
CanError::module_object.pre_init_module();
SocketCANtest::module_object.pre_init_module();
CAN__matrix__templates::module_object.pre_init_module();
module_object.add_testcase_nonpard("tc_encdec", testcase_tc__encdec);
module_object.add_testcase_nonpard("tc_can_raw_send_and_receive_can_frame", testcase_tc__can__raw__send__and__receive__can__frame);
module_object.add_testcase_nonpard("tc_can_raw_send_and_receive_canfd_frame", testcase_tc__can__raw__send__and__receive__canfd__frame);
}
static void post_init_module()
{
TTCN_Location current_location("CAN_matrix_test.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "CAN_matrix_test");
CanError::module_object.post_init_module();
SocketCANtest::module_object.post_init_module();
CAN__matrix__templates::module_object.post_init_module();
}
static boolean init_comp_type(const char *component_type, boolean init_base_comps)
{
(void)init_base_comps;
if (!strcmp(component_type, "MTC_CT")) {
return TRUE;
} else return FALSE;
}
} /* end of namespace */