Commit 202badb0 authored by Botond Baranyi's avatar Botond Baranyi
Browse files

Fixed system component detection in functions with return values (bug 566094)


Signed-off-by: Botond Baranyi's avatarBotond Baranyi <botond.baranyi@ericsson.com>
Change-Id: Ib8e1aacf1d8ec53dc260f28dec9ab0ce084f86c3
Signed-off-by: Botond Baranyi's avatarBotond Baranyi <botond.baranyi@ericsson.com>
parent 1df9038a
......@@ -189,7 +189,10 @@ namespace Ttcn {
// is the same as the type of 'mtc' (which is given in 'runs on' clause)
}
return my_def->get_RunsOnType();
} else if (asstype == Common::Assignment::A_FUNCTION || asstype == Common::Assignment::A_ALTSTEP) {
} else if (asstype == Common::Assignment::A_FUNCTION ||
asstype == Common::Assignment::A_FUNCTION_RVAL ||
asstype == Common::Assignment::A_FUNCTION_RTEMP ||
asstype == Common::Assignment::A_ALTSTEP) {
if (is_system) {
return my_def->get_SystemType();
} else {
......
......@@ -67,4 +67,23 @@ function f_check_calls() runs on CT {
}
}
function f_test_params_retval(CT p_comp) runs on CT system CT return integer {
var IntList v_p2 := P2_INITIAL;
map(p_comp: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(p_comp:pt, system:pt) param(v_p);
if (v_p != P_FINAL) {
setverdict(fail, "Final value of parameter p is incorrect: ", v_p);
}
map(p_comp:pt, system:pt);
unmap(p_comp:pt, system:pt);
return 0;
}
}
......@@ -17,4 +17,4 @@ ConsoleMask := TTCN_WARNING | TTCN_ERROR | TTCN_TESTCASE | TTCN_STATISTICS
[EXECUTE]
single_test.tc_single
single_test.tc_single_retval
......@@ -20,4 +20,9 @@ testcase tc_single() runs on CT {
f_check_calls();
}
testcase tc_single_retval() runs on CT {
f_test_params_retval(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