aboutsummaryrefslogtreecommitdiff
path: root/src/backenddb/test_merchantdb.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2024-01-10 20:16:47 +0100
committerChristian Grothoff <christian@grothoff.org>2024-01-10 20:16:47 +0100
commit0160ac24bce1eae4239045a430d8df00ab25ffd9 (patch)
treea772eb58982cfb051ad8b62f0e814dfdbf47d5e8 /src/backenddb/test_merchantdb.c
parent7043ed3e8d5a96bb3765c5ea5438233b33f41c61 (diff)
fix #8060
Diffstat (limited to 'src/backenddb/test_merchantdb.c')
-rw-r--r--src/backenddb/test_merchantdb.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/backenddb/test_merchantdb.c b/src/backenddb/test_merchantdb.c
index 8d684371..e9a17b34 100644
--- a/src/backenddb/test_merchantdb.c
+++ b/src/backenddb/test_merchantdb.c
@@ -3302,7 +3302,7 @@ struct TransferData
static void
make_transfer (const struct ExchangeSignkeyData *signkey,
unsigned int deposits_length,
- const struct DepositData deposits[],
+ const struct DepositData deposits[static deposits_length],
struct TransferData *transfer)
{
struct TALER_TrackTransferDetails *details = NULL;
@@ -4184,6 +4184,9 @@ pre_test_transfers (struct TestTransfers_Closure *cls)
static void
post_test_transfers (struct TestTransfers_Closure *cls)
{
+ GNUNET_array_grow (cls->transfers->data.details,
+ cls->transfers->data.details_length,
+ 0);
free_instance_data (&cls->instance);
free_order_data (&cls->order);
}
@@ -5020,6 +5023,8 @@ test_lookup_reward_details (
return 1;
}
}
+ GNUNET_free (justification);
+ GNUNET_free (pickups);
return 0;
}
@@ -5125,6 +5130,9 @@ test_lookup_pickup (
return 1;
}
}
+ GNUNET_free (exchange_url);
+ free_signature_array (expected_sigs_length,
+ sigs);
return 0;
}
@@ -5344,6 +5352,9 @@ pre_test_rewards (struct TestRewards_Closure *cls)
GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK,
&cls->reserve.master_pub,
sizeof (cls->reserve.master_pub));
+ GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK,
+ &cls->pickup_id,
+ sizeof (cls->pickup_id));
cls->reserve.expiration = GNUNET_TIME_relative_to_timestamp (
GNUNET_TIME_UNIT_WEEKS);
@@ -5632,6 +5643,7 @@ static int
test_rewards (void)
{
struct TestRewards_Closure test_cls;
+
pre_test_rewards (&test_cls);
int test_result = run_test_rewards (&test_cls);
post_test_rewards (&test_cls);
@@ -6471,9 +6483,10 @@ pre_test_lookup_orders_all_filters (
i);
make_order (cls->order_ids[i],
&cls->orders[i]);
- GNUNET_assert (0 == json_object_set (cls->orders[i].contract,
- "order_id",
- json_string (cls->order_ids[i])));
+ GNUNET_assert (0 ==
+ json_object_set_new (cls->orders[i].contract,
+ "order_id",
+ json_string (cls->order_ids[i])));
make_deposit (&cls->instance,
&cls->account,
&cls->orders[i],
@@ -6795,6 +6808,8 @@ test_kyc (void)
&kyc_status_ok,
&fail));
TEST_RET_ON_FAIL (fail);
+ json_decref (instance.instance.address);
+ json_decref (instance.instance.jurisdiction);
return 0;
}