diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-11-20 20:36:57 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-11-20 20:36:59 +0100 |
commit | 5483c2b5c798fea1fb101604c6766aa071bafce2 (patch) | |
tree | 8a0669b97367d506cd5218b67c9ee8da286f5b63 | |
parent | 06765a1eff683e17184a1444bcb1323a09d229fd (diff) | |
download | merchant-5483c2b5c798fea1fb101604c6766aa071bafce2.tar.gz merchant-5483c2b5c798fea1fb101604c6766aa071bafce2.tar.bz2 merchant-5483c2b5c798fea1fb101604c6766aa071bafce2.zip |
-indent
-rw-r--r-- | src/backenddb/test_merchantdb.c | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/src/backenddb/test_merchantdb.c b/src/backenddb/test_merchantdb.c index fdab4abb..1fbe0e65 100644 --- a/src/backenddb/test_merchantdb.c +++ b/src/backenddb/test_merchantdb.c @@ -4920,6 +4920,7 @@ test_lookup_tip (const struct InstanceData *instance, /** * Tests looking up the details of a tip from the database. + * * @param instance the instance the tip is in. * @param reserve the reserve the tip was authorized from. * @param tip the tip we expect to find (uses @e tip_id to perform lookup). @@ -4928,17 +4929,16 @@ test_lookup_tip (const struct InstanceData *instance, * @param expected_pickups_length the length of @e expected_pickups. * @param expected_pickups the pickups that we expect to be associated with * the tip. - * * @return 0 on success, 1 otherwise. */ static int -test_lookup_tip_details (const struct InstanceData *instance, - const struct ReserveData *reserve, - const struct TipData *tip, - const struct TALER_Amount *expected_total_picked_up, - unsigned int expected_pickups_length, - const struct - TALER_MERCHANTDB_PickupDetails *expected_pickups) +test_lookup_tip_details ( + const struct InstanceData *instance, + const struct ReserveData *reserve, + const struct TipData *tip, + const struct TALER_Amount *expected_total_picked_up, + unsigned int expected_pickups_length, + const struct TALER_MERCHANTDB_PickupDetails *expected_pickups) { struct TALER_Amount total_authorized; struct TALER_Amount total_picked_up; @@ -4948,6 +4948,7 @@ 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 (0 > plugin->lookup_tip_details (plugin->cls, instance->instance.id, @@ -4967,20 +4968,21 @@ test_lookup_tip_details (const struct InstanceData *instance, GNUNET_free (pickups); return 1; } - if ((GNUNET_OK != TALER_amount_cmp_currency (&tip->details.total_amount, - &total_authorized)) || - (0 != TALER_amount_cmp (&tip->details.total_amount, - &total_authorized)) || - (GNUNET_OK != TALER_amount_cmp_currency (expected_total_picked_up, - &total_picked_up)) || - (0 != TALER_amount_cmp (expected_total_picked_up, - &total_picked_up)) || - (0 != strcmp (tip->details.reason, - justification)) || - (tip->expiration.abs_value_us != expiration.abs_value_us) || - (0 != GNUNET_memcmp (&reserve->reserve_pub, - &reserve_pub)) || - (expected_pickups_length != pickups_length)) + if ( (GNUNET_OK != + TALER_amount_cmp_currency (&tip->details.total_amount, + &total_authorized)) || + (0 != TALER_amount_cmp (&tip->details.total_amount, + &total_authorized)) || + (GNUNET_OK != TALER_amount_cmp_currency (expected_total_picked_up, + &total_picked_up)) || + (0 != TALER_amount_cmp (expected_total_picked_up, + &total_picked_up)) || + (0 != strcmp (tip->details.reason, + justification)) || + (tip->expiration.abs_value_us != expiration.abs_value_us) || + (0 != GNUNET_memcmp (&reserve->reserve_pub, + &reserve_pub)) || + (expected_pickups_length != pickups_length) ) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Lookup tip details failed: mismatched data\n"); @@ -5000,8 +5002,7 @@ test_lookup_tip_details (const struct InstanceData *instance, &pickups[j].pickup_id)) && (GNUNET_OK == TALER_amount_cmp_currency ( &expected_pickups[i].requested_amount, - &pickups[j].requested_amount)) - && + &pickups[j].requested_amount)) && (0 == TALER_amount_cmp (&expected_pickups[i].requested_amount, &pickups[j].requested_amount)) && (expected_pickups[i].num_planchets == pickups[j].num_planchets)) |