[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-anastasis] branch master updated: worked on tests problem with li
From: |
gnunet |
Subject: |
[taler-anastasis] branch master updated: worked on tests problem with link |
Date: |
Mon, 04 Nov 2019 17:50:33 +0100 |
This is an automated email from the git hooks/post-receive script.
ds-meister pushed a commit to branch master
in repository anastasis.
The following commit(s) were added to refs/heads/master by this push:
new 4ec36c7 worked on tests problem with link
4ec36c7 is described below
commit 4ec36c76cdcfb729ef576cc4237c600e6be87bc1
Author: Dominik Meister <address@hidden>
AuthorDate: Mon Nov 4 17:50:25 2019 +0100
worked on tests problem with link
---
src/backup-db/Makefile.am | 2 +-
src/backup-db/test_anastasis_db.c | 101 ++++++++++++++++++++++++++++++++------
2 files changed, 88 insertions(+), 15 deletions(-)
diff --git a/src/backup-db/Makefile.am b/src/backup-db/Makefile.am
index 7cf65c3..7321db2 100644
--- a/src/backup-db/Makefile.am
+++ b/src/backup-db/Makefile.am
@@ -50,7 +50,7 @@ test_anastasis_db_postgres_LDFLAGS = \
-lgnunetdb \
-ltalerutil
test_anastasis_db_postgres_LDADD = \
- $(top_srcdir)/backup-db/libanastasis_db.la
+ $(top_srcdir)/backup-db/libanastasisdb.la
TESTS = \
test_anastasis_db_postgres
diff --git a/src/backup-db/test_anastasis_db.c
b/src/backup-db/test_anastasis_db.c
index 8f919cf..6e15215 100644
--- a/src/backup-db/test_anastasis_db.c
+++ b/src/backup-db/test_anastasis_db.c
@@ -67,37 +67,72 @@ static struct ANASTASIS_AccountPubP *accountPubP;
/**
* Amount which is deposited, set to random value
*/
-const struct TALER_Amount *amount;
+static struct TALER_Amount *amount;
/**
* How many posts are paid by the payment
*/
-unsigned int post_counter;
+static unsigned int post_counter;
/**
* Recoverydata which is stored into the Database, set to a random value
*/
-const void *recovery_data;
+static void *recovery_data;
/**
* Truthdata which is stored into the Database, set to a random value
*/
-const void *truth_data;
+static void *truth_data;
+
+/**
+ * Truth for the select test
+ */
+static void **truth;
+
+/**
+ * Handle for the size of the truth
+ */
+static size_t *truthsize;
+
+/**
+ * MimeType for the select test
+ */
+static char **truth_mime;
+
+/**
+ * keyshare for the select test
+ */
+static void **keyshare;
+
+/**
+ * Handle for the size of the keyshare
+ */
+static size_t *keysharesize;
+
+/**
+ * recoverydata for the select test
+ */
+static void **recoverydata;
+
+/**
+ * Handle for the size of the recoverydata
+ */
+static size_t *recoverydatasize;
/**
* Keyshare which is stored into the Database, set to a random value
*/
-const void *key_share;
+static void *key_share;
/**
* Mime-type fo truth
*/
-const char *mime_type;
+static char *mime_type;
/**
* Version of a Recoverydocument
*/
-uint32_t *version;
+static uint32_t *version;
/**
@@ -111,7 +146,7 @@ run (void *cls)
struct GNUNET_CONFIGURATION_Handle *cfg = cls;
struct GNUNET_TIME_Relative rel_time;
- if (NULL == (plugin = ANASTASIS_DB_plugin_load (cls)))
+ if (NULL == (plugin = ANASTASIS_DB_plugin_load (cfg)))
{
result = 77;
return;
@@ -124,19 +159,30 @@ run (void *cls)
return;
}
ANASTASIS_DB_plugin_unload (plugin);
- if (NULL == (plugin = ANASTASIS_DB_plugin_load (cls)))
+ if (NULL == (plugin = ANASTASIS_DB_plugin_load (cfg)))
{
result = 77;
return;
}
+ uint32_t recversion = 1;
+ RND_BLK(accountPubP);
+ RND_BLK(recovery_data);
+ RND_BLK(paymentSecretP);
+ post_counter = 2;
+ RND_BLK(recovery_data);
+ mime_type = "Picture";
+ RND_BLK(key_share);
+ TALER_string_to_amount ("EUR:30",amount);
- FAILIF (ANASTASIS_DB_STATUS_SUCCESS_ONE_RESULT !=
+
+ FAILIF (ANASTASIS_DB_STATUS_SUCCESS_ONE_RESULT !=
plugin->store_recovery_document (plugin->cls,
accountPubP,
recovery_data,
- sizeof (*recovery_data),
+ sizeof (&recovery_data),
paymentSecretP,
version));
+
FAILIF (ANASTASIS_DB_STATUS_SUCCESS_ONE_RESULT !=
plugin->record_payment (plugin->cls,
amount,
@@ -144,17 +190,44 @@ run (void *cls)
post_counter,
rel_time,
paymentSecretP));
+
FAILIF (ANASTASIS_DB_STATUS_SUCCESS_ONE_RESULT !=
plugin->store_truth (plugin->cls,
uuid,
truth_data,
- sizeof (*truth_data),
+ sizeof (&truth_data),
mime_type,
key_share,
- sizeof (*key_share),
+ sizeof (&key_share),
rel_time));
- if (-1 == result)
+ FAILIF (ANASTASIS_DB_STATUS_SUCCESS_ONE_RESULT !=
+ plugin->get_escrow_challenge (plugin->cls,
+ uuid,
+ truth,
+ truthsize,
+ truth_mime));
+
+ FAILIF (ANASTASIS_DB_STATUS_SUCCESS_ONE_RESULT !=
+ plugin->get_key_share (plugin->cls,
+ uuid,
+ keyshare,
+ keysharesize));
+
+ FAILIF (ANASTASIS_DB_STATUS_SUCCESS_ONE_RESULT !=
+ plugin->get_latest_recovery_document (plugin->cls,
+ accountPubP,
+ recoverydatasize,
+ recoverydata,
+ version));
+
+ FAILIF (ANASTASIS_DB_STATUS_SUCCESS_ONE_RESULT !=
+ plugin->get_recovery_document (plugin->cls,
+ accountPubP,
+ recversion,
+ recoverydatasize,
+ recoverydata));
+ if (-1 == result)
result = 0;
drop:
--
To stop receiving notification emails like this one, please contact
address@hidden.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-anastasis] branch master updated: worked on tests problem with link,
gnunet <=