Fixed tests (3 and 4).

master
Philippe Pittoli 2022-02-04 03:22:01 +01:00
parent 33f7c9ccfb
commit 13e7619899
2 changed files with 8 additions and 2 deletions

View File

@ -39,7 +39,13 @@ int main_loop(int argc, char * argv[])
printf ("func 01 - service polling...\n");
// listen only for a single client
while (1) {
TEST_IPC_WAIT_EVENT_Q (ipc_wait_event (&ctx, &event, &timer), EXIT_FAILURE);
// TEST_IPC_WAIT_EVENT_Q (ipc_wait_event (&ctx, &event, &timer), EXIT_FAILURE);
struct ipc_error ret = ipc_wait_event (&ctx, &event, &timer);
if (ret.error_code != IPC_ERROR_NONE &&
ret.error_code != IPC_ERROR_CLOSED_RECIPIENT) {
printf ("An error happened :(\n");
}
switch (event.type) {
case IPC_EVENT_TYPE_TIMER : {
@ -73,7 +79,6 @@ int main_loop(int argc, char * argv[])
case IPC_EVENT_TYPE_EXTRA_SOCKET :
default :
printf ("not ok - should not happen\n");
exit (EXIT_FAILURE);
break;
}
}

View File

@ -53,6 +53,7 @@ int main(void)
read_message (&ctx);
TEST_IPC_Q(ipc_close_all (&ctx), EXIT_FAILURE);
ipc_ctx_free(&ctx);
return EXIT_SUCCESS;
}