aboutsummaryrefslogtreecommitdiff
path: root/src/backenddb/test_merchantdb.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2024-03-19 09:52:21 +0100
committerChristian Grothoff <christian@grothoff.org>2024-03-19 09:52:21 +0100
commit88a23388c11a755fece7221579be1143e48d32c5 (patch)
treea1dd9f4e08903993dae1df92fd1f2ecb2d94b674 /src/backenddb/test_merchantdb.c
parentef8927863d6f39098c1c68bbc0bf8a36319caccf (diff)
implement protocol v13 (#8638)
Diffstat (limited to 'src/backenddb/test_merchantdb.c')
-rw-r--r--src/backenddb/test_merchantdb.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/backenddb/test_merchantdb.c b/src/backenddb/test_merchantdb.c
index 60a0b08b..1a4c15db 100644
--- a/src/backenddb/test_merchantdb.c
+++ b/src/backenddb/test_merchantdb.c
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- (C) 2014-2023 Taler Systems SA
+ (C) 2014-2024 Taler Systems SA
TALER is free software; you can redistribute it and/or modify it under the
terms of the GNU Lesser General Public License as published by the Free Software
@@ -5718,15 +5718,16 @@ lookup_templates_cb (void *cls,
const char *template_description)
{
struct TestLookupTemplates_Closure *cmp = cls;
+
if (NULL == cmp)
return;
cmp->results_length += 1;
for (unsigned int i = 0; cmp->templates_to_cmp_length > i; ++i)
{
- if ((0 == strcmp (cmp->templates_to_cmp[i].id,
- template_id)) &&
- (0 == strcmp (cmp->templates_to_cmp[i].template.template_description,
- template_description)) )
+ if ( (0 == strcmp (cmp->templates_to_cmp[i].id,
+ template_id)) &&
+ (0 == strcmp (cmp->templates_to_cmp[i].template.template_description,
+ template_description)) )
cmp->results_matching[i] += 1;
}
}
@@ -5752,7 +5753,10 @@ test_lookup_templates (const struct InstanceData *instance,
.results_matching = results_matching,
.results_length = 0
};
- memset (results_matching, 0, sizeof (unsigned int) * templates_length);
+
+ memset (results_matching,
+ 0,
+ sizeof (unsigned int) * templates_length);
if (0 > plugin->lookup_templates (plugin->cls,
instance->instance.id,
&lookup_templates_cb,
@@ -5915,7 +5919,6 @@ run_test_templates (struct TestTemplates_Closure *cls)
"otp_id",
&td));
}
-
GNUNET_assert (0 ==
json_array_append_new (
cls->templates[0].template.template_contract,
@@ -5923,7 +5926,6 @@ run_test_templates (struct TestTemplates_Closure *cls)
TEST_RET_ON_FAIL (test_update_template (&cls->instance,
&cls->templates[0],
GNUNET_DB_STATUS_SUCCESS_ONE_RESULT));
-
TEST_RET_ON_FAIL (test_lookup_template (&cls->instance,
&cls->templates[0]));
TEST_RET_ON_FAIL (test_update_template (&cls->instance,
@@ -5961,8 +5963,13 @@ static int
test_templates (void)
{
struct TestTemplates_Closure test_cls;
+ int test_result;
+
+ memset (&test_cls,
+ 0,
+ sizeof (test_cls));
pre_test_templates (&test_cls);
- int test_result = run_test_templates (&test_cls);
+ test_result = run_test_templates (&test_cls);
post_test_templates (&test_cls);
return test_result;
}