gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-exchange] branch master updated: remove test code co


From: gnunet
Subject: [GNUnet-SVN] [taler-exchange] branch master updated: remove test code coverage for auditordb
Date: Sun, 09 Apr 2017 21:47:42 +0200

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

grothoff pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new d7386ca  remove test code coverage for auditordb
d7386ca is described below

commit d7386cae0f19db064a13ed9a4e8cde8c02b79588
Author: Christian Grothoff <address@hidden>
AuthorDate: Sun Apr 9 21:47:40 2017 +0200

    remove test code coverage for auditordb
---
 src/auditordb/test_auditordb.c | 96 +++++++++++++++++++++++++++++++++---------
 1 file changed, 77 insertions(+), 19 deletions(-)

diff --git a/src/auditordb/test_auditordb.c b/src/auditordb/test_auditordb.c
index 0e146e3..3e8b191 100644
--- a/src/auditordb/test_auditordb.c
+++ b/src/auditordb/test_auditordb.c
@@ -63,6 +63,23 @@ static int result = -1;
 static struct TALER_AUDITORDB_Plugin *plugin;
 
 
+static int
+select_denomination_info_result (void *cls,
+                                 const struct TALER_DenominationKeyValidityPS 
*issue2)
+{
+  const struct TALER_DenominationKeyValidityPS *issue1 = cls;
+
+  if (0 != memcmp (issue1, issue2, sizeof (*issue2)))
+  {
+    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                "select_denomination_info_result: issue does not match\n");
+    GNUNET_break (0);
+    return GNUNET_SYSERR;
+  }
+  return GNUNET_OK;
+}
+
+
 /**
  * Main function that will be run by the scheduler.
  *
@@ -99,10 +116,18 @@ run (void *cls)
     goto drop;
   }
 
+  FAILIF (GNUNET_OK !=
+          plugin->start (plugin->cls,
+                         session));
+
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
               "initializing\n");
 
-  struct TALER_Amount value, fee_withdraw, fee_deposit, fee_refresh, 
fee_refund;
+  struct TALER_Amount value;
+  struct TALER_Amount fee_withdraw;
+  struct TALER_Amount fee_deposit;
+  struct TALER_Amount fee_refresh;
+  struct TALER_Amount fee_refund;
 
   GNUNET_assert (GNUNET_OK ==
                  TALER_string_to_amount (CURRENCY ":1.000010",
@@ -176,22 +201,6 @@ run (void *cls)
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
               "Test: select_denomination_info\n");
 
-  int
-  select_denomination_info_result (void *cls,
-                                   const struct 
TALER_DenominationKeyValidityPS *issue2)
-  {
-    const struct TALER_DenominationKeyValidityPS *issue1 = cls;
-
-    if (0 != memcmp (issue1, issue2, sizeof (*issue2)))
-    {
-      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                  "select_denomination_info_result: issue does not match\n");
-      GNUNET_break (0);
-      return GNUNET_SYSERR;
-    }
-    return GNUNET_OK;
-  }
-
   FAILIF (GNUNET_OK !=
           plugin->select_denomination_info (plugin->cls,
                                             session,
@@ -527,6 +536,7 @@ run (void *cls)
                                           past,
                                           &rbalance));
 
+
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
               "Test: select_historic_losses\n");
 
@@ -646,6 +656,37 @@ run (void *cls)
                                            &master_pub,
                                            &rbalance));
 
+  FAILIF (GNUNET_OK !=
+          plugin->insert_wire_fee_summary (plugin->cls,
+                                           session,
+                                           &master_pub,
+                                           &rbalance));
+  FAILIF (GNUNET_OK !=
+          plugin->update_wire_fee_summary (plugin->cls,
+                                           session,
+                                           &master_pub,
+                                           &reserve_profits));
+  {
+    struct TALER_Amount rprof;
+
+    FAILIF (GNUNET_OK !=
+            plugin->get_wire_fee_summary (plugin->cls,
+                                          session,
+                                          &master_pub,
+                                          &rprof));
+    FAILIF (0 !=
+            TALER_amount_cmp (&rprof,
+                              &reserve_profits));
+  }
+  FAILIF (GNUNET_OK !=
+          plugin->commit (plugin->cls,
+                          session));
+
+
+  FAILIF (GNUNET_OK !=
+          plugin->start (plugin->cls,
+                         session));
+
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
               "Test: get_predicted_balance\n");
 
@@ -655,12 +696,29 @@ run (void *cls)
                                          &master_pub,
                                          &rbalance2));
 
-  FAILIF (0 != memcmp (&rbalance2, &rbalance, sizeof (rbalance)));
+  FAILIF (GNUNET_OK !=
+          plugin->del_reserve_info (plugin->cls,
+                                    session,
+                                    &reserve_pub,
+                                    &master_pub));
+
+
+  FAILIF (0 != TALER_amount_cmp (&rbalance2,
+                                 &rbalance));
+
+  plugin->rollback (plugin->cls,
+                    session);
+
+#if GC_IMPLEMENTED
+  FAILIF (GNUNET_OK !=
+          plugin->gc (plugin->cls));
+#endif
 
   result = 0;
 
 drop:
-
+  plugin->rollback (plugin->cls,
+                    session);
   GNUNET_break (GNUNET_OK ==
                 plugin->drop_tables (plugin->cls));
   TALER_AUDITORDB_plugin_unload (plugin);

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



reply via email to

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