[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] 03/03: ATS test: Give ATS time to come up with sug
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] 03/03: ATS test: Give ATS time to come up with suggestion |
Date: |
Fri, 25 Jan 2019 01:40:00 +0100 |
This is an automated email from the git hooks/post-receive script.
julius-buenger pushed a commit to branch master
in repository gnunet.
commit 92d1fd704da83c27e9aac3d385b8dd6cf0c18a8a
Author: Julius Bünger <address@hidden>
AuthorDate: Thu Jan 24 13:30:42 2019 +0100
ATS test: Give ATS time to come up with suggestion
---
src/ats/test_ats2_lib.c | 21 ++++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)
diff --git a/src/ats/test_ats2_lib.c b/src/ats/test_ats2_lib.c
index b23493239..437e8baf2 100644
--- a/src/ats/test_ats2_lib.c
+++ b/src/ats/test_ats2_lib.c
@@ -32,6 +32,12 @@
static int ret;
+/**
+ * @brief The time available until the test shuts down
+ */
+static struct GNUNET_TIME_Relative timeout;
+
+
/**
* @brief ATS Application Handle
*
@@ -181,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 ();
}
@@ -200,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);
}
@@ -219,6 +233,7 @@ main (int argc,
{
ret = 1;
memset (&other_peer, 0, sizeof (struct GNUNET_PeerIdentity));
+ 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))
--
To stop receiving notification emails like this one, please contact
address@hidden