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: fix #4886


From: gnunet
Subject: [GNUnet-SVN] [taler-exchange] branch master updated: fix #4886
Date: Wed, 08 Feb 2017 16:57:38 +0100

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 387a37f  fix #4886
387a37f is described below

commit 387a37f90e0e06d6534cff83afb8d89784ae9b5a
Author: Christian Grothoff <address@hidden>
AuthorDate: Wed Feb 8 16:57:35 2017 +0100

    fix #4886
---
 src/wire/plugin_wire_sepa.c |  2 +-
 src/wire/test_wire_plugin.c | 27 +++++++++++++++++++--------
 2 files changed, 20 insertions(+), 9 deletions(-)

diff --git a/src/wire/plugin_wire_sepa.c b/src/wire/plugin_wire_sepa.c
index cc00bca..4f1d504 100644
--- a/src/wire/plugin_wire_sepa.c
+++ b/src/wire/plugin_wire_sepa.c
@@ -72,7 +72,7 @@ sepa_amount_round (void *cls,
   if (0 == delta)
     return GNUNET_NO;
   amount->fraction -= delta;
-  return GNUNET_SYSERR;
+  return GNUNET_OK;
 }
 
 
diff --git a/src/wire/test_wire_plugin.c b/src/wire/test_wire_plugin.c
index 9ce8eef..0e24120 100644
--- a/src/wire/test_wire_plugin.c
+++ b/src/wire/test_wire_plugin.c
@@ -1,6 +1,6 @@
 /*
   This file is part of TALER
-  (C) 2015, 2016 GNUnet e.V. and Inria
+  (C) 2015, 2016, 2017 GNUnet e.V. and Inria
 
   TALER is free software; you can redistribute it and/or modify it under the
   terms of the GNU General Public License as published by the Free Software
@@ -52,6 +52,10 @@ struct TestBlock {
    */
   const char *round_out;
 
+  /**
+   * Currency to give to the plugin.
+   */ 
+  const char *currency;
 };
 
 
@@ -65,15 +69,17 @@ static struct TestBlock tests[] = {
     .json_proto = "{  \"type\":\"sepa\", \"iban\":\"DE67830654080004822650\", 
\"name\":\"GNUnet e.V.\", \"bic\":\"GENODEF1SLR\" }",
     .round_in = "EUR:0.123456",
     .round_out = "EUR:0.12",
+    .currency = "EUR"
   },
   {
     .plugin_name = "test",
     .json_proto = "{  \"type\":\"test\", \"bank_uri\":\"http://localhost/\";, 
\"account_number\":42 }",
     .round_in = "KUDOS:0.123456",
     .round_out = "KUDOS:0.12",
+    .currency = "KUDOS"
   },
   {
-    NULL, NULL, NULL, NULL
+    NULL, NULL, NULL, NULL, NULL
   }
 };
 
@@ -192,6 +198,7 @@ run_test (const struct TestBlock *test,
     return GNUNET_SYSERR;
   }
   memset (&in, 0, sizeof (in));
+  GNUNET_log_skip (GNUNET_ERROR_TYPE_ERROR, 1);
   if (GNUNET_SYSERR !=
       plugin->amount_round (plugin->cls,
                             &in))
@@ -229,6 +236,10 @@ main (int argc,
   ret = GNUNET_OK;
   for (i=0;NULL != (test = &tests[i])->plugin_name;i++)
   {
+    GNUNET_CONFIGURATION_set_value_string (cfg,
+                                          "taler",
+                                          "CURRENCY",
+                                          test->currency);
     plugin = TALER_WIRE_plugin_load (cfg,
                                      test->plugin_name);
     GNUNET_assert (NULL != plugin);
@@ -239,16 +250,16 @@ main (int argc,
     TALER_WIRE_plugin_unload (plugin);
     if (GNUNET_OK != ret)
     {
-      fprintf (stdout,
-               "%s FAILED\n",
-               test->plugin_name);
+      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                 "%s FAILED\n",
+                 test->plugin_name);
       break;
     }
     else
     {
-      fprintf (stdout,
-               "%s PASS\n",
-               test->plugin_name);
+      GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE,
+                 "%s PASS\n",
+                 test->plugin_name);
     }
   }
   GNUNET_CONFIGURATION_destroy (cfg);

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



reply via email to

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