diff options
author | Marcello Stanisci <marcello.stanisci@inria.fr> | 2017-07-25 16:00:36 +0200 |
---|---|---|
committer | Marcello Stanisci <marcello.stanisci@inria.fr> | 2017-07-25 16:00:36 +0200 |
commit | 1a930818434c5a82aa620d6e861969374232ee61 (patch) | |
tree | 895fa401c18e21442195143808e0e18327fc0d29 | |
parent | dbadf348ce8c069e8362b9e9c9292d8f351b0aba (diff) | |
download | merchant-1a930818434c5a82aa620d6e861969374232ee61.tar.gz merchant-1a930818434c5a82aa620d6e861969374232ee61.tar.bz2 merchant-1a930818434c5a82aa620d6e861969374232ee61.zip |
do not use hugely futuristic time while testing /history
-rw-r--r-- | src/lib/test_merchant_api.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/lib/test_merchant_api.c b/src/lib/test_merchant_api.c index cc193b19..b533a9f4 100644 --- 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 |