int r = EXIT_FAILURE;
// Try to call pakfire_key_generate() with some invalid inputs
- ASSERT_ERRNO(pakfire_key_generate(&key, t->pakfire,
+ ASSERT_ERRNO(pakfire_key_generate(&key, t->ctx,
PAKFIRE_KEY_ALGO_NULL, "Key 1"), EINVAL);
// Generate a new key using ed25519
- ASSERT_SUCCESS(pakfire_key_generate(&key, t->pakfire,
+ ASSERT_SUCCESS(pakfire_key_generate(&key, t->ctx,
PAKFIRE_KEY_ALGO_ED25519, "Key 2"));
// Write the public key to the console
ASSERT(f = test_mktemp(NULL));
// Generate a new key using ed25519
- ASSERT_SUCCESS(pakfire_key_generate(&key, t->pakfire,
+ ASSERT_SUCCESS(pakfire_key_generate(&key, t->ctx,
PAKFIRE_KEY_ALGO_ED25519, "Key 1"));
// Write the public key to the console
ASSERT(f = fopen(TEST_DATA_DIR "/keys/key1.pub", "r"));
// Try to import the key
- ASSERT_SUCCESS(pakfire_key_import(&key, t->pakfire, f));
+ ASSERT_SUCCESS(pakfire_key_import(&key, t->ctx, f));
// Write the imported key to the console
ASSERT_SUCCESS(pakfire_key_export(key, stdout, PAKFIRE_KEY_EXPORT_MODE_PUBLIC));
ASSERT(f = fopen(TEST_DATA_DIR "/keys/key1.sec", "r"));
// Try to import the key
- ASSERT_SUCCESS(pakfire_key_import(&key, t->pakfire, f));
+ ASSERT_SUCCESS(pakfire_key_import(&key, t->ctx, f));
// Write the imported key to the console
ASSERT_SUCCESS(pakfire_key_export(key, stdout, PAKFIRE_KEY_EXPORT_MODE_PRIVATE));
}
int main(int argc, const char* argv[]) {
- testsuite_add_test(test_generate, TEST_WANTS_PAKFIRE);
- testsuite_add_test(test_sign_and_verify, TEST_WANTS_PAKFIRE);
- testsuite_add_test(test_import_public, TEST_WANTS_PAKFIRE);
- testsuite_add_test(test_import_secret, TEST_WANTS_PAKFIRE);
+ testsuite_add_test(test_generate, 0);
+ testsuite_add_test(test_sign_and_verify, 0);
+ testsuite_add_test(test_import_public, 0);
+ testsuite_add_test(test_import_secret, 0);
return testsuite_run(argc, argv);
}