commit 2fafedafc461e6f8d7a88632e693b78229b553f8
parent 17b7c5b8a701a165e8da4f86a8fce45d594bff4f
Author: Marcello Stanisci <marcello.stanisci@inria.fr>
Date: Thu, 23 Feb 2017 18:05:24 +0100
Checking the number of history entries are as expected.
Diffstat:
1 file changed, 12 insertions(+), 0 deletions(-)
diff --git a/src/lib/test_merchant_api.c b/src/lib/test_merchant_api.c
@@ -753,6 +753,8 @@ history_cb (void *cls,
const json_t *json)
{
struct InterpreterState *is = cls;
+ struct Command *cmd = &is->commands[is->ip];
+ unsigned int nresult;
if (MHD_HTTP_OK != http_status)
{
@@ -760,6 +762,16 @@ history_cb (void *cls,
return;
}
/*FIXME: put check on number of expected entries*/
+ nresult = json_array_size (json);
+ if (nresult != cmd->details.history.nresult)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Unexpected number of history entries. Got %d, expected %d\n",
+ nresult,
+ cmd->details.history.nresult);
+ fail (is);
+ return;
+ }
next_command (is);
}