GkmModule* test_ssh_module_initialize_and_enter (void) { CK_FUNCTION_LIST_PTR funcs; GkmModule *module; CK_RV rv; funcs = gkm_ssh_store_get_functions (); rv = (funcs->C_Initialize) (NULL); g_return_val_if_fail (rv == CKR_OK, NULL); module = _gkm_ssh_store_get_module_for_testing (); g_return_val_if_fail (module, NULL); mutex = _gkm_module_get_scary_mutex_that_you_should_not_touch (module); test_ssh_module_enter (); return module; }
GkmModule* test_xdg_module_initialize_and_enter (void) { CK_FUNCTION_LIST_PTR funcs; CK_C_INITIALIZE_ARGS args; GkmModule *module; gchar *string; CK_RV rv; /* Setup test directory to work in */ memset (&args, 0, sizeof (args)); string = g_strdup_printf ("directory='%s'", testing_scratch_directory ()); args.pReserved = string; args.flags = CKF_OS_LOCKING_OK; /* Delete all files in this directory */ testing_scratch_remove_all (); /* Copy files from test-data to scratch */ testing_data_to_scratch ("test-refer-1.trust", NULL); testing_data_to_scratch ("test-certificate-1.cer", NULL); testing_scratch_empty ("invalid-without-ext"); testing_scratch_empty ("test-file.unknown"); testing_scratch_empty ("test-invalid.trust"); funcs = gkm_xdg_store_get_functions (); rv = (funcs->C_Initialize) (&args); g_return_val_if_fail (rv == CKR_OK, NULL); module = _gkm_xdg_store_get_module_for_testing (); g_return_val_if_fail (module, NULL); mutex = _gkm_module_get_scary_mutex_that_you_should_not_touch (module); test_xdg_module_enter (); g_free (string); return module; }