gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-anastasis] branch master updated: Worked on errors


From: gnunet
Subject: [taler-anastasis] branch master updated: Worked on errors
Date: Wed, 06 Nov 2019 13:59:04 +0100

This is an automated email from the git hooks/post-receive script.

dennis-neufeld pushed a commit to branch master
in repository anastasis.

The following commit(s) were added to refs/heads/master by this push:
     new 41e397b  Worked on errors
41e397b is described below

commit 41e397b51bf39a8785c7ddfd384a8986593a8706
Author: Dennis Neufeld <address@hidden>
AuthorDate: Wed Nov 6 12:58:47 2019 +0000

    Worked on errors
---
 src/backup-db/test_anastasis_db.c | 111 ++++++++++++++++++++++----------------
 1 file changed, 64 insertions(+), 47 deletions(-)

diff --git a/src/backup-db/test_anastasis_db.c 
b/src/backup-db/test_anastasis_db.c
index ce6998f..5c00557 100644
--- a/src/backup-db/test_anastasis_db.c
+++ b/src/backup-db/test_anastasis_db.c
@@ -52,22 +52,22 @@ static struct ANASTASIS_DatabasePlugin *plugin;
 /**
  * Payment Secret for the test, set to a random value
  */
-static struct ANASTASIS_PaymentSecretP *paymentSecretP;
+static struct ANASTASIS_PaymentSecretP paymentSecretP;
 
 /**
  * UUID of the Truth to test, set to a UUID value
  */
-static struct ANASTASIS_uuid *uuid;
+static struct ANASTASIS_uuid uuid;
 
 /**
  * User public key, set to a random value
  */
-static struct ANASTASIS_AccountPubP *accountPubP;
+static struct ANASTASIS_AccountPubP accountPubP;
 
 /**
  * Amount which is deposited, set to random value
  */
-static struct TALER_Amount *amount;
+static struct TALER_Amount amount;
 
 /**
  * How many posts are paid by the payment
@@ -79,6 +79,16 @@ static unsigned int post_counter;
  */
 static void *recovery_data;
 
+/**
+ * Recovery_data for the select test
+ */
+static void **res_recovery_data;
+
+/**
+ * Handle for the size of the recoverydata
+ */
+static size_t *recoverydatasize;
+
 /**
  * Truthdata which is stored into the Database, set to a random value
  */
@@ -95,14 +105,9 @@ static void **truth;
 static size_t *truthsize;
 
 /**
- * MimeType for the select test
- */
-static char **truth_mime;
-
-/**
- * keyshare for the select test
+ * Keyshare which is stored into the Database, set to a random value
  */
-static void **keyshare;
+static void *key_share;
 
 /**
  * Handle for the size of the keyshare
@@ -110,29 +115,29 @@ static void **keyshare;
 static size_t *keysharesize;
 
 /**
- * recoverydata for the select test
+ * Keyshare for the select test
  */
-static void **recoverydata;
+static void **res_key_share;
 
 /**
- * Handle for the size of the recoverydata
+ * Mime-type of truth
  */
-static size_t *recoverydatasize;
+static char *mime_type;
 
 /**
- * Keyshare which is stored into the Database, set to a random value
+ * Mime-type of truth for the select test
  */
-static void *key_share;
+static char **res_mime_type;
 
 /**
- * Mime-type fo truth
+ * Version of a Recoverydocument
  */
-static char *mime_type;
+static uint32_t *version;
 
 /**
- * Version of a Recoverydocument
+ * Version of the latest Recoverydocument
  */
-static uint32_t *version;
+static uint32_t *res_version;
 
 
 /**
@@ -164,36 +169,48 @@ run (void *cls)
     result = 77;
     return;
   }
+
   uint32_t recversion = 1;
-  RND_BLK(accountPubP);
-  RND_BLK(recovery_data);
-  RND_BLK(paymentSecretP);
+  RND_BLK (&accountPubP);
+
+  int rec_val = 100;
+  recovery_data = &rec_val;
+  RND_BLK (recovery_data);
+  
+  RND_BLK (&paymentSecretP);
+
+  int truth_val = 300;
+  truth_data = &truth_val;
+  RND_BLK (&truth_data);
+
+  int key_val = 300;
+  key_share = &key_val;
+  RND_BLK (&key_share);
+
   post_counter = 2;
-  RND_BLK(recovery_data);
   mime_type = "Picture";
-  RND_BLK(key_share);
-  TALER_string_to_amount ("EUR:30",amount);
+  TALER_string_to_amount ("EUR:30",&amount);
+  uuid = (struct ANASTASIS_uuid) {"550e8400-e29b-11d4-a716-446655440000"};
 
-
-    FAILIF (ANASTASIS_DB_STATUS_SUCCESS_ONE_RESULT !=
+  FAILIF (ANASTASIS_DB_STATUS_SUCCESS_ONE_RESULT !=
           plugin->store_recovery_document (plugin->cls,
-                                           accountPubP,
-                                           recovery_data,
+                                           &accountPubP,
+                                           &recovery_data,
                                            sizeof (&recovery_data),
-                                           paymentSecretP,
+                                           &paymentSecretP,
                                            version));
-
+ 
   FAILIF (ANASTASIS_DB_STATUS_SUCCESS_ONE_RESULT !=
           plugin->record_payment (plugin->cls,
-                                  amount,
-                                  accountPubP,
+                                  &amount,
+                                  &accountPubP,
                                   post_counter,
                                   rel_time,
-                                  paymentSecretP));
+                                  &paymentSecretP));
 
   FAILIF (ANASTASIS_DB_STATUS_SUCCESS_ONE_RESULT !=
           plugin->store_truth (plugin->cls,
-                               uuid,
+                               &uuid,
                                truth_data,
                                sizeof (&truth_data),
                                mime_type,
@@ -203,31 +220,31 @@ run (void *cls)
 
   FAILIF (ANASTASIS_DB_STATUS_SUCCESS_ONE_RESULT !=
           plugin->get_escrow_challenge (plugin->cls,
-                               uuid,
+                               &uuid,
                                truth,
                                truthsize,
-                               truth_mime));
+                               res_mime_type));
 
   FAILIF (ANASTASIS_DB_STATUS_SUCCESS_ONE_RESULT !=
           plugin->get_key_share (plugin->cls,
-                               uuid,
-                               keyshare,
+                               &uuid,
+                               res_key_share,
                                keysharesize));
 
   FAILIF (ANASTASIS_DB_STATUS_SUCCESS_ONE_RESULT !=
           plugin->get_latest_recovery_document (plugin->cls,
-                               accountPubP,
+                               &accountPubP,
                                recoverydatasize,
-                               recoverydata,
-                               version));
+                               res_recovery_data,
+                               res_version));
 
   FAILIF (ANASTASIS_DB_STATUS_SUCCESS_ONE_RESULT !=
           plugin->get_recovery_document (plugin->cls,
-                                         accountPubP,
+                                         &accountPubP,
                                          recversion,
                                          recoverydatasize,
-                                         recoverydata));
-    if (-1 == result)
+                                         res_recovery_data));
+  if (-1 == result)
     result = 0;
 
 drop:

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]