static void srunner_add_failure (SRunner *sr, TestResult *tf);
static TestResult *tcase_run_tfun_fork (TCase *tc, TF *tf);
static TestResult *tcase_run_tfun_nofork (TCase *tc, TF *tf);
-static TestResult *receive_result_info_fork (const char *tcname, int status);
-static TestResult *receive_result_info_nofork (const char *tcname);
+static TestResult *receive_result_info_fork (const char *tcname,
+ const char *tname, int status);
+static TestResult *receive_result_info_nofork (const char *tcname,
+ const char *tname);
static void set_fork_info (TestResult *tr, int status);
static void set_nofork_info (TestResult *tr);
static char *signal_msg (int sig);
send_ctx_info(get_send_key(),CK_CTX_SETUP);
f->fun();
- tr = receive_result_info_nofork (tc->name);
+ tr = receive_result_info_nofork (tc->name, "unchecked_setup");
if (tr->rtype != CK_PASS) {
srunner_add_failure(sr, tr);
rval = 0;
break;
}
+ else
+ {
+ free(tr->file);
+ free(tr->msg);
+ free(tr);
+ }
}
set_fork_status(srunner_fork_status(sr));
}
}
-static TestResult *receive_result_info_fork (const char *tcname, int status)
+static TestResult *receive_result_info_fork (const char *tcname,
+ const char *tname, int status)
{
TestResult *tr;
if (tr == NULL)
eprintf("Failed to receive test result", __FILE__, __LINE__);
tr->tcname = tcname;
+ tr->tname = tname;
set_fork_info(tr, status);
return tr;
}
-static TestResult *receive_result_info_nofork (const char *tcname)
+static TestResult *receive_result_info_nofork (const char *tcname,
+ const char *tname)
{
TestResult *tr;
if (tr == NULL)
eprintf("Failed to receive test result", __FILE__, __LINE__);
tr->tcname = tcname;
+ tr->tname = tname;
set_nofork_info(tr);
return tr;
tcase_run_checked_setup(tc);
tfun->fn();
tcase_run_checked_teardown(tc);
- return receive_result_info_nofork (tc->name);
+ return receive_result_info_nofork (tc->name, tfun->name);
}
_exit (EXIT_SUCCESS);
}
(void) wait(&status);
- return receive_result_info_fork (tc->name, status);
+ return receive_result_info_fork (tc->name, tfun->name, status);
}
static char *signal_msg (int signal)