summaryrefslogtreecommitdiff
path: root/src/testing
diff options
context:
space:
mode:
authorChristian Grothoff <grothoff@gnunet.org>2023-05-18 15:32:08 +0200
committerChristian Grothoff <grothoff@gnunet.org>2023-05-18 15:32:08 +0200
commitdb344e1a2abbe932ec0efb67ab6ff5995c31e598 (patch)
tree3a5e4fa7bf3b93367d01d853996d0be72273a99a /src/testing
parent549e70fbc14fc18db7f5fe9266e91b7d13818671 (diff)
downloadmerchant-db344e1a2abbe932ec0efb67ab6ff5995c31e598.tar.gz
merchant-db344e1a2abbe932ec0efb67ab6ff5995c31e598.tar.bz2
merchant-db344e1a2abbe932ec0efb67ab6ff5995c31e598.zip
rename .success to .ok for consistency
Diffstat (limited to 'src/testing')
-rw-r--r--src/testing/testing_api_cmd_get_instance.c6
-rw-r--r--src/testing/testing_api_cmd_get_instances.c4
-rw-r--r--src/testing/testing_api_cmd_get_products.c4
-rw-r--r--src/testing/testing_api_cmd_get_template.c14
-rw-r--r--src/testing/testing_api_cmd_merchant_get_order.c32
-rw-r--r--src/testing/testing_api_cmd_merchant_get_tip.c22
-rw-r--r--src/testing/testing_api_cmd_pay_order.c6
-rw-r--r--src/testing/testing_api_cmd_tip_pickup.c4
-rw-r--r--src/testing/testing_api_cmd_wallet_get_order.c12
-rw-r--r--src/testing/testing_api_cmd_wallet_get_tip.c6
10 files changed, 55 insertions, 55 deletions
diff --git a/src/testing/testing_api_cmd_get_instance.c b/src/testing/testing_api_cmd_get_instance.c
index 0127a13d..be492009 100644
--- a/src/testing/testing_api_cmd_get_instance.c
+++ b/src/testing/testing_api_cmd_get_instance.c
@@ -125,7 +125,7 @@ get_instance_cb (void *cls,
case MHD_HTTP_OK:
{
const struct TALER_MERCHANT_InstanceDetails *details =
- &igr->details.success.details;
+ &igr->details.ok.details;
{
const char **name;
@@ -270,7 +270,7 @@ get_instance_cb (void *cls,
expected. */
if (gis->cmp_accounts)
{
- unsigned int have_al = igr->details.success.accounts_length;
+ unsigned int have_al = igr->details.ok.accounts_length;
unsigned int expected_accounts_length =
gis->active_accounts_length + gis->inactive_accounts_length;
unsigned int matches[GNUNET_NZL (have_al)];
@@ -291,7 +291,7 @@ get_instance_cb (void *cls,
for (unsigned int i = 0; i < have_al; ++i)
{
const struct TALER_MERCHANT_Account *account
- = &igr->details.success.accounts[i];
+ = &igr->details.ok.accounts[i];
for (unsigned int j = 0; j < gis->active_accounts_length; ++j)
{
if ((0 == strcasecmp (account->payto_uri,
diff --git a/src/testing/testing_api_cmd_get_instances.c b/src/testing/testing_api_cmd_get_instances.c
index 5fb17746..8dfba4e7 100644
--- a/src/testing/testing_api_cmd_get_instances.c
+++ b/src/testing/testing_api_cmd_get_instances.c
@@ -96,9 +96,9 @@ get_instances_cb (void *cls,
case MHD_HTTP_OK:
{
unsigned int iis_length
- = igr->details.success.iis_length;
+ = igr->details.ok.iis_length;
const struct TALER_MERCHANT_InstanceInformation *iis
- = igr->details.success.iis;
+ = igr->details.ok.iis;
if (iis_length != gis->instances_length)
{
diff --git a/src/testing/testing_api_cmd_get_products.c b/src/testing/testing_api_cmd_get_products.c
index dbf5be39..06762a9e 100644
--- a/src/testing/testing_api_cmd_get_products.c
+++ b/src/testing/testing_api_cmd_get_products.c
@@ -96,9 +96,9 @@ get_products_cb (void *cls,
case MHD_HTTP_OK:
{
unsigned int products_length
- = gpr->details.success.products_length;
+ = gpr->details.ok.products_length;
const struct TALER_MERCHANT_InventoryEntry *products
- = gpr->details.success.products;
+ = gpr->details.ok.products;
if (products_length != gis->products_length)
{
diff --git a/src/testing/testing_api_cmd_get_template.c b/src/testing/testing_api_cmd_get_template.c
index 3866d6fa..ae261e0c 100644
--- a/src/testing/testing_api_cmd_get_template.c
+++ b/src/testing/testing_api_cmd_get_template.c
@@ -104,7 +104,7 @@ get_template_cb (void *cls,
TALER_TESTING_get_trait_template_description (template_cmd,
&expected_description))
TALER_TESTING_interpreter_fail (gis->is);
- if (0 != strcmp (tgr->details.success.template_description,
+ if (0 != strcmp (tgr->details.ok.template_description,
*expected_description))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@@ -120,15 +120,15 @@ get_template_cb (void *cls,
TALER_TESTING_get_trait_template_pos_key (template_cmd,
&expected_pos_key))
TALER_TESTING_interpreter_fail (gis->is);
- if ( ( (NULL == tgr->details.success.pos_key) && (NULL != *expected_pos_key)) ||
- ( (NULL != tgr->details.success.pos_key) && (NULL == *expected_pos_key)) ||
- ( (NULL != tgr->details.success.pos_key) &&
- (0 != strcmp (tgr->details.success.pos_key,
+ if ( ( (NULL == tgr->details.ok.pos_key) && (NULL != *expected_pos_key)) ||
+ ( (NULL != tgr->details.ok.pos_key) && (NULL == *expected_pos_key)) ||
+ ( (NULL != tgr->details.ok.pos_key) &&
+ (0 != strcmp (tgr->details.ok.pos_key,
*expected_pos_key)) ) )
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Template pos_key `%s' does not match `%s'\n",
- tgr->details.success.pos_key,
+ tgr->details.ok.pos_key,
*expected_pos_key);
TALER_TESTING_interpreter_fail (gis->is);
return;
@@ -141,7 +141,7 @@ get_template_cb (void *cls,
TALER_TESTING_get_trait_template_contract (template_cmd,
&expected_template_contract))
TALER_TESTING_interpreter_fail (gis->is);
- if (1 != json_equal (tgr->details.success.template_contract,
+ if (1 != json_equal (tgr->details.ok.template_contract,
expected_template_contract))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
diff --git a/src/testing/testing_api_cmd_merchant_get_order.c b/src/testing/testing_api_cmd_merchant_get_order.c
index 917a4a23..b9a8a954 100644
--- a/src/testing/testing_api_cmd_merchant_get_order.c
+++ b/src/testing/testing_api_cmd_merchant_get_order.c
@@ -156,14 +156,14 @@ merchant_get_order_cb (
switch (osr->hr.http_status)
{
case MHD_HTTP_OK:
- if (gos->osc != osr->details.success.status)
+ if (gos->osc != osr->details.ok.status)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Order paid does not match\n");
TALER_TESTING_interpreter_fail (gos->is);
return;
}
- switch (osr->details.success.status)
+ switch (osr->details.ok.status)
{
case TALER_MERCHANT_OSC_PAID:
{
@@ -236,7 +236,7 @@ merchant_get_order_cb (
}
if (1 != json_equal (ct,
- osr->details.success.details.paid.contract_terms))
+ osr->details.ok.details.paid.contract_terms))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Order contract terms do not match\n");
@@ -246,14 +246,14 @@ merchant_get_order_cb (
json_decref (ct);
}
- if (gos->wired != osr->details.success.details.paid.wired)
+ if (gos->wired != osr->details.ok.details.paid.wired)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Order wired does not match\n");
TALER_TESTING_interpreter_fail (gos->is);
return;
}
- if (gos->transfers_length != osr->details.success.details.paid.wts_len)
+ if (gos->transfers_length != osr->details.ok.details.paid.wts_len)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Number of transfers found does not match\n");
@@ -280,7 +280,7 @@ merchant_get_order_cb (
return;
}
if (0 != GNUNET_memcmp (wtid,
- &osr->details.success.details.paid.wts[i].
+ &osr->details.ok.details.paid.wts[i].
wtid))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@@ -302,7 +302,7 @@ merchant_get_order_cb (
return;
}
if (0 != strcmp (*exchange_url,
- osr->details.success.details.paid.wts[i].
+ osr->details.ok.details.paid.wts[i].
exchange_url))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@@ -312,7 +312,7 @@ merchant_get_order_cb (
}
}
}
- if (gos->refunded != osr->details.success.details.paid.refunded)
+ if (gos->refunded != osr->details.ok.details.paid.refunded)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Order refunded does not match\n");
@@ -320,7 +320,7 @@ merchant_get_order_cb (
return;
}
if (gos->refunds_length !=
- osr->details.success.details.paid.refunds_len)
+ osr->details.ok.details.paid.refunds_len)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Number of refunds found does not match\n");
@@ -331,7 +331,7 @@ merchant_get_order_cb (
GNUNET_assert (
GNUNET_OK ==
TALER_amount_set_zero (
- osr->details.success.details.paid.refund_amount.currency,
+ osr->details.ok.details.paid.refund_amount.currency,
&refunded_total));
for (unsigned int i = 0; i < gos->refunds_length; ++i)
{
@@ -343,7 +343,7 @@ merchant_get_order_cb (
{
const struct TALER_Amount *expected_amount;
struct TALER_Amount *amount_found =
- &osr->details.success.details.paid.refunds[i].refund_amount;
+ &osr->details.ok.details.paid.refunds[i].refund_amount;
if (GNUNET_OK !=
TALER_TESTING_get_trait_amount (refund_cmd,
@@ -383,7 +383,7 @@ merchant_get_order_cb (
}
if (0 != strcmp (
*expected_reason,
- osr->details.success.details.paid.refunds[i].reason))
+ osr->details.ok.details.paid.refunds[i].reason))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Refund reason does not match\n");
@@ -393,7 +393,7 @@ merchant_get_order_cb (
}
}
- if (gos->wired != osr->details.success.details.paid.wired)
+ if (gos->wired != osr->details.ok.details.paid.wired)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Order wired does not match\n");
@@ -414,12 +414,12 @@ merchant_get_order_cb (
if (GNUNET_OK !=
TALER_MERCHANT_parse_pay_uri (
- osr->details.success.details.unpaid.taler_pay_uri,
+ osr->details.ok.details.unpaid.taler_pay_uri,
&pud))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Taler pay uri `%s' is malformed\n",
- osr->details.success.details.unpaid.taler_pay_uri);
+ osr->details.ok.details.unpaid.taler_pay_uri);
TALER_TESTING_interpreter_fail (gos->is);
return;
}
@@ -472,7 +472,7 @@ merchant_get_order_cb (
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Order pay uri `%s' does not match, wanted %s/%s\n",
- osr->details.success.details.unpaid.taler_pay_uri,
+ osr->details.ok.details.unpaid.taler_pay_uri,
host,
*order_id);
TALER_TESTING_interpreter_fail (gos->is);
diff --git a/src/testing/testing_api_cmd_merchant_get_tip.c b/src/testing/testing_api_cmd_merchant_get_tip.c
index a8e7a67e..4dd1613a 100644
--- a/src/testing/testing_api_cmd_merchant_get_tip.c
+++ b/src/testing/testing_api_cmd_merchant_get_tip.c
@@ -110,16 +110,16 @@ merchant_get_tip_cb (void *cls,
const struct TALER_Amount *initial_amount;
GNUNET_assert (GNUNET_OK ==
- TALER_amount_set_zero (tsr->details.success.total_picked_up.currency,
+ TALER_amount_set_zero (tsr->details.ok.total_picked_up.currency,
&expected_total_picked_up));
if (GNUNET_OK !=
TALER_TESTING_get_trait_amount (authorize_cmd,
&initial_amount))
TALER_TESTING_FAIL (gts->is);
if ((GNUNET_OK !=
- TALER_amount_cmp_currency (&tsr->details.success.total_authorized,
+ TALER_amount_cmp_currency (&tsr->details.ok.total_authorized,
initial_amount)) ||
- (0 != TALER_amount_cmp (&tsr->details.success.total_authorized,
+ (0 != TALER_amount_cmp (&tsr->details.ok.total_authorized,
initial_amount)))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@@ -135,7 +135,7 @@ merchant_get_tip_cb (void *cls,
TALER_TESTING_get_trait_reason (authorize_cmd,
&justification))
TALER_TESTING_FAIL (gts->is);
- if (0 != strcmp (tsr->details.success.reason,
+ if (0 != strcmp (tsr->details.ok.reason,
*justification))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@@ -154,7 +154,7 @@ merchant_get_tip_cb (void *cls,
TALER_TESTING_FAIL (gts->is);
if (GNUNET_TIME_timestamp_cmp (*tip_expiration,
!=,
- tsr->details.success.expiration))
+ tsr->details.ok.expiration))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Tip authorized expiration does not match\n");
@@ -162,7 +162,7 @@ merchant_get_tip_cb (void *cls,
return;
}
}
- if (tsr->details.success.pickups_length != gts->pickups_length)
+ if (tsr->details.ok.pickups_length != gts->pickups_length)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Length of pickups array does not match\n");
@@ -184,7 +184,7 @@ merchant_get_tip_cb (void *cls,
&num_planchets))
TALER_TESTING_FAIL (gts->is);
- if (*num_planchets != tsr->details.success.pickups[i].num_planchets)
+ if (*num_planchets != tsr->details.ok.pickups[i].num_planchets)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Pickup planchet count does not match\n");
@@ -202,9 +202,9 @@ merchant_get_tip_cb (void *cls,
if ( (GNUNET_OK !=
TALER_amount_cmp_currency (total,
- &tsr->details.success.pickups[i].requested_amount)) ||
+ &tsr->details.ok.pickups[i].requested_amount)) ||
(0 != TALER_amount_cmp (total,
- &tsr->details.success.pickups[i].requested_amount)))
+ &tsr->details.ok.pickups[i].requested_amount)))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Pickup planchet sum does not match\n");
@@ -218,10 +218,10 @@ merchant_get_tip_cb (void *cls,
}
if ( (GNUNET_OK !=
TALER_amount_cmp_currency (&expected_total_picked_up,
- &tsr->details.success.total_picked_up)) ||
+ &tsr->details.ok.total_picked_up)) ||
(0 !=
TALER_amount_cmp (&expected_total_picked_up,
- &tsr->details.success.total_picked_up)) )
+ &tsr->details.ok.total_picked_up)) )
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Tip picked up amount does not match\n");
diff --git a/src/testing/testing_api_cmd_pay_order.c b/src/testing/testing_api_cmd_pay_order.c
index ac2d9353..045bb109 100644
--- a/src/testing/testing_api_cmd_pay_order.c
+++ b/src/testing/testing_api_cmd_pay_order.c
@@ -254,13 +254,13 @@ pay_cb (void *cls,
}
if (MHD_HTTP_OK == pr->hr.http_status)
{
- ps->merchant_sig = pr->details.success.merchant_sig;
+ ps->merchant_sig = pr->details.ok.merchant_sig;
if (NULL != ps->pos_key)
{
char *pc;
bool found = false;
- if (NULL == pr->details.success.pos_confirmation)
+ if (NULL == pr->details.ok.pos_confirmation)
{
GNUNET_break (0);
TALER_TESTING_interpreter_fail (ps->is);
@@ -276,7 +276,7 @@ pay_cb (void *cls,
NULL != tok;
tok = strtok (NULL, "\n"))
{
- if (NULL != strstr (pr->details.success.pos_confirmation,
+ if (NULL != strstr (pr->details.ok.pos_confirmation,
tok))
{
found = true;
diff --git a/src/testing/testing_api_cmd_tip_pickup.c b/src/testing/testing_api_cmd_tip_pickup.c
index 76eac167..ded58c88 100644
--- a/src/testing/testing_api_cmd_tip_pickup.c
+++ b/src/testing/testing_api_cmd_tip_pickup.c
@@ -154,14 +154,14 @@ pickup_cb (void *cls,
TALER_TESTING_interpreter_next (tps->is);
return;
}
- if (pd->details.success.num_sigs != tps->num_coins)
+ if (pd->details.ok.num_sigs != tps->num_coins)
TALER_TESTING_FAIL (tps->is);
tps->pcds = GNUNET_new_array (tps->num_coins,
struct TALER_EXCHANGE_PrivateCoinDetails);
for (unsigned int i = 0; i<tps->num_coins; i++)
{
struct TALER_EXCHANGE_PrivateCoinDetails *pcd =
- &pd->details.success.pcds[i];
+ &pd->details.ok.pcds[i];
tps->pcds[i] = *pcd;
TALER_denom_sig_deep_copy (&tps->pcds[i].sig,
diff --git a/src/testing/testing_api_cmd_wallet_get_order.c b/src/testing/testing_api_cmd_wallet_get_order.c
index ac448499..4d00afae 100644
--- a/src/testing/testing_api_cmd_wallet_get_order.c
+++ b/src/testing/testing_api_cmd_wallet_get_order.c
@@ -103,14 +103,14 @@ wallet_get_order_cb (
switch (hr->http_status)
{
case MHD_HTTP_OK:
- if (gos->refunded != owgr->details.success.refunded)
+ if (gos->refunded != owgr->details.ok.refunded)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Order refunded does not match\n");
TALER_TESTING_interpreter_fail (gos->is);
return;
}
- if (gos->refund_pending != owgr->details.success.refund_pending)
+ if (gos->refund_pending != owgr->details.ok.refund_pending)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Order refund pending does not match\n");
@@ -554,10 +554,10 @@ wallet_poll_order_cb (
{
case MHD_HTTP_OK:
pos->paid = true;
- pos->refunded = owgr->details.success.refunded;
- pos->refund_pending = owgr->details.success.refund_pending;
- if (owgr->details.success.refunded)
- pos->refund_available = owgr->details.success.refund_amount;
+ pos->refunded = owgr->details.ok.refunded;
+ pos->refund_pending = owgr->details.ok.refund_pending;
+ if (owgr->details.ok.refunded)
+ pos->refund_available = owgr->details.ok.refund_amount;
break;
case MHD_HTTP_PAYMENT_REQUIRED:
if (NULL != owgr->details.payment_required.already_paid_order_id)
diff --git a/src/testing/testing_api_cmd_wallet_get_tip.c b/src/testing/testing_api_cmd_wallet_get_tip.c
index 3df7a5c5..0cadfbad 100644
--- a/src/testing/testing_api_cmd_wallet_get_tip.c
+++ b/src/testing/testing_api_cmd_wallet_get_tip.c
@@ -108,10 +108,10 @@ wallet_tip_get_cb (void *cls,
{
if ((GNUNET_OK !=
TALER_amount_cmp_currency (&gts->amount_remaining,
- &wgr->details.success.amount_remaining))
+ &wgr->details.ok.amount_remaining))
||
(0 != TALER_amount_cmp (&gts->amount_remaining,
- &wgr->details.success.amount_remaining)))
+ &wgr->details.ok.amount_remaining)))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Amount remaining on tip does not match\n");
@@ -129,7 +129,7 @@ wallet_tip_get_cb (void *cls,
TALER_TESTING_interpreter_fail (gts->is);
if (GNUNET_TIME_timestamp_cmp (*expiration,
!=,
- wgr->details.success.expiration))
+ wgr->details.ok.expiration))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Tip expiration does not match\n");