diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-06-18 11:39:53 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-06-18 11:39:53 +0200 |
commit | 740d6cba04175f0227e633dff06f0232da31ac54 (patch) | |
tree | 3f47e5bdb525a2597e2a45651ddbd531cd5f3414 /src | |
parent | a32e2b869fef1aa3852e35b14fa20f0264d1d34b (diff) | |
download | exchange-740d6cba04175f0227e633dff06f0232da31ac54.tar.xz |
finish first draft of testcase, fix first small bug found with it
Diffstat (limited to 'src')
-rw-r--r-- | src/mint-lib/mint_api_handle.c | 2 | ||||
-rw-r--r-- | src/mint-lib/test_mint_api.c | 30 |
2 files changed, 30 insertions, 2 deletions
diff --git a/src/mint-lib/mint_api_handle.c b/src/mint-lib/mint_api_handle.c index 11c0b793a..1ce18569b 100644 --- a/src/mint-lib/mint_api_handle.c +++ b/src/mint-lib/mint_api_handle.c @@ -761,6 +761,8 @@ TALER_MINT_connect (struct TALER_MINT_Context *ctx, mint = GNUNET_new (struct TALER_MINT_Handle); mint->ctx = ctx; mint->url = GNUNET_strdup (url); + mint->cert_cb = cert_cb; + mint->cert_cb_cls = cert_cb_cls; kr = GNUNET_new (struct KeysRequest); kr->mint = mint; kr->url = MAH_path_to_url (mint, "/keys"); diff --git a/src/mint-lib/test_mint_api.c b/src/mint-lib/test_mint_api.c index e37c54cd2..8015d5c5a 100644 --- a/src/mint-lib/test_mint_api.c +++ b/src/mint-lib/test_mint_api.c @@ -1,6 +1,6 @@ /* This file is part of TALER - Copyright (C) 2014 Christian Grothoff (and other contributing authors) + Copyright (C) 2014, 2015 Christian Grothoff (and other contributing authors) TALER is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -18,22 +18,45 @@ * @file mint/test_mint_api.c * @brief testcase to test mint's HTTP API interface * @author Sree Harsha Totakura <sreeharsha@totakura.in> + * @author Christian Grothoff */ #include "platform.h" #include "taler_util.h" #include "taler_mint_service.h" +/** + * Main execution context for the main loop. + */ static struct TALER_MINT_Context *ctx; +/** + * Handle to access the mint. + */ static struct TALER_MINT_Handle *mint; +/** + * Task run on shutdown. + */ static struct GNUNET_SCHEDULER_Task *shutdown_task; +/** + * Task that runs the main event loop. + */ static struct GNUNET_SCHEDULER_Task *ctx_task; +/** + * Result of the testcases, #GNUNET_OK on success + */ static int result; +/** + * Function run when the test terminates (good or bad). + * Cleans up our state. + * + * @param cls NULL + * @param tc unused + */ static void do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) @@ -82,7 +105,8 @@ cert_cb (void *cls, keys->num_denom_keys); #undef ERR /* TODO: start running rest of test suite here! */ - return; + result = GNUNET_OK; + GNUNET_SCHEDULER_shutdown (); } @@ -195,3 +219,5 @@ main (int argc, return 3; return (GNUNET_OK == result) ? 0 : 1; } + +/* end of test_mint_api.c */ |