本文整理汇总了C++中Fixture::fun方法的典型用法代码示例。如果您正苦于以下问题:C++ Fixture::fun方法的具体用法?C++ Fixture::fun怎么用?C++ Fixture::fun使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fixture
的用法示例。
在下文中一共展示了Fixture::fun方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: srunner_run_unchecked_setup
static int srunner_run_unchecked_setup (SRunner *sr, TCase *tc)
{
TestResult *tr;
List *l;
Fixture *f;
int rval = 1;
set_fork_status(CK_NOFORK);
l = tc->unch_sflst;
for (list_front(l); !list_at_end(l); list_advance(l)) {
send_ctx_info(CK_CTX_SETUP);
f = list_val(l);
f->fun();
tr = receive_result_info_nofork (tc->name, "unchecked_setup", 0);
if (tr->rtype != CK_PASS) {
srunner_add_failure(sr, tr);
rval = 0;
break;
}
free(tr->file);
free(tr->msg);
free(tr);
}
set_fork_status(srunner_fork_status(sr));
return rval;
}
示例2: free
static TestResult * tcase_run_checked_setup (SRunner *sr, TCase *tc)
{
TestResult *tr = NULL;
List *l;
Fixture *f;
enum fork_status fstat = srunner_fork_status(sr);
l = tc->ch_sflst;
if (fstat == CK_FORK) {
send_ctx_info(CK_CTX_SETUP);
}
for (list_front(l); !list_at_end(l); list_advance(l)) {
if (fstat == CK_NOFORK) {
send_ctx_info(CK_CTX_SETUP);
}
f = list_val(l);
f->fun();
/* Stop the setup and return the failure if nofork mode. */
if (fstat == CK_NOFORK) {
tr = receive_result_info_nofork (tc->name, "checked_setup", 0);
if (tr->rtype != CK_PASS) {
break;
}
free(tr->file);
free(tr->msg);
free(tr);
tr = NULL;
}
}
return tr;
}
示例3: srunner_run_teardown
static void srunner_run_teardown (List *l)
{
Fixture *f;
for (list_front(l); !list_at_end(l); list_advance(l)) {
f = list_val(l);
send_ctx_info(CK_CTX_TEARDOWN);
f->fun ();
}
}
示例4:
static void
srunner_run_teardown (List * fixture_list, enum fork_status fork_usage)
{
Fixture *fixture;
for (check_list_front (fixture_list); !check_list_at_end (fixture_list);
check_list_advance (fixture_list)) {
fixture = (Fixture *) check_list_val (fixture_list);
send_ctx_info (CK_CTX_TEARDOWN);
if (fork_usage == CK_NOFORK) {
if (0 == setjmp (error_jmp_buffer)) {
fixture->fun ();
} else {
/* Abort the remaining teardowns */
break;
}
} else {
fixture->fun ();
}
}
}