gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [gnunet] branch master updated (0c8d3480c -> 92d1fd704)


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated (0c8d3480c -> 92d1fd704)
Date: Fri, 25 Jan 2019 01:39:57 +0100

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

julius-buenger pushed a change to branch master
in repository gnunet.

    from 0c8d3480c tng: towards communicator flow control:
     new 44a86cf53 ATS test: Assert return value non-null
     new b7578171d ATS test: Give return value a meaning
     new 92d1fd704 ATS test: Give ATS time to come up with suggestion

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/ats/test_ats2_lib.c | 41 +++++++++++++++++++++++++++++++++++------
 1 file changed, 35 insertions(+), 6 deletions(-)

diff --git a/src/ats/test_ats2_lib.c b/src/ats/test_ats2_lib.c
index a35b5bce6..437e8baf2 100644
--- a/src/ats/test_ats2_lib.c
+++ b/src/ats/test_ats2_lib.c
@@ -26,6 +26,18 @@
 #include "gnunet_ats_transport_service.h"
 #include "gnunet_testing_lib.h"
 
+/**
+ * @brief Indicates the success of the whole test
+ */
+static int ret;
+
+
+/**
+ * @brief The time available until the test shuts down
+ */
+static struct GNUNET_TIME_Relative timeout;
+
+
 /**
  * @brief ATS Application Handle
  *
@@ -89,6 +101,7 @@ suggestion_cb (void *cls,
                const char *address)
 {
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "suggestion_cb() called\n");
+  ret = 0;
 }
 
 
@@ -148,6 +161,7 @@ provide_info_start (void)
                                "test-address",
                                NULL,
                                &prop);
+  GNUNET_assert (NULL != sr);
 }
 
 
@@ -173,7 +187,16 @@ get_suggestion (void)
                                         &other_peer,
                                         GNUNET_MQ_PREFERENCE_NONE,
                                         GNUNET_BANDWIDTH_VALUE_MAX);
-  GNUNET_ATS_application_suggest_cancel (ash);
+  GNUNET_assert (NULL != ash);
+}
+
+
+static void
+on_shutdown (void *cls)
+{
+  provide_info_end ();
+  finish_both ();
+  GNUNET_SCHEDULER_shutdown ();
 }
 
 
@@ -192,8 +215,7 @@ run (void *cls,
   init_both (cfg);
   provide_info_start ();
   get_suggestion ();
-  provide_info_end ();
-  finish_both ();
+  (void) GNUNET_SCHEDULER_add_delayed (timeout, &on_shutdown, NULL);
 }
 
 
@@ -209,10 +231,17 @@ int
 main (int argc,
       char *argv[])
 {
+  ret = 1;
   memset (&other_peer, 0, sizeof (struct GNUNET_PeerIdentity));
-  return GNUNET_TESTING_peer_run ("test-ats2-lib",
-                                  "test_ats2_lib.conf",
-                                  &run, NULL);
+  timeout = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, 500);
+  if (0 != GNUNET_TESTING_peer_run ("test-ats2-lib",
+                                    "test_ats2_lib.conf",
+                                    &run, NULL))
+  {
+    GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Running the testing peer failed.\n");
+    return 1;
+  }
+  return ret;
 }
 
 

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



reply via email to

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