int main (void) { CuString *output = CuStringNew (); CuSuite* suite = CuSuiteNew (); int ret; _p11_mutex_init (&race_mutex); mock_module_init (); _p11_library_init (); #ifdef OS_UNIX SUITE_ADD_TEST (suite, test_fork_initialization); #endif SUITE_ADD_TEST (suite, test_recursive_initialization); SUITE_ADD_TEST (suite, test_threaded_initialization); CuSuiteRun (suite); CuSuiteSummary (suite, output); CuSuiteDetails (suite, output); printf ("%s\n", output->buffer); ret = suite->failCount; CuSuiteDelete (suite); CuStringDelete (output); return ret; }
CK_RV C_GetFunctionList (CK_FUNCTION_LIST_PTR_PTR list) { mock_module_init (); mock_module.C_GetFunctionList = C_GetFunctionList; if (list == NULL) return CKR_ARGUMENTS_BAD; mock_module.C_Initialize = override_initialize; *list = &mock_module; return CKR_OK; }
int main (int argc, char *argv[]) { mock_module_init (); p11_library_init (); assert (p11_virtual_can_wrap ()); p11_test (test_initialize, "/virtual/test_initialize"); p11_test (test_fall_through, "/virtual/test_fall_through"); p11_test (test_get_function_list, "/virtual/test_get_function_list"); return p11_test_run (argc, argv); }
int main (int argc, char *argv[]) { p11_library_init (); mock_module_init (); test_mock_add_tests ("/log"); p11_kit_be_quiet (); p11_log_output = false; return p11_test_run (argc, argv); }