blob: eade0a8b577714265cc3cfcaec646a01fa4f4402 [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 "SocketCAN_BCM_test.hh"
namespace SocketCAN__BCM__test {
/* Prototypes of static functions */
static void pre_init_module();
static void post_init_module();
/* Literal string constants */
static const unsigned char bs_1_bits[] = { 0, 0, 0, 0 },
bs_0_bits[] = { 0, 0, 0, 192 },
bs_5_bits[] = { 0, 0, 0, 200 },
bs_4_bits[] = { 16, 0, 0, 0 },
bs_3_bits[] = { 170 },
bs_2_bits[] = { 85 };
static const BITSTRING bs_1(32, bs_1_bits),
bs_0(32, bs_0_bits),
bs_5(32, bs_5_bits),
bs_4(32, bs_4_bits),
bs_3(8, bs_3_bits),
bs_2(8, bs_2_bits);
static const unsigned char os_0_octets[] = { 0, 0, 0, 1 },
os_2_octets[] = { 0, 0, 0, 2 },
os_4_octets[] = { 0, 0, 0, 3 },
os_6_octets[] = { 0, 0, 0, 4 },
os_8_octets[] = { 0, 0, 0, 5 },
os_11_octets[] = { 0, 0, 0, 17 },
os_12_octets[] = { 0, 0, 0, 18 },
os_14_octets[] = { 0, 0, 0, 19 },
os_16_octets[] = { 0, 0, 0, 20 },
os_18_octets[] = { 0, 0, 0, 21 },
os_10_octets[] = { 0, 0, 0, 66 },
os_19_octets[] = { 1, 35 },
os_1_octets[] = { 17, 17, 17, 17, 17, 17, 17, 17 },
os_3_octets[] = { 34, 34, 34, 34, 34, 34, 34, 34 },
os_13_octets[] = { 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34 },
os_5_octets[] = { 51, 51, 51, 51, 51, 51, 51, 51 },
os_7_octets[] = { 68, 68, 68, 68, 68, 68, 68, 68 },
os_15_octets[] = { 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68 },
os_9_octets[] = { 85, 85, 85, 85, 85, 85, 85, 85 },
os_17_octets[] = { 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85 };
static const OCTETSTRING os_0(4, os_0_octets),
os_2(4, os_2_octets),
os_4(4, os_4_octets),
os_6(4, os_6_octets),
os_8(4, os_8_octets),
os_11(4, os_11_octets),
os_12(4, os_12_octets),
os_14(4, os_14_octets),
os_16(4, os_16_octets),
os_18(4, os_18_octets),
os_10(4, os_10_octets),
os_19(2, os_19_octets),
os_1(8, os_1_octets),
os_3(8, os_3_octets),
os_13(16, os_13_octets),
os_5(8, os_5_octets),
os_7(8, os_7_octets),
os_15(32, os_15_octets),
os_9(8, os_9_octets),
os_17(64, os_17_octets);
static const unsigned char module_checksum[] = { 0xd5, 0x0d, 0xc3, 0xa4, 0x67, 0xdf, 0xba, 0xf8, 0xbe, 0x94, 0xb3, 0xbb, 0xb5, 0x01, 0x4e, 0x58 };
/* Global variable definitions */
TTCN_Module module_object("SocketCAN_BCM_test", __DATE__, __TIME__, module_checksum, pre_init_module, NULL, 0U, 4294967295U, 4294967295U, 4294967295U, NULL, 0LU, 0, post_init_module, NULL, NULL, NULL, NULL, 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 */
SocketCAN__Types::SocketCAN__CAN__or__CAN__FD__frame_template a__CAN__frame(const Can::CAN__frame_template& p__can__frame)
{
TTCN_Location current_location("SocketCAN_BCM_test.ttcn", 22, TTCN_Location::LOCATION_TEMPLATE, "a_CAN_frame");
SocketCAN__Types::SocketCAN__CAN__or__CAN__FD__frame_template ret_val;
ret_val.can__frame() = p__can__frame;
return ret_val;
}
verdicttype testcase_tc__can__bcm__TX__SETUP__TX__DELETE__can__frame(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("SocketCAN_BCM_test.ttcn", 24, TTCN_Location::LOCATION_TESTCASE, "tc_can_bcm_TX_SETUP_TX_DELETE_can_frame");
try {
TTCN_Runtime::begin_testcase("SocketCAN_BCM_test", "tc_can_bcm_TX_SETUP_TX_DELETE_can_frame", "SocketCANtest", "MTC", "SocketCANtest", "MTC", has_timer, timer_value);
current_location.update_lineno(28);
#line 28 "SocketCAN_BCM_test.ttcn"
COMPONENT v__ptc__bcmConfigurator(TTCN_Runtime::create_component("SocketCANtest", "PTC", "PTC1_ptc_bcmConfigurator", NULL, TRUE));
current_location.update_lineno(29);
#line 29 "SocketCAN_BCM_test.ttcn"
COMPONENT v__ptc__rawFrameReceiver1(TTCN_Runtime::create_component("SocketCANtest", "PTC", "PTC2_ptc_rawFrameReceiver1", NULL, TRUE));
current_location.update_lineno(30);
#line 30 "SocketCAN_BCM_test.ttcn"
COMPONENT v__ptc__rawFrameReceiver2(TTCN_Runtime::create_component("SocketCANtest", "PTC", "PTC2_ptc_rawFrameReceiver2", NULL, TRUE));
current_location.update_lineno(32);
#line 32 "SocketCAN_BCM_test.ttcn"
SocketCANtest::f__addSyncSlaveSet(v__ptc__bcmConfigurator, SocketCANtest::MTC_component_v__PTCSet);
current_location.update_lineno(33);
#line 33 "SocketCAN_BCM_test.ttcn"
SocketCANtest::f__addSyncSlaveSet(v__ptc__rawFrameReceiver1, SocketCANtest::MTC_component_v__PTCSet);
current_location.update_lineno(34);
#line 34 "SocketCAN_BCM_test.ttcn"
SocketCANtest::f__addSyncSlaveSet(v__ptc__rawFrameReceiver2, SocketCANtest::MTC_component_v__PTCSet);
current_location.update_lineno(35);
#line 35 "SocketCAN_BCM_test.ttcn"
TTCN_Runtime::connect_port(MTC_COMPREF, SocketCANtest::MTC_component_pt__sync.get_name(), v__ptc__bcmConfigurator, SocketCANtest::PTC_component_pt__sync.get_name());
current_location.update_lineno(36);
#line 36 "SocketCAN_BCM_test.ttcn"
TTCN_Runtime::connect_port(MTC_COMPREF, SocketCANtest::MTC_component_pt__sync.get_name(), v__ptc__rawFrameReceiver1, SocketCANtest::PTC_component_pt__sync.get_name());
current_location.update_lineno(37);
#line 37 "SocketCAN_BCM_test.ttcn"
TTCN_Runtime::connect_port(MTC_COMPREF, SocketCANtest::MTC_component_pt__sync.get_name(), v__ptc__rawFrameReceiver2, SocketCANtest::PTC_component_pt__sync.get_name());
current_location.update_lineno(39);
#line 39 "SocketCAN_BCM_test.ttcn"
Can::CAN__frame v__can__frame1;
current_location.update_lineno(39);
#line 39 "SocketCAN_BCM_test.ttcn"
Can::CAN__frame v__can__frame2;
current_location.update_lineno(39);
#line 39 "SocketCAN_BCM_test.ttcn"
Can::CAN__frame v__can__frame3;
current_location.update_lineno(39);
#line 39 "SocketCAN_BCM_test.ttcn"
Can::CAN__frame v__can__frame4;
current_location.update_lineno(39);
#line 39 "SocketCAN_BCM_test.ttcn"
Can::CAN__frame v__can__frame5;
current_location.update_lineno(40);
#line 40 "SocketCAN_BCM_test.ttcn"
Can::CANFD__frame v__canfd__frame1;
current_location.update_lineno(42);
#line 42 "SocketCAN_BCM_test.ttcn"
Bcm::SocketCAN__bcm__frame v__bcm__activation__frame;
current_location.update_lineno(42);
#line 42 "SocketCAN_BCM_test.ttcn"
Bcm::SocketCAN__bcm__frame v__bcm__deactivation__frame;
current_location.update_lineno(44);
#line 44 "SocketCAN_BCM_test.ttcn"
v__can__frame1.can__id() = os_0;
v__can__frame1.can__pdu() = os_1;
current_location.update_lineno(45);
#line 45 "SocketCAN_BCM_test.ttcn"
v__can__frame2.can__id() = os_2;
v__can__frame2.can__pdu() = os_3;
current_location.update_lineno(46);
#line 46 "SocketCAN_BCM_test.ttcn"
v__can__frame3.can__id() = os_4;
v__can__frame3.can__pdu() = os_5;
current_location.update_lineno(47);
#line 47 "SocketCAN_BCM_test.ttcn"
v__can__frame4.can__id() = os_6;
v__can__frame4.can__pdu() = os_7;
current_location.update_lineno(48);
#line 48 "SocketCAN_BCM_test.ttcn"
v__can__frame5.can__id() = os_8;
v__can__frame5.can__pdu() = os_9;
current_location.update_lineno(50);
#line 50 "SocketCAN_BCM_test.ttcn"
SocketCANtest::SocketCAN__CAN__or__CAN__FD__frames_template a__expected__can__frames;
a__expected__can__frames.set_size(10);
a__expected__can__frames[0].can__frame() = v__can__frame1;
a__expected__can__frames[1].can__frame() = v__can__frame2;
a__expected__can__frames[2].can__frame() = v__can__frame3;
a__expected__can__frames[3].can__frame() = v__can__frame4;
a__expected__can__frames[4].can__frame() = v__can__frame5;
a__expected__can__frames[5].can__frame() = v__can__frame1;
a__expected__can__frames[6].can__frame() = v__can__frame2;
a__expected__can__frames[7].can__frame() = v__can__frame3;
a__expected__can__frames[8].can__frame() = v__can__frame4;
a__expected__can__frames[9].can__frame() = v__can__frame5;
current_location.update_lineno(63);
#line 63 "SocketCAN_BCM_test.ttcn"
v__bcm__activation__frame.opcode() = os_0;
v__bcm__activation__frame.flags() = bs_0;
v__bcm__activation__frame.count() = 0;
{
Bcm::Bcm__timeval& tmp_6 = v__bcm__activation__frame.ival1();
tmp_6.tv__sec() = 0;
tmp_6.tv__usec() = 0;
}
{
Bcm::Bcm__timeval& tmp_7 = v__bcm__activation__frame.ival2();
tmp_7.tv__sec() = 0;
tmp_7.tv__usec() = 100000;
}
v__bcm__activation__frame.can__id() = os_10;
{
Bcm::SocketCAN__bcm__frame_frames_can__frame& tmp_8 = v__bcm__activation__frame.frames().can__frame();
tmp_8.set_size(5);
tmp_8[0] = v__can__frame1;
tmp_8[1] = v__can__frame2;
tmp_8[2] = v__can__frame3;
tmp_8[3] = v__can__frame4;
tmp_8[4] = v__can__frame5;
}
current_location.update_lineno(78);
#line 78 "SocketCAN_BCM_test.ttcn"
v__bcm__deactivation__frame.opcode() = os_2;
v__bcm__deactivation__frame.flags() = bs_1;
v__bcm__deactivation__frame.count() = 0;
{
Bcm::Bcm__timeval& tmp_10 = v__bcm__deactivation__frame.ival1();
tmp_10.tv__sec() = 0;
tmp_10.tv__usec() = 0;
}
{
Bcm::Bcm__timeval& tmp_11 = v__bcm__deactivation__frame.ival2();
tmp_11.tv__sec() = 0;
tmp_11.tv__usec() = 0;
}
v__bcm__deactivation__frame.can__id() = os_10;
v__bcm__deactivation__frame.frames().can__frame() = NULL_VALUE;
current_location.update_lineno(88);
#line 88 "SocketCAN_BCM_test.ttcn"
SocketCANtest::BCM__cmds v__cmds;
v__cmds.set_size(2);
{
SocketCANtest::BCM__cmd& tmp_12 = v__cmds[0];
tmp_12.phase() = SocketCANtest::e__Phase::e__testbody2;
tmp_12.bcm__frame() = v__bcm__activation__frame;
}
{
SocketCANtest::BCM__cmd& tmp_13 = v__cmds[1];
tmp_13.phase() = SocketCANtest::e__Phase::e__testbody5;
tmp_13.bcm__frame() = v__bcm__deactivation__frame;
}
current_location.update_lineno(94);
#line 94 "SocketCAN_BCM_test.ttcn"
SocketCANtest::start_f__ptc__bcmComandSendInitiator(v__ptc__bcmConfigurator, v__cmds);
current_location.update_lineno(96);
#line 96 "SocketCAN_BCM_test.ttcn"
SocketCAN__Types::SocketCAN__CAN__or__CAN__FD__frame v__frame__to__receive1;
current_location.update_lineno(96);
#line 96 "SocketCAN_BCM_test.ttcn"
SocketCAN__Types::SocketCAN__CAN__or__CAN__FD__frame v__frame__to__receive5;
current_location.update_lineno(97);
#line 97 "SocketCAN_BCM_test.ttcn"
v__frame__to__receive1.can__frame() = v__can__frame1;
current_location.update_lineno(98);
#line 98 "SocketCAN_BCM_test.ttcn"
v__frame__to__receive5.can__frame() = v__can__frame5;
current_location.update_lineno(101);
#line 101 "SocketCAN_BCM_test.ttcn"
SocketCANtest::start_f__ptc__RawFrameReceiver(v__ptc__rawFrameReceiver1, SocketCANtest::e__Phase::e__testbody3, SocketCAN__Types::SocketCAN__CAN__or__CAN__FD__frame_template(v__frame__to__receive1));
current_location.update_lineno(104);
#line 104 "SocketCAN_BCM_test.ttcn"
SocketCANtest::start_f__ptc__RawFrameSequenceReceiver(v__ptc__rawFrameReceiver2, SocketCANtest::e__Phase::e__testbody4, a__expected__can__frames, SocketCANtest::e__Phase::e__testbody5, 2.0);
current_location.update_lineno(106);
#line 106 "SocketCAN_BCM_test.ttcn"
SocketCANtest::e__Phase v__phase;
current_location.update_lineno(108);
#line 108 "SocketCAN_BCM_test.ttcn"
v__phase = SocketCANtest::c__firstPhase;
current_location.update_lineno(108);
#line 108 "SocketCAN_BCM_test.ttcn"
for ( ; ; ) {
current_location.update_lineno(108);
#line 108 "SocketCAN_BCM_test.ttcn"
if (!(v__phase < SocketCANtest::e__Phase::e__testcase__complete)) break;
current_location.update_lineno(109);
#line 109 "SocketCAN_BCM_test.ttcn"
SocketCANtest::f__startPhase(v__phase);
current_location.update_lineno(110);
#line 110 "SocketCAN_BCM_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(111);
#line 111 "SocketCAN_BCM_test.ttcn"
SocketCANtest::f__awaitEndPhase(v__phase);
current_location.update_lineno(108);
#line 108 "SocketCAN_BCM_test.ttcn"
v__phase = SocketCANtest::f__incMTCPhase(v__phase);
}
current_location.update_lineno(115);
#line 115 "SocketCAN_BCM_test.ttcn"
{
tmp_18:
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_18;
}
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_18;
}
current_location.update_lineno(115);
#line 115 "SocketCAN_BCM_test.ttcn"
if (alt_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("Stand-alone done statement failed in file SocketCAN_BCM_test.ttcn, line 115.");
TTCN_Snapshot::take_new(TRUE);
}
}
current_location.update_lineno(116);
#line 116 "SocketCAN_BCM_test.ttcn"
TTCN_Logger::log_str(TTCN_USER, "MTC done");
current_location.update_lineno(118);
#line 118 "SocketCAN_BCM_test.ttcn"
TTCN_Runtime::disconnect_port(MTC_COMPREF, SocketCANtest::MTC_component_pt__sync.get_name(), v__ptc__bcmConfigurator, SocketCANtest::PTC_component_pt__sync.get_name());
current_location.update_lineno(119);
#line 119 "SocketCAN_BCM_test.ttcn"
TTCN_Runtime::disconnect_port(MTC_COMPREF, SocketCANtest::MTC_component_pt__sync.get_name(), v__ptc__rawFrameReceiver1, SocketCANtest::PTC_component_pt__sync.get_name());
current_location.update_lineno(120);
#line 120 "SocketCAN_BCM_test.ttcn"
TTCN_Runtime::disconnect_port(MTC_COMPREF, SocketCANtest::MTC_component_pt__sync.get_name(), v__ptc__rawFrameReceiver2, SocketCANtest::PTC_component_pt__sync.get_name());
current_location.update_lineno(122);
#line 122 "SocketCAN_BCM_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_bcm_TX_SETUP_TX_DELETE_can_frame was stopped.");
}
return TTCN_Runtime::end_testcase();
}
verdicttype testcase_tc__can__bcm__TX__SETUP__TX__DELETE__canfd__frame(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("SocketCAN_BCM_test.ttcn", 125, TTCN_Location::LOCATION_TESTCASE, "tc_can_bcm_TX_SETUP_TX_DELETE_canfd_frame");
try {
TTCN_Runtime::begin_testcase("SocketCAN_BCM_test", "tc_can_bcm_TX_SETUP_TX_DELETE_canfd_frame", "SocketCANtest", "MTC", "SocketCANtest", "MTC", has_timer, timer_value);
current_location.update_lineno(129);
#line 129 "SocketCAN_BCM_test.ttcn"
COMPONENT v__ptc__bcmConfigurator(TTCN_Runtime::create_component("SocketCANtest", "PTC", "PTC1_ptc_bcmConfigurator", NULL, TRUE));
current_location.update_lineno(130);
#line 130 "SocketCAN_BCM_test.ttcn"
COMPONENT v__ptc__rawFrameReceiver1(TTCN_Runtime::create_component("SocketCANtest", "PTC", "PTC2_ptc_rawFrameReceiver1", NULL, TRUE));
current_location.update_lineno(131);
#line 131 "SocketCAN_BCM_test.ttcn"
COMPONENT v__ptc__rawFrameReceiver2(TTCN_Runtime::create_component("SocketCANtest", "PTC", "PTC2_ptc_rawFrameReceiver2", NULL, TRUE));
current_location.update_lineno(133);
#line 133 "SocketCAN_BCM_test.ttcn"
SocketCANtest::f__addSyncSlaveSet(v__ptc__bcmConfigurator, SocketCANtest::MTC_component_v__PTCSet);
current_location.update_lineno(134);
#line 134 "SocketCAN_BCM_test.ttcn"
SocketCANtest::f__addSyncSlaveSet(v__ptc__rawFrameReceiver1, SocketCANtest::MTC_component_v__PTCSet);
current_location.update_lineno(135);
#line 135 "SocketCAN_BCM_test.ttcn"
SocketCANtest::f__addSyncSlaveSet(v__ptc__rawFrameReceiver2, SocketCANtest::MTC_component_v__PTCSet);
current_location.update_lineno(136);
#line 136 "SocketCAN_BCM_test.ttcn"
TTCN_Runtime::connect_port(MTC_COMPREF, SocketCANtest::MTC_component_pt__sync.get_name(), v__ptc__bcmConfigurator, SocketCANtest::PTC_component_pt__sync.get_name());
current_location.update_lineno(137);
#line 137 "SocketCAN_BCM_test.ttcn"
TTCN_Runtime::connect_port(MTC_COMPREF, SocketCANtest::MTC_component_pt__sync.get_name(), v__ptc__rawFrameReceiver1, SocketCANtest::PTC_component_pt__sync.get_name());
current_location.update_lineno(138);
#line 138 "SocketCAN_BCM_test.ttcn"
TTCN_Runtime::connect_port(MTC_COMPREF, SocketCANtest::MTC_component_pt__sync.get_name(), v__ptc__rawFrameReceiver2, SocketCANtest::PTC_component_pt__sync.get_name());
current_location.update_lineno(140);
#line 140 "SocketCAN_BCM_test.ttcn"
Can::CANFD__frame v__canfd__frame1;
current_location.update_lineno(140);
#line 140 "SocketCAN_BCM_test.ttcn"
Can::CANFD__frame v__canfd__frame2;
current_location.update_lineno(140);
#line 140 "SocketCAN_BCM_test.ttcn"
Can::CANFD__frame v__canfd__frame3;
current_location.update_lineno(140);
#line 140 "SocketCAN_BCM_test.ttcn"
Can::CANFD__frame v__canfd__frame4;
current_location.update_lineno(140);
#line 140 "SocketCAN_BCM_test.ttcn"
Can::CANFD__frame v__canfd__frame5;
current_location.update_lineno(142);
#line 142 "SocketCAN_BCM_test.ttcn"
Bcm::SocketCAN__bcm__frame v__bcm__activation__frame;
current_location.update_lineno(142);
#line 142 "SocketCAN_BCM_test.ttcn"
Bcm::SocketCAN__bcm__frame v__bcm__deactivation__frame;
current_location.update_lineno(144);
#line 144 "SocketCAN_BCM_test.ttcn"
v__canfd__frame1.can__id() = os_11;
v__canfd__frame1.can__flags() = bs_2;
v__canfd__frame1.can__pdu() = os_1;
current_location.update_lineno(150);
#line 150 "SocketCAN_BCM_test.ttcn"
v__canfd__frame2.can__id() = os_12;
v__canfd__frame2.can__flags() = bs_2;
v__canfd__frame2.can__pdu() = os_13;
current_location.update_lineno(156);
#line 156 "SocketCAN_BCM_test.ttcn"
v__canfd__frame3.can__id() = os_14;
v__canfd__frame3.can__flags() = bs_2;
v__canfd__frame3.can__pdu() = os_15;
current_location.update_lineno(162);
#line 162 "SocketCAN_BCM_test.ttcn"
v__canfd__frame4.can__id() = os_16;
v__canfd__frame4.can__flags() = bs_2;
v__canfd__frame4.can__pdu() = os_17;
current_location.update_lineno(168);
#line 168 "SocketCAN_BCM_test.ttcn"
v__canfd__frame5.can__id() = os_18;
v__canfd__frame5.can__flags() = bs_3;
v__canfd__frame5.can__pdu() = os_19;
current_location.update_lineno(174);
#line 174 "SocketCAN_BCM_test.ttcn"
SocketCANtest::SocketCAN__CAN__or__CAN__FD__frames_template a__expected__can__frames;
a__expected__can__frames.set_size(5);
a__expected__can__frames[0].canfd__frame() = v__canfd__frame1;
a__expected__can__frames[1].canfd__frame() = v__canfd__frame2;
a__expected__can__frames[2].canfd__frame() = v__canfd__frame3;
a__expected__can__frames[3].canfd__frame() = v__canfd__frame4;
a__expected__can__frames[4].canfd__frame() = v__canfd__frame5;
current_location.update_lineno(182);
#line 182 "SocketCAN_BCM_test.ttcn"
v__bcm__activation__frame.opcode() = os_0;
v__bcm__activation__frame.flags() = bs_0;
v__bcm__activation__frame.count() = 0;
{
Bcm::Bcm__timeval& tmp_25 = v__bcm__activation__frame.ival1();
tmp_25.tv__sec() = 0;
tmp_25.tv__usec() = 0;
}
{
Bcm::Bcm__timeval& tmp_26 = v__bcm__activation__frame.ival2();
tmp_26.tv__sec() = 0;
tmp_26.tv__usec() = 100000;
}
v__bcm__activation__frame.can__id() = os_10;
{
Bcm::SocketCAN__bcm__frame_frames_canfd__frame& tmp_27 = v__bcm__activation__frame.frames().canfd__frame();
tmp_27.set_size(5);
tmp_27[0] = v__canfd__frame1;
tmp_27[1] = v__canfd__frame2;
tmp_27[2] = v__canfd__frame3;
tmp_27[3] = v__canfd__frame4;
tmp_27[4] = v__canfd__frame5;
}
current_location.update_lineno(199);
#line 199 "SocketCAN_BCM_test.ttcn"
v__bcm__deactivation__frame.opcode() = os_2;
v__bcm__deactivation__frame.flags() = bs_4;
v__bcm__deactivation__frame.count() = 0;
{
Bcm::Bcm__timeval& tmp_29 = v__bcm__deactivation__frame.ival1();
tmp_29.tv__sec() = 0;
tmp_29.tv__usec() = 0;
}
{
Bcm::Bcm__timeval& tmp_30 = v__bcm__deactivation__frame.ival2();
tmp_30.tv__sec() = 0;
tmp_30.tv__usec() = 0;
}
v__bcm__deactivation__frame.can__id() = os_10;
v__bcm__deactivation__frame.frames().canfd__frame() = NULL_VALUE;
current_location.update_lineno(211);
#line 211 "SocketCAN_BCM_test.ttcn"
SocketCANtest::BCM__cmds v__cmds;
v__cmds.set_size(2);
{
SocketCANtest::BCM__cmd& tmp_31 = v__cmds[0];
tmp_31.phase() = SocketCANtest::e__Phase::e__testbody2;
tmp_31.bcm__frame() = v__bcm__activation__frame;
}
{
SocketCANtest::BCM__cmd& tmp_32 = v__cmds[1];
tmp_32.phase() = SocketCANtest::e__Phase::e__testbody5;
tmp_32.bcm__frame() = v__bcm__deactivation__frame;
}
current_location.update_lineno(217);
#line 217 "SocketCAN_BCM_test.ttcn"
SocketCANtest::start_f__ptc__bcmComandSendInitiator(v__ptc__bcmConfigurator, v__cmds);
current_location.update_lineno(219);
#line 219 "SocketCAN_BCM_test.ttcn"
SocketCAN__Types::SocketCAN__CAN__or__CAN__FD__frame v__frame__to__receive1;
current_location.update_lineno(221);
#line 221 "SocketCAN_BCM_test.ttcn"
v__frame__to__receive1.canfd__frame() = v__canfd__frame1;
current_location.update_lineno(225);
#line 225 "SocketCAN_BCM_test.ttcn"
SocketCANtest::start_f__ptc__RawFrameReceiver(v__ptc__rawFrameReceiver1, SocketCANtest::e__Phase::e__testbody3, SocketCAN__Types::SocketCAN__CAN__or__CAN__FD__frame_template(v__frame__to__receive1));
current_location.update_lineno(228);
#line 228 "SocketCAN_BCM_test.ttcn"
SocketCANtest::start_f__ptc__RawFrameSequenceReceiver(v__ptc__rawFrameReceiver2, SocketCANtest::e__Phase::e__testbody4, a__expected__can__frames, SocketCANtest::e__Phase::e__testbody5, 2.0);
current_location.update_lineno(230);
#line 230 "SocketCAN_BCM_test.ttcn"
SocketCANtest::e__Phase v__phase;
current_location.update_lineno(232);
#line 232 "SocketCAN_BCM_test.ttcn"
v__phase = SocketCANtest::c__firstPhase;
current_location.update_lineno(232);
#line 232 "SocketCAN_BCM_test.ttcn"
for ( ; ; ) {
current_location.update_lineno(232);
#line 232 "SocketCAN_BCM_test.ttcn"
if (!(v__phase < SocketCANtest::e__Phase::e__testcase__complete)) break;
current_location.update_lineno(233);
#line 233 "SocketCAN_BCM_test.ttcn"
SocketCANtest::f__startPhase(v__phase);
current_location.update_lineno(234);
#line 234 "SocketCAN_BCM_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(235);
#line 235 "SocketCAN_BCM_test.ttcn"
SocketCANtest::f__awaitEndPhase(v__phase);
current_location.update_lineno(232);
#line 232 "SocketCAN_BCM_test.ttcn"
v__phase = SocketCANtest::f__incMTCPhase(v__phase);
}
current_location.update_lineno(239);
#line 239 "SocketCAN_BCM_test.ttcn"
{
tmp_36:
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_36;
}
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_36;
}
current_location.update_lineno(239);
#line 239 "SocketCAN_BCM_test.ttcn"
if (alt_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("Stand-alone done statement failed in file SocketCAN_BCM_test.ttcn, line 239.");
TTCN_Snapshot::take_new(TRUE);
}
}
current_location.update_lineno(240);
#line 240 "SocketCAN_BCM_test.ttcn"
TTCN_Logger::log_str(TTCN_USER, "MTC done");
current_location.update_lineno(242);
#line 242 "SocketCAN_BCM_test.ttcn"
TTCN_Runtime::disconnect_port(MTC_COMPREF, SocketCANtest::MTC_component_pt__sync.get_name(), v__ptc__bcmConfigurator, SocketCANtest::PTC_component_pt__sync.get_name());
current_location.update_lineno(243);
#line 243 "SocketCAN_BCM_test.ttcn"
TTCN_Runtime::disconnect_port(MTC_COMPREF, SocketCANtest::MTC_component_pt__sync.get_name(), v__ptc__rawFrameReceiver1, SocketCANtest::PTC_component_pt__sync.get_name());
current_location.update_lineno(244);
#line 244 "SocketCAN_BCM_test.ttcn"
TTCN_Runtime::disconnect_port(MTC_COMPREF, SocketCANtest::MTC_component_pt__sync.get_name(), v__ptc__rawFrameReceiver2, SocketCANtest::PTC_component_pt__sync.get_name());
current_location.update_lineno(246);
#line 246 "SocketCAN_BCM_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_bcm_TX_SETUP_TX_DELETE_canfd_frame was stopped.");
}
return TTCN_Runtime::end_testcase();
}
verdicttype testcase_tc__can__bcm__TX__SETUP__TX__READ(boolean has_timer, double timer_value)
{
TTCN_Runtime::check_begin_testcase(has_timer, timer_value);
TTCN_Location current_location("SocketCAN_BCM_test.ttcn", 250, TTCN_Location::LOCATION_TESTCASE, "tc_can_bcm_TX_SETUP_TX_READ");
try {
TTCN_Runtime::begin_testcase("SocketCAN_BCM_test", "tc_can_bcm_TX_SETUP_TX_READ", "SocketCANtest", "MTC", "SocketCANtest", "MTC", has_timer, timer_value);
current_location.update_lineno(253);
#line 253 "SocketCAN_BCM_test.ttcn"
COMPONENT v__ptc__bcmConfigurator(TTCN_Runtime::create_component("SocketCANtest", "PTC", "PTC1_ptc_bcmConfigurator", NULL, TRUE));
current_location.update_lineno(254);
#line 254 "SocketCAN_BCM_test.ttcn"
COMPONENT v__ptc__rawFrameReceiver1(TTCN_Runtime::create_component("SocketCANtest", "PTC", "PTC2_ptc_rawFrameReceiver1", NULL, TRUE));
current_location.update_lineno(256);
#line 256 "SocketCAN_BCM_test.ttcn"
SocketCANtest::f__addSyncSlaveSet(v__ptc__bcmConfigurator, SocketCANtest::MTC_component_v__PTCSet);
current_location.update_lineno(257);
#line 257 "SocketCAN_BCM_test.ttcn"
SocketCANtest::f__addSyncSlaveSet(v__ptc__rawFrameReceiver1, SocketCANtest::MTC_component_v__PTCSet);
current_location.update_lineno(259);
#line 259 "SocketCAN_BCM_test.ttcn"
TTCN_Runtime::connect_port(MTC_COMPREF, SocketCANtest::MTC_component_pt__sync.get_name(), v__ptc__bcmConfigurator, SocketCANtest::PTC_component_pt__sync.get_name());
current_location.update_lineno(260);
#line 260 "SocketCAN_BCM_test.ttcn"
TTCN_Runtime::connect_port(MTC_COMPREF, SocketCANtest::MTC_component_pt__sync.get_name(), v__ptc__rawFrameReceiver1, SocketCANtest::PTC_component_pt__sync.get_name());
current_location.update_lineno(263);
#line 263 "SocketCAN_BCM_test.ttcn"
Can::CAN__frame v__can__frame1;
current_location.update_lineno(263);
#line 263 "SocketCAN_BCM_test.ttcn"
Can::CAN__frame v__can__frame2;
current_location.update_lineno(263);
#line 263 "SocketCAN_BCM_test.ttcn"
Can::CAN__frame v__can__frame3;
current_location.update_lineno(263);
#line 263 "SocketCAN_BCM_test.ttcn"
Can::CAN__frame v__can__frame4;
current_location.update_lineno(263);
#line 263 "SocketCAN_BCM_test.ttcn"
Can::CAN__frame v__can__frame5;
current_location.update_lineno(264);
#line 264 "SocketCAN_BCM_test.ttcn"
Can::CANFD__frame v__canfd__frame1;
current_location.update_lineno(265);
#line 265 "SocketCAN_BCM_test.ttcn"
Bcm::SocketCAN__bcm__frame v__bcm__activation__frame;
current_location.update_lineno(265);
#line 265 "SocketCAN_BCM_test.ttcn"
Bcm::SocketCAN__bcm__frame v__bcm__deactivation__frame;
current_location.update_lineno(265);
#line 265 "SocketCAN_BCM_test.ttcn"
Bcm::SocketCAN__bcm__frame v__bcm__read__status__frame;
current_location.update_lineno(267);
#line 267 "SocketCAN_BCM_test.ttcn"
v__can__frame1.can__id() = os_0;
v__can__frame1.can__pdu() = os_1;
current_location.update_lineno(268);
#line 268 "SocketCAN_BCM_test.ttcn"
v__can__frame2.can__id() = os_2;
v__can__frame2.can__pdu() = os_3;
current_location.update_lineno(269);
#line 269 "SocketCAN_BCM_test.ttcn"
v__can__frame3.can__id() = os_4;
v__can__frame3.can__pdu() = os_5;
current_location.update_lineno(270);
#line 270 "SocketCAN_BCM_test.ttcn"
v__can__frame4.can__id() = os_6;
v__can__frame4.can__pdu() = os_7;
current_location.update_lineno(271);
#line 271 "SocketCAN_BCM_test.ttcn"
v__can__frame5.can__id() = os_8;
v__can__frame5.can__pdu() = os_9;
current_location.update_lineno(273);
#line 273 "SocketCAN_BCM_test.ttcn"
v__bcm__activation__frame.opcode() = os_0;
v__bcm__activation__frame.flags() = bs_0;
v__bcm__activation__frame.count() = 0;
{
Bcm::Bcm__timeval& tmp_43 = v__bcm__activation__frame.ival1();
tmp_43.tv__sec() = 0;
tmp_43.tv__usec() = 0;
}
{
Bcm::Bcm__timeval& tmp_44 = v__bcm__activation__frame.ival2();
tmp_44.tv__sec() = 0;
tmp_44.tv__usec() = 100000;
}
v__bcm__activation__frame.can__id() = os_10;
{
Bcm::SocketCAN__bcm__frame_frames_can__frame& tmp_45 = v__bcm__activation__frame.frames().can__frame();
tmp_45.set_size(5);
tmp_45[0] = v__can__frame1;
tmp_45[1] = v__can__frame2;
tmp_45[2] = v__can__frame3;
tmp_45[3] = v__can__frame4;
tmp_45[4] = v__can__frame5;
}
current_location.update_lineno(288);
#line 288 "SocketCAN_BCM_test.ttcn"
v__bcm__read__status__frame.opcode() = os_4;
v__bcm__read__status__frame.flags() = bs_5;
v__bcm__read__status__frame.count() = 0;
{
Bcm::Bcm__timeval& tmp_47 = v__bcm__read__status__frame.ival1();
tmp_47.tv__sec() = 0;
tmp_47.tv__usec() = 0;
}
{
Bcm::Bcm__timeval& tmp_48 = v__bcm__read__status__frame.ival2();
tmp_48.tv__sec() = 0;
tmp_48.tv__usec() = 0;
}
v__bcm__read__status__frame.can__id() = os_10;
v__bcm__read__status__frame.frames().can__frame() = NULL_VALUE;
current_location.update_lineno(303);
#line 303 "SocketCAN_BCM_test.ttcn"
SocketCANtest::BCM__cmds v__cmds;
v__cmds.set_size(2);
{
SocketCANtest::BCM__cmd& tmp_49 = v__cmds[0];
tmp_49.phase() = SocketCANtest::e__Phase::e__testbody1;
tmp_49.bcm__frame() = v__bcm__activation__frame;
}
{
SocketCANtest::BCM__cmd& tmp_50 = v__cmds[1];
tmp_50.phase() = SocketCANtest::e__Phase::e__testbody3;
tmp_50.bcm__frame() = v__bcm__read__status__frame;
}
current_location.update_lineno(309);
#line 309 "SocketCAN_BCM_test.ttcn"
SocketCANtest::start_f__ptc__bcmComandSendReceiveInitiator(v__ptc__bcmConfigurator, v__cmds);
current_location.update_lineno(311);
#line 311 "SocketCAN_BCM_test.ttcn"
SocketCAN__Types::SocketCAN__CAN__or__CAN__FD__frame v__frame__to__receive1;
current_location.update_lineno(312);
#line 312 "SocketCAN_BCM_test.ttcn"
v__frame__to__receive1.can__frame() = v__can__frame1;
current_location.update_lineno(315);
#line 315 "SocketCAN_BCM_test.ttcn"
SocketCANtest::start_f__ptc__RawFrameReceiver(v__ptc__rawFrameReceiver1, SocketCANtest::e__Phase::e__testbody1, SocketCAN__Types::SocketCAN__CAN__or__CAN__FD__frame_template(v__frame__to__receive1));
current_location.update_lineno(317);
#line 317 "SocketCAN_BCM_test.ttcn"
SocketCANtest::e__Phase v__phase;
current_location.update_lineno(319);
#line 319 "SocketCAN_BCM_test.ttcn"
v__phase = SocketCANtest::c__firstPhase;
current_location.update_lineno(319);
#line 319 "SocketCAN_BCM_test.ttcn"
for ( ; ; ) {
current_location.update_lineno(319);
#line 319 "SocketCAN_BCM_test.ttcn"
if (!(v__phase < SocketCANtest::e__Phase::e__testcase__complete)) break;
current_location.update_lineno(320);
#line 320 "SocketCAN_BCM_test.ttcn"
SocketCANtest::f__startPhase(v__phase);
current_location.update_lineno(321);
#line 321 "SocketCAN_BCM_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(322);
#line 322 "SocketCAN_BCM_test.ttcn"
SocketCANtest::f__awaitEndPhase(v__phase);
current_location.update_lineno(319);
#line 319 "SocketCAN_BCM_test.ttcn"
v__phase = SocketCANtest::f__incMTCPhase(v__phase);
}
current_location.update_lineno(326);
#line 326 "SocketCAN_BCM_test.ttcn"
{
tmp_54:
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_54;
}
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_54;
}
current_location.update_lineno(326);
#line 326 "SocketCAN_BCM_test.ttcn"
if (alt_flag == ALT_NO && default_flag == ALT_NO) TTCN_error("Stand-alone done statement failed in file SocketCAN_BCM_test.ttcn, line 326.");
TTCN_Snapshot::take_new(TRUE);
}
}
current_location.update_lineno(327);
#line 327 "SocketCAN_BCM_test.ttcn"
TTCN_Logger::log_str(TTCN_USER, "MTC done");
current_location.update_lineno(329);
#line 329 "SocketCAN_BCM_test.ttcn"
TTCN_Runtime::disconnect_port(MTC_COMPREF, SocketCANtest::MTC_component_pt__sync.get_name(), v__ptc__bcmConfigurator, SocketCANtest::PTC_component_pt__sync.get_name());
current_location.update_lineno(330);
#line 330 "SocketCAN_BCM_test.ttcn"
TTCN_Runtime::disconnect_port(MTC_COMPREF, SocketCANtest::MTC_component_pt__sync.get_name(), v__ptc__rawFrameReceiver1, SocketCANtest::PTC_component_pt__sync.get_name());
current_location.update_lineno(332);
#line 332 "SocketCAN_BCM_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_bcm_TX_SETUP_TX_READ was stopped.");
}
return TTCN_Runtime::end_testcase();
}
/* Bodies of static functions */
static void pre_init_module()
{
TTCN_Location current_location("SocketCAN_BCM_test.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "SocketCAN_BCM_test");
SocketCANtest::module_object.pre_init_module();
module_object.add_testcase_nonpard("tc_can_bcm_TX_SETUP_TX_DELETE_can_frame", testcase_tc__can__bcm__TX__SETUP__TX__DELETE__can__frame);
module_object.add_testcase_nonpard("tc_can_bcm_TX_SETUP_TX_DELETE_canfd_frame", testcase_tc__can__bcm__TX__SETUP__TX__DELETE__canfd__frame);
module_object.add_testcase_nonpard("tc_can_bcm_TX_SETUP_TX_READ", testcase_tc__can__bcm__TX__SETUP__TX__READ);
}
static void post_init_module()
{
TTCN_Location current_location("SocketCAN_BCM_test.ttcn", 0, TTCN_Location::LOCATION_UNKNOWN, "SocketCAN_BCM_test");
SocketCANtest::module_object.post_init_module();
}
} /* end of namespace */