donau

Donation authority for GNU Taler (experimental)
Log | Files | Refs | Submodules | README | LICENSE

commit 2d671bbac066be29f2cfbabd9f1ed2b31c2d9ae4
parent c7fc1637aa8cefc884b15e7e21b9fb893d57c8e3
Author: Casaburi Johannes <johannes.casaburi@students.bfh.ch>
Date:   Thu, 25 Apr 2024 16:54:05 +0200

fix db tests

Diffstat:
Msrc/donau/donau-httpd_batch-submit.c | 7++++---
Msrc/donaudb/test_donaudb.c | 16+++++++++++++++-
2 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/src/donau/donau-httpd_batch-submit.c b/src/donau/donau-httpd_batch-submit.c @@ -154,8 +154,8 @@ DH_handler_submit_receipts_post (struct DH_RequestContext *rc, qs = DH_plugin->insert_submitted_receipts ( DH_plugin->cls, irc.h_tax_number, - irc.donation_receipts, num_dr, + irc.donation_receipts, irc.donation_year); if (qs < 0) @@ -168,10 +168,11 @@ DH_handler_submit_receipts_post (struct DH_RequestContext *rc, "donation_receipts"); } - // FIXME create donation statement + // FIXME + // Fetch donation receipts and join with donation units to get amount + // then create donation statement // Send back DS - // FIXME return MHD_HTTP_OK; } diff --git a/src/donaudb/test_donaudb.c b/src/donaudb/test_donaudb.c @@ -80,6 +80,7 @@ run (void *cls) // Charity information json_t *charities; struct DONAU_CharityPublicKeyP charity_pub; + struct DONAUDB_CharityMetaData charity_meta; const char *charity_name; const char *charity_url; struct TALER_Amount max_per_year; @@ -109,6 +110,8 @@ run (void *cls) if (GNUNET_OK != plugin->create_tables (plugin->cls)) { + fprintf (stderr, + "Failed to create DB tables\n"); result = 77; goto cleanup; } @@ -117,12 +120,18 @@ run (void *cls) plugin->start (plugin->cls, "test-1")); + fprintf (stderr, + "Running DB tests\n"); + /* test DB is empty */ + #ifdef SKIP charity_id = 1; + fprintf (stderr, + "Running lookup charity test...\n"); FAILIF (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS != plugin->lookup_charity (plugin->cls, charity_id, - NULL)); + &charity_meta)); /* test insert charity */ current_year = 2024; @@ -194,6 +203,11 @@ run (void *cls) NULL, NULL)); // TODO Add more tests + #endif + + plugin->preflight (plugin->cls); + + result = 0; drop: if (0 != result)