summaryrefslogtreecommitdiff
path: root/src/testing
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-10-25 21:33:41 +0100
committerChristian Grothoff <christian@grothoff.org>2020-10-25 21:33:41 +0100
commit0e63f90cfb3fbc4271a3a82f988e61d8697c8cb6 (patch)
tree65a4511ced635627a17c36544c89a50101a122d1 /src/testing
parent5b138413ac84ba76322ec41255143bb5c6cb3557 (diff)
downloadmerchant-0e63f90cfb3fbc4271a3a82f988e61d8697c8cb6.tar.gz
merchant-0e63f90cfb3fbc4271a3a82f988e61d8697c8cb6.tar.bz2
merchant-0e63f90cfb3fbc4271a3a82f988e61d8697c8cb6.zip
implement #6525, requires LASTEST GNUnet to work
Diffstat (limited to 'src/testing')
-rw-r--r--src/testing/testing_api_cmd_post_orders.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/testing/testing_api_cmd_post_orders.c b/src/testing/testing_api_cmd_post_orders.c
index 7f0ef264..b9ea27e9 100644
--- a/src/testing/testing_api_cmd_post_orders.c
+++ b/src/testing/testing_api_cmd_post_orders.c
@@ -317,7 +317,7 @@ order_cb (void *cls,
break;
case MHD_HTTP_CONFLICT:
TALER_TESTING_interpreter_next (ps->is);
- break;
+ return;
default:
{
char *s = json_dumps (hr->reply,
@@ -338,7 +338,7 @@ order_cb (void *cls,
return;
}
- if (false == ps->with_claim)
+ if (! ps->with_claim)
{
TALER_TESTING_interpreter_next (ps->is);
return;
@@ -385,7 +385,7 @@ orders_run (void *cls,
}
if (NULL == json_object_get (order,
- "order_id"))
+ "order_id"))
{
struct GNUNET_TIME_Absolute now;
char *order_id;
@@ -395,9 +395,10 @@ orders_run (void *cls,
order_id = GNUNET_STRINGS_data_to_string_alloc
(&now.abs_value_us,
sizeof (now.abs_value_us));
- json_object_set_new (order,
- "order_id",
- json_string (order_id));
+ GNUNET_assert (0 ==
+ json_object_set_new (order,
+ "order_id",
+ json_string (order_id)));
GNUNET_free (order_id);
}
GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK,
@@ -430,11 +431,9 @@ orders_run2 (void *cls,
const char *order_str = ps->order;
json_t *order;
json_error_t error;
-
char *products_string = GNUNET_strdup (ps->products);
char *locks_string = GNUNET_strdup (ps->locks);
char *token;
-
struct TALER_MERCHANT_InventoryProduct *products = NULL;
unsigned int products_length = 0;
struct GNUNET_Uuid *locks = NULL;
@@ -596,8 +595,7 @@ orders_cleanup (void *cls,
if (NULL != ps->och)
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
- "Command '%s' did not complete"
- " (orders lookup)\n",
+ "Command '%s' did not complete (orders lookup)\n",
cmd->label);
TALER_MERCHANT_order_claim_cancel (ps->och);
ps->och = NULL;
@@ -646,7 +644,6 @@ make_order_json (const char *order_id,
{
struct GNUNET_TIME_Absolute refund = refund_deadline;
struct GNUNET_TIME_Absolute pay = pay_deadline;
-
json_t *contract_terms;
GNUNET_TIME_round_abs (&refund);
@@ -667,7 +664,6 @@ make_order_json (const char *order_id,
"item", "headphones",
"item", "earbuds"
);
-
GNUNET_assert (GNUNET_OK ==
TALER_JSON_expand_path (contract_terms,
"$.dummy_obj",