diff options
author | Jonathan Buchanan <jonathan.russ.buchanan@gmail.com> | 2020-07-02 02:05:08 -0400 |
---|---|---|
committer | Jonathan Buchanan <jonathan.russ.buchanan@gmail.com> | 2020-07-02 02:05:08 -0400 |
commit | 03ca8c13996b1222ef11321c31c5e560f44058e4 (patch) | |
tree | 6135bd73dc7cc9eb7079bab90635561c7c456e1c /src/testing/testing_api_cmd_get_instance.c | |
parent | dcd5a4c81f8ac87a8fa103f26e9726b637c6a516 (diff) | |
download | merchant-03ca8c13996b1222ef11321c31c5e560f44058e4.tar.gz merchant-03ca8c13996b1222ef11321c31c5e560f44058e4.tar.bz2 merchant-03ca8c13996b1222ef11321c31c5e560f44058e4.zip |
twister, get tips, instance, and post transfer tests
Diffstat (limited to 'src/testing/testing_api_cmd_get_instance.c')
-rw-r--r-- | src/testing/testing_api_cmd_get_instance.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/testing/testing_api_cmd_get_instance.c b/src/testing/testing_api_cmd_get_instance.c index c48182eb..a3b91135 100644 --- a/src/testing/testing_api_cmd_get_instance.c +++ b/src/testing/testing_api_cmd_get_instance.c @@ -235,6 +235,49 @@ get_instance_cb (void *cls, return; } } + { + const unsigned int *expected_accounts_length; + if (GNUNET_OK != + TALER_TESTING_get_trait_uint32 (instance_cmd, + 1, + &expected_accounts_length)) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Could not fetch accounts length\n"); + TALER_TESTING_interpreter_fail (gis->is); + return; + } + if (accounts_length != *expected_accounts_length) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Accounts length does not match\n"); + TALER_TESTING_interpreter_fail (gis->is); + return; + } + } + for (unsigned int i = 0; i < accounts_length; ++i) + { + const char *payto_uri; + if (GNUNET_OK != + TALER_TESTING_get_trait_string (instance_cmd, + 2 + i, + &payto_uri)) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Could not fetch account payto uri\n"); + TALER_TESTING_interpreter_fail (gis->is); + return; + } + if (0 != strcasecmp (accounts[i].payto_uri, + payto_uri)) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Account payto uri does not match\n"); + TALER_TESTING_interpreter_fail (gis->is); + return; + } + // FIXME: account for deactivated accounts + } break; default: GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |