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: offer url trait


From: gnunet
Subject: [GNUnet-SVN] [taler-exchange] branch master updated: offer url trait
Date: Wed, 14 Feb 2018 12:46:35 +0100

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

marcello pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new 5b1e176  offer url trait
5b1e176 is described below

commit 5b1e17617faf356f0d85e7e6bf2b188483bcf351
Author: Marcello Stanisci <address@hidden>
AuthorDate: Wed Feb 14 12:46:01 2018 +0100

    offer url trait
---
 src/exchange-lib/testing_api_cmd_exec_wirewatch.c |  6 ++-
 src/exchange-lib/testing_api_loop.c               |  2 +-
 src/exchange-lib/testing_api_trait_string.c       | 46 +++++++++++++++++++++++
 src/include/taler_testing_lib.h                   | 29 ++++++++++++++
 4 files changed, 81 insertions(+), 2 deletions(-)

diff --git a/src/exchange-lib/testing_api_cmd_exec_wirewatch.c 
b/src/exchange-lib/testing_api_cmd_exec_wirewatch.c
index 107ac55..1ff466f 100644
--- a/src/exchange-lib/testing_api_cmd_exec_wirewatch.c
+++ b/src/exchange-lib/testing_api_cmd_exec_wirewatch.c
@@ -89,7 +89,7 @@ wirewatch_run (void *cls,
  */
 static void
 wirewatch_cleanup (void *cls,
-                  const struct TALER_TESTING_Command *cmd)
+                   const struct TALER_TESTING_Command *cmd)
 {
   struct WirewatchState *ws = cls;
 
@@ -141,6 +141,10 @@ wirewatch_traits (void *cls,
 /**
  * Execute taler-exchange-wirewatch process.
  *
+ * @param label command label
+ * @param config_filename configuration filename
+ *
+ * @return the command
  */
 struct TALER_TESTING_Command
 TALER_TESTING_cmd_exec_wirewatch (const char *label,
diff --git a/src/exchange-lib/testing_api_loop.c 
b/src/exchange-lib/testing_api_loop.c
index f22c99d..c4b6031 100644
--- a/src/exchange-lib/testing_api_loop.c
+++ b/src/exchange-lib/testing_api_loop.c
@@ -537,7 +537,6 @@ main_wrapper (void *cls)
                                             main_ctx)) );
   GNUNET_free (exchange_url);
   GNUNET_CONFIGURATION_destroy (cfg);
-
 }
 
 
@@ -586,6 +585,7 @@ TALER_TESTING_setup (TALER_TESTING_Main main_cb,
   GNUNET_assert (NULL != sigpipe);
   shc_chld = GNUNET_SIGNAL_handler_install
     (GNUNET_SIGCHLD, &sighandler_child_death);
+  /* Blocking */
   GNUNET_SCHEDULER_run (&main_wrapper,
                         &main_ctx);
   GNUNET_SIGNAL_handler_uninstall (shc_chld);
diff --git a/src/exchange-lib/testing_api_trait_string.c 
b/src/exchange-lib/testing_api_trait_string.c
index 308c4ea..94560d3 100644
--- a/src/exchange-lib/testing_api_trait_string.c
+++ b/src/exchange-lib/testing_api_trait_string.c
@@ -34,6 +34,7 @@
 #define TALER_TESTING_TRAIT_CONTRACT_TERMS "contract-terms"
 #define TALER_TESTING_TRAIT_TRANSFER_SUBJECT "transfer-subject"
 #define TALER_TESTING_TRAIT_AMOUNT "amount"
+#define TALER_TESTING_TRAIT_URL "url"
 
 /**
  * Obtain contract terms from @a cmd.
@@ -206,4 +207,49 @@ TALER_TESTING_make_trait_amount
 }
 
 
+/**
+ * Obtain a url from @a cmd.
+ *
+ * @param cmd command to extract trait from
+ * @param index which url is to be picked, in case
+ *        multiple are offered.
+ * @param amount[out] where to write the url.
+ * @return #GNUNET_OK on success
+ */
+int
+TALER_TESTING_get_trait_url
+  (const struct TALER_TESTING_Command *cmd,
+   unsigned int index,
+   const char **url)
+{
+  return cmd->traits (cmd->cls,
+                      (void **) url,
+                      TALER_TESTING_TRAIT_URL,
+                      index);
+}
+
+/**
+ * Offer url in a trait.
+ *
+ * @param index which url is to be picked, in case
+ *        multiple are offered.
+ * @param url the url to offer
+ * @return the trait, to be put in the traits array of the command
+ */
+struct TALER_TESTING_Trait
+TALER_TESTING_make_trait_url
+  (unsigned int index,
+   const char *url)
+{
+  struct TALER_TESTING_Trait ret = {
+    .index = index,
+    .trait_name = TALER_TESTING_TRAIT_URL,
+    .ptr = (const void *) url
+  };
+  return ret;
+}
+
+
+
+
 /* end of testing_api_trait_string.c */
diff --git a/src/include/taler_testing_lib.h b/src/include/taler_testing_lib.h
index de671c9..a78f7f3 100644
--- a/src/include/taler_testing_lib.h
+++ b/src/include/taler_testing_lib.h
@@ -1251,4 +1251,33 @@ TALER_TESTING_get_trait_amount
    unsigned int index,
    const char **amount);
 
+
+/**
+ * Offer url in a trait.
+ *
+ * @param index which url is to be picked, in case
+ *        multiple are offered.
+ * @param url the url to offer
+ * @return the trait, to be put in the traits array of the command
+ */
+struct TALER_TESTING_Trait
+TALER_TESTING_make_trait_url
+  (unsigned int index,
+   const char *url);
+
+/**
+ * Obtain a url from @a cmd.
+ *
+ * @param cmd command to extract trait from
+ * @param index which url is to be picked, in case
+ *        multiple are offered.
+ * @param amount[out] where to write the url.
+ * @return #GNUNET_OK on success
+ */
+int
+TALER_TESTING_get_trait_url
+  (const struct TALER_TESTING_Command *cmd,
+   unsigned int index,
+   const char **url);
+
 #endif

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



reply via email to

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