Skip to content

Commit 008241f

Browse files
committed
fix race condition
1 parent 65094da commit 008241f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/api/controllers/robot_window_html/robot_window_html.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ int main(int argc, char **argv) {
1717
if (strcmp(configure_message, "configure") == 0) {
1818
configured = true;
1919
wb_robot_wwi_send_text("test wwi functions from complete_test controller.");
20+
break;
2021
} else
2122
ts_send_error_and_exit("Wrong configure message received from the HTML robot-window: %s", configure_message);
2223
}
@@ -26,9 +27,10 @@ int main(int argc, char **argv) {
2627
wb_robot_step(TIME_STEP);
2728
const char *test_message;
2829
while ((test_message = wb_robot_wwi_receive_text())) {
29-
if (strcmp(test_message, "Answer: test wwi functions from complete_test controller.") == 0)
30+
if (strcmp(test_message, "Answer: test wwi functions from complete_test controller.") == 0) {
3031
received = true;
31-
else
32+
break;
33+
} else
3234
ts_send_error_and_exit("Wrong test message received from the HTML robot-window: %s", test_message);
3335
}
3436
}

0 commit comments

Comments
 (0)