commit 1a930818434c5a82aa620d6e861969374232ee61
parent dbadf348ce8c069e8362b9e9c9292d8f351b0aba
Author: Marcello Stanisci <marcello.stanisci@inria.fr>
Date: Tue, 25 Jul 2017 16:00:36 +0200
do not use hugely futuristic time while testing /history
Diffstat:
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/src/lib/test_merchant_api.c b/src/lib/test_merchant_api.c
@@ -2257,6 +2257,10 @@ interpreter_run (void *cls)
return;
}
case OC_HISTORY:
+ if (0 == cmd->details.history.date.abs_value_us)
+ cmd->details.history.date = GNUNET_TIME_absolute_add
+ (GNUNET_TIME_absolute_get (),
+ GNUNET_TIME_UNIT_HOURS);
if (NULL == (cmd->details.history.ho
= TALER_MERCHANT_history (ctx,
MERCHANT_URI,
@@ -2710,8 +2714,12 @@ 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 = 99999999999 * 1000LL * 1000LL,
+ /**
+ * all records to be returned; setting date as 0 lets the interpreter
+ * set it as 'now' + one hour delta, just to make sure it surpasses the
+ * proposal's timestamp.
+ */
+ .details.history.date.abs_value_us = 0,
.details.history.nresult = 2,
.details.history.start = 10,
.details.history.nrows = 10
@@ -2720,7 +2728,7 @@ run (void *cls)
.label = "history-2",
.expected_response_code = MHD_HTTP_OK,
/*no records returned, time limit too ancient*/
- .details.history.date.abs_value_us = 0,
+ .details.history.date.abs_value_us = 1,
.details.history.nresult = 0,
.details.history.start = 10,
.details.history.nrows = 10