gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [taler-merchant] 02/02: Checking the number of history entr


From: gnunet
Subject: [GNUnet-SVN] [taler-merchant] 02/02: Checking the number of history entries are as expected.
Date: Thu, 23 Feb 2017 18:05:39 +0100

This is an automated email from the git hooks/post-receive script.

marcello pushed a commit to branch master
in repository merchant.

commit 2fafedafc461e6f8d7a88632e693b78229b553f8
Author: Marcello Stanisci <address@hidden>
AuthorDate: Thu Feb 23 18:05:24 2017 +0100

    Checking the number of history entries are as expected.
---
 src/lib/test_merchant_api.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/lib/test_merchant_api.c b/src/lib/test_merchant_api.c
index 915c63c..d2eabaf 100644
--- 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);
 }
 

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]