Commit 9087245a authored by Botond Baranyi's avatar Botond Baranyi
Browse files

Fixed 'done' operation on PTC (bug 532060)



Change-Id: Iaf082038e5bb9340a57f49d70a717106b0ff8020
Signed-off-by: Botond Baranyi's avatarBotond Baranyi <botond.baranyi@ericsson.com>
parent 4ca6afb6
......@@ -1499,11 +1499,11 @@ void MainController::send_component_status_to_requestor(component_struct *tc,
case PTC_STARTING:
if (done_status) {
send_component_status_ptc(requestor, tc->comp_ref, TRUE,
killed_status, tc->return_type, tc->return_value_len,
killed_status, tc->local_verdict, tc->return_type, tc->return_value_len,
tc->return_value);
} else {
send_component_status_ptc(requestor, tc->comp_ref, FALSE,
killed_status, NULL, 0, NULL);
killed_status, tc->local_verdict, NULL, 0, NULL);
}
break;
case PTC_STOPPING_KILLING:
......@@ -3595,13 +3595,15 @@ void MainController::send_cancel_done_ptc(component_struct *tc,
void MainController::send_component_status_ptc(component_struct *tc,
component component_reference, boolean is_done, boolean is_killed,
const char *return_type, int return_value_len, const void *return_value)
verdicttype local_verdict, const char *return_type, int return_value_len,
const void *return_value)
{
Text_Buf text_buf;
text_buf.push_int(MSG_COMPONENT_STATUS);
text_buf.push_int(component_reference);
text_buf.push_int(is_done ? 1 : 0);
text_buf.push_int(is_killed ? 1 : 0);
text_buf.push_int(local_verdict);
text_buf.push_string(return_type);
text_buf.push_raw(return_value_len, return_value);
send_message(tc->tc_fd, text_buf);
......
......@@ -552,8 +552,8 @@ private:
component component_reference);
static void send_component_status_ptc(component_struct *tc,
component component_reference,
boolean is_done, boolean is_killed, const char *return_type,
int return_value_len, const void *return_value);
boolean is_done, boolean is_killed, verdicttype local_verdict,
const char *return_type, int return_value_len, const void *return_value);
static void send_start(component_struct *tc,
const qualified_name& function_name, int arg_len, const void *arg_ptr);
static void send_kill(component_struct *tc);
......
......@@ -1568,6 +1568,24 @@ testcase commMessageBehaviorFunctionParams() runs on commMessage_comp1 {
setverdict(pass);
}
function f_behavior_empty() runs on C {
// does nothing
}
function f_behavior_done() runs on C {
var C comp := C.create;
comp.start(f_behavior_empty());
comp.done;
}
// tests the 'done' operation on a PTC
testcase tc_bug_532060() runs on C {
var C comp := C.create;
comp.start(f_behavior_done());
comp.done;
setverdict(pass);
}
control {
execute(commMessageIntegerEncode());
execute(commMessageValue());
......@@ -1609,5 +1627,6 @@ control {
execute(commMessageDualFacedPorts2());
execute(commMessageReceiveAnyOrOmit());
execute(commMessageBehaviorFunctionParams());
execute(tc_bug_532060());
}
}
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