commit f3918c1df5a39ebd1a4455edd36ca4ccc35d0cbb
parent 7e05562016e105ed11c3ad6439480310abb780f8
Author: Marcello Stanisci <marcello.stanisci@inria.fr>
Date: Thu, 20 Jul 2017 23:47:27 +0200
fix timestamp issue in lib testcase
Diffstat:
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/lib/test_merchant_api.c b/src/lib/test_merchant_api.c
@@ -1976,10 +1976,20 @@ interpreter_run (void *cls)
{
json_t *order;
json_error_t error;
+ struct GNUNET_TIME_Absolute timestamp;
+ char *date;
GNUNET_assert (NULL != (order = json_loads (cmd->details.proposal.order,
JSON_REJECT_DUPLICATES,
&error)));
+
+ timestamp = GNUNET_TIME_absolute_get ();
+ GNUNET_asprintf (&date,
+ "/Date(%llu)/",
+ timestamp.abs_value_us / 1000LL / 1000LL);
+ json_object_set_new (order,
+ "timestamp",
+ json_string (date));
if (NULL != instance)
{
json_t *merchant;
@@ -2479,7 +2489,6 @@ run (void *cls)
\"value\":0,\
\"fraction\":50000000},\
\"order_id\":\"1\",\
- \"timestamp\":\"\\/Date(42)\\/\",\
\"refund_deadline\":\"\\/Date(0)\\/\",\
\"pay_deadline\":\"\\/Date(9999999999)\\/\",\
\"amount\":\
@@ -2515,7 +2524,6 @@ run (void *cls)
\"value\":0,\
\"fraction\":50000000},\
\"order_id\":\"2\",\
- \"timestamp\":\"\\/Date(42)\\/\",\
\"refund_deadline\":\"\\/Date(0)\\/\",\
\"pay_deadline\":\"\\/Date(9999999999)\\/\",\
\"amount\":\