tests: Improve new thread tests

* tests/gpg/t-thread-keylist-verify.c (start_keylist): Mark
arg as unused. Release context.
(start_verify): Ditto.
(main): Mark args as unused.
* tests/gpg/t-thread-keylist.c (start_keylist):  Mark
arg as unused. Release context.
(main): Mark args as unused.
This commit is contained in:
Andre Heinecke 2016-11-10 14:10:11 +01:00
parent 09b6455432
commit 4d5174e4a8
2 changed files with 14 additions and 0 deletions

View File

@ -53,6 +53,7 @@ start_keylist (void *arg)
gpgme_ctx_t ctx;
gpgme_key_t key;
(void)arg;
err = gpgme_new (&ctx);
fail_if_err (err);
@ -61,6 +62,7 @@ start_keylist (void *arg)
while (!(err = gpgme_op_keylist_next (ctx, &key)));
gpgme_release (ctx);
return NULL;
}
@ -73,6 +75,8 @@ start_verify (void *arg)
gpgme_verify_result_t result;
gpgme_signature_t signature;
(void)arg;
err = gpgme_new (&ctx);
fail_if_err (err);
@ -99,6 +103,7 @@ start_verify (void *arg)
__FILE__, __LINE__, gpgme_strerror (signature->status));
exit (1);
}
gpgme_release (ctx);
return NULL;
}
@ -110,6 +115,9 @@ main (int argc, char *argv[])
pthread_t keylist_threads[THREAD_COUNT];
init_gpgme (GPGME_PROTOCOL_OpenPGP);
(void)argc;
(void)argv;
for (i = 0; i < THREAD_COUNT; i++)
{
if (pthread_create(&verify_threads[i], NULL, start_verify, NULL) ||

View File

@ -41,6 +41,7 @@ start_keylist (void *arg)
gpgme_ctx_t ctx;
gpgme_key_t key;
(void) arg;
err = gpgme_new (&ctx);
fail_if_err (err);
@ -49,6 +50,8 @@ start_keylist (void *arg)
while (!(err = gpgme_op_keylist_next (ctx, &key)));
gpgme_release (ctx);
return NULL;
}
@ -59,6 +62,9 @@ main (int argc, char *argv[])
pthread_t keylist_threads[THREAD_COUNT];
init_gpgme (GPGME_PROTOCOL_OpenPGP);
(void)argc;
(void)argv;
for (i = 0; i < THREAD_COUNT; i++)
{
if (pthread_create(&keylist_threads[i], NULL, start_keylist, NULL))