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:
parent
09b6455432
commit
4d5174e4a8
@ -53,6 +53,7 @@ start_keylist (void *arg)
|
|||||||
gpgme_ctx_t ctx;
|
gpgme_ctx_t ctx;
|
||||||
gpgme_key_t key;
|
gpgme_key_t key;
|
||||||
|
|
||||||
|
(void)arg;
|
||||||
err = gpgme_new (&ctx);
|
err = gpgme_new (&ctx);
|
||||||
fail_if_err (err);
|
fail_if_err (err);
|
||||||
|
|
||||||
@ -61,6 +62,7 @@ start_keylist (void *arg)
|
|||||||
|
|
||||||
while (!(err = gpgme_op_keylist_next (ctx, &key)));
|
while (!(err = gpgme_op_keylist_next (ctx, &key)));
|
||||||
|
|
||||||
|
gpgme_release (ctx);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,6 +75,8 @@ start_verify (void *arg)
|
|||||||
gpgme_verify_result_t result;
|
gpgme_verify_result_t result;
|
||||||
gpgme_signature_t signature;
|
gpgme_signature_t signature;
|
||||||
|
|
||||||
|
(void)arg;
|
||||||
|
|
||||||
err = gpgme_new (&ctx);
|
err = gpgme_new (&ctx);
|
||||||
fail_if_err (err);
|
fail_if_err (err);
|
||||||
|
|
||||||
@ -99,6 +103,7 @@ start_verify (void *arg)
|
|||||||
__FILE__, __LINE__, gpgme_strerror (signature->status));
|
__FILE__, __LINE__, gpgme_strerror (signature->status));
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
|
gpgme_release (ctx);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -110,6 +115,9 @@ main (int argc, char *argv[])
|
|||||||
pthread_t keylist_threads[THREAD_COUNT];
|
pthread_t keylist_threads[THREAD_COUNT];
|
||||||
init_gpgme (GPGME_PROTOCOL_OpenPGP);
|
init_gpgme (GPGME_PROTOCOL_OpenPGP);
|
||||||
|
|
||||||
|
(void)argc;
|
||||||
|
(void)argv;
|
||||||
|
|
||||||
for (i = 0; i < THREAD_COUNT; i++)
|
for (i = 0; i < THREAD_COUNT; i++)
|
||||||
{
|
{
|
||||||
if (pthread_create(&verify_threads[i], NULL, start_verify, NULL) ||
|
if (pthread_create(&verify_threads[i], NULL, start_verify, NULL) ||
|
||||||
|
@ -41,6 +41,7 @@ start_keylist (void *arg)
|
|||||||
gpgme_ctx_t ctx;
|
gpgme_ctx_t ctx;
|
||||||
gpgme_key_t key;
|
gpgme_key_t key;
|
||||||
|
|
||||||
|
(void) arg;
|
||||||
err = gpgme_new (&ctx);
|
err = gpgme_new (&ctx);
|
||||||
fail_if_err (err);
|
fail_if_err (err);
|
||||||
|
|
||||||
@ -49,6 +50,8 @@ start_keylist (void *arg)
|
|||||||
|
|
||||||
while (!(err = gpgme_op_keylist_next (ctx, &key)));
|
while (!(err = gpgme_op_keylist_next (ctx, &key)));
|
||||||
|
|
||||||
|
gpgme_release (ctx);
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,6 +62,9 @@ main (int argc, char *argv[])
|
|||||||
pthread_t keylist_threads[THREAD_COUNT];
|
pthread_t keylist_threads[THREAD_COUNT];
|
||||||
init_gpgme (GPGME_PROTOCOL_OpenPGP);
|
init_gpgme (GPGME_PROTOCOL_OpenPGP);
|
||||||
|
|
||||||
|
(void)argc;
|
||||||
|
(void)argv;
|
||||||
|
|
||||||
for (i = 0; i < THREAD_COUNT; i++)
|
for (i = 0; i < THREAD_COUNT; i++)
|
||||||
{
|
{
|
||||||
if (pthread_create(&keylist_threads[i], NULL, start_keylist, NULL))
|
if (pthread_create(&keylist_threads[i], NULL, start_keylist, NULL))
|
||||||
|
Loading…
Reference in New Issue
Block a user