gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-merchant] branch master updated (194c978 -> 2fafeda)


From: gnunet
Subject: [GNUnet-SVN] [taler-merchant] branch master updated (194c978 -> 2fafeda)
Date: Thu, 23 Feb 2017 18:05:37 +0100

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

marcello pushed a change to branch master
in repository merchant.

    from 194c978  Modify /history API and DB table for order_id-proposal_data 
mapping.  Adapting testcase and lib for that.
     new 17b7c5b  comments
     new 2fafeda  Checking the number of history entries are as expected.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/lib/test_merchant_api.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/src/lib/test_merchant_api.c b/src/lib/test_merchant_api.c
index 700b56b..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);
 }
 
@@ -2451,13 +2463,15 @@ run (void *cls)
     { .oc = OC_HISTORY,
       .label = "history-1",
       .expected_response_code = MHD_HTTP_OK,
+      /*all records to be returned*/
       .details.history.date.abs_value_us = 0,
       .details.history.nresult = 2
     },
     { .oc = OC_HISTORY,
       .label = "history-2",
       .expected_response_code = MHD_HTTP_OK,
-      .details.history.date.abs_value_us = 43 * 1000LL * 1000LL,
+      /*no records to be returned, as limit is in the future*/
+      .details.history.date.abs_value_us = 43 * 1000LL * 1000LL, 
       .details.history.nresult = 0
     },
 

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



reply via email to

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