From 74e6cc62b8cf935d485d93a578a92615718d2e51 Mon Sep 17 00:00:00 2001 From: Jonathan Buchanan Date: Sat, 4 Jul 2020 00:31:12 -0400 Subject: fix compiler warnings for test_merchantdb.c --- src/backenddb/test_merchantdb.c | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) (limited to 'src/backenddb') diff --git a/src/backenddb/test_merchantdb.c b/src/backenddb/test_merchantdb.c index 6ee6a417..cf3fa582 100644 --- a/src/backenddb/test_merchantdb.c +++ b/src/backenddb/test_merchantdb.c @@ -3234,11 +3234,11 @@ make_transfer (const struct ExchangeSignkeyData *signkey, details[i].coin_pub = deposits[i].coin_pub; details[i].coin_value = deposits[i].amount_with_fee; details[i].coin_fee = deposits[i].deposit_fee; - GNUNET_assert (GNUNET_OK == + GNUNET_assert (0 <= TALER_amount_add (&transfer->data.total_amount, &transfer->data.total_amount, &deposits[i].amount_with_fee)); - GNUNET_assert (GNUNET_OK == + GNUNET_assert (0 <= TALER_amount_add (&transfer->deposit_fee, &transfer->deposit_fee, &deposits[i].deposit_fee)); @@ -3283,9 +3283,9 @@ test_lookup_transfer (const struct TransferData *transfer) "Lookup transfer failed\n"); return 1; } - GNUNET_assert (GNUNET_OK == TALER_amount_add (&total_with_fee, - &transfer->data.total_amount, - &transfer->data.wire_fee)); + GNUNET_assert (0 <= TALER_amount_add (&total_with_fee, + &transfer->data.total_amount, + &transfer->data.wire_fee)); if ((GNUNET_OK != TALER_amount_cmp_currency (&total_with_fee, &total)) || (0 != TALER_amount_cmp (&total_with_fee, @@ -4648,17 +4648,18 @@ test_lookup_tip_details (const struct InstanceData *instance, unsigned int pickups_length; struct TALER_MERCHANTDB_PickupDetails *pickups = NULL; unsigned int results_matching[expected_pickups_length]; - if (TALER_EC_NONE != plugin->lookup_tip_details (plugin->cls, - instance->instance.id, - &tip->details.tip_id, - true, - &total_authorized, - &total_picked_up, - &justification, - &expiration, - &reserve_pub, - &pickups_length, - &pickups)) + if (0 > + plugin->lookup_tip_details (plugin->cls, + instance->instance.id, + &tip->details.tip_id, + true, + &total_authorized, + &total_picked_up, + &justification, + &expiration, + &reserve_pub, + &pickups_length, + &pickups)) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Lookup tip details failed\n"); @@ -5707,7 +5708,7 @@ run_test_refunds (struct TestRefunds_Closure *cls) GNUNET_assert (GNUNET_OK == TALER_string_to_amount ("EUR:1000.00", &inc)); - TEST_COND_RET_ON_FAIL (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != + TEST_COND_RET_ON_FAIL (TALER_MERCHANTDB_RS_TOO_HIGH == plugin->increase_refund (plugin->cls, cls->instance.instance.id, cls->order.id, @@ -5718,7 +5719,7 @@ run_test_refunds (struct TestRefunds_Closure *cls) GNUNET_assert (GNUNET_OK == TALER_string_to_amount ("EUR:1.00", &inc)); - TEST_COND_RET_ON_FAIL (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT == + TEST_COND_RET_ON_FAIL (TALER_MERCHANTDB_RS_SUCCESS == plugin->increase_refund (plugin->cls, cls->instance.instance.id, cls->order.id, -- cgit v1.2.3