From f3918c1df5a39ebd1a4455edd36ca4ccc35d0cbb Mon Sep 17 00:00:00 2001 From: Marcello Stanisci Date: Thu, 20 Jul 2017 23:47:27 +0200 Subject: fix timestamp issue in lib testcase --- src/lib/test_merchant_api.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/lib') diff --git a/src/lib/test_merchant_api.c b/src/lib/test_merchant_api.c index 428db1ff..69bc4c36 100644 --- 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\":\ -- cgit v1.2.3