Commit 117e6dcc authored by Botond Baranyi's avatar Botond Baranyi
Browse files

Fixed 'map' parameters in functions with no 'mtc' clause (bug 566094)


Signed-off-by: Botond Baranyi's avatarBotond Baranyi <botond.baranyi@ericsson.com>
Change-Id: Iabe798bf215f13145fde3e134f860a657133c9fd
parent 202badb0
......@@ -5151,6 +5151,7 @@ error:
error("Cannot determine system component in `%s' operation with "
"`param' clause", get_stmt_name());
}
chk_map_params(cref1_is_system ? ptb1 : (cref2_is_system ? ptb2 : NULL));
return;
}
if (cref1_is_tc || cref2_is_system) {
......@@ -5220,30 +5221,33 @@ error:
}
}
}
if (config_op.parsed_params != NULL) {
if (cref1_is_system) {
config_op.fp_list = ptb1->get_map_parameters(statementtype == S_MAP);
}
else if (cref2_is_system) {
config_op.fp_list = ptb2->get_map_parameters(statementtype == S_MAP);
}
else {
error("Cannot determine system component in `%s' operation with "
"`param' clause", get_stmt_name());
}
if (config_op.fp_list != NULL) {
ActualParList* parlist = new ActualParList;
if (config_op.fp_list->fold_named_and_chk(config_op.parsed_params, parlist)) {
delete parlist;
delete config_op.parsed_params;
config_op.ap_list = NULL;
} else {
delete config_op.parsed_params;
parlist->set_fullname(get_fullname());
parlist->set_my_scope(my_sb);
config_op.ap_list = parlist;
}
chk_map_params(cref1_is_system ? ptb1 : (cref2_is_system ? ptb2 : NULL));
}
void Statement::chk_map_params(PortTypeBody* p_system_port)
{
if (config_op.parsed_params == NULL) {
return;
}
if (p_system_port != NULL) {
config_op.fp_list = p_system_port->get_map_parameters(statementtype == S_MAP);
}
else {
error("Cannot determine system component in `%s' operation with "
"`param' clause", get_stmt_name());
}
if (config_op.fp_list != NULL) {
ActualParList* parlist = new ActualParList;
if (config_op.fp_list->fold_named_and_chk(config_op.parsed_params, parlist)) {
delete parlist;
delete config_op.parsed_params;
config_op.ap_list = NULL;
} else {
delete config_op.parsed_params;
parlist->set_fullname(get_fullname());
parlist->set_my_scope(my_sb);
config_op.ap_list = parlist;
}
}
}
......
......@@ -758,6 +758,7 @@ namespace Ttcn {
void chk_connect();
/* checks map and unmap */
void chk_map();
void chk_map_params(PortTypeBody* p_system_port);
void chk_start_timer();
void chk_stop_timer();
void chk_timer_timeout();
......
......@@ -86,4 +86,21 @@ function f_test_params_retval(CT p_comp) runs on CT system CT return integer {
return 0;
}
function f_test_params_mtc() runs on CT system CT {
var IntList v_p2 := P2_INITIAL;
map(mtc:pt, system:pt) param (-, v_p2);
if (v_p2 != P2_FINAL) {
setverdict(fail, "Final value of parameter p2 is incorrect: ", v_p2);
}
var integer v_p := P_INITIAL;
unmap(mtc:pt, system:pt) param(v_p);
if (v_p != P_FINAL) {
setverdict(fail, "Final value of parameter p is incorrect: ", v_p);
}
map(mtc:pt, system:pt);
unmap(mtc:pt, system:pt);
}
}
......@@ -18,3 +18,4 @@ ConsoleMask := TTCN_WARNING | TTCN_ERROR | TTCN_TESTCASE | TTCN_STATISTICS
[EXECUTE]
single_test.tc_single
single_test.tc_single_retval
single_test.tc_single_mtc
......@@ -25,4 +25,9 @@ testcase tc_single_retval() runs on CT {
f_check_calls();
}
testcase tc_single_mtc() runs on CT {
f_test_params_mtc();
f_check_calls();
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment