summaryrefslogtreecommitdiff
path: root/src/testing
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-04-09 23:14:03 +0000
committerChristian Grothoff <christian@grothoff.org>2016-04-09 23:14:03 +0000
commit29e6158507a0758192075ac6ece7ba8e75ddc49a (patch)
treeb91ded48da322f8ba4c9bb0f5504228aa036c2d1 /src/testing
parent5dfcb058ab5db9ae0c4b147d8a99c64ca0980028 (diff)
small API change: do no longer pass rarely needed GNUNET_SCHEDULER_TaskContext to all scheduler tasks; instead, allow the relatively few tasks that need it to obtain the context via GNUNET_SCHEDULER_get_task_context()
Diffstat (limited to 'src/testing')
-rw-r--r--src/testing/gnunet-testing.c8
-rw-r--r--src/testing/test_testing_peerstartup.c3
-rw-r--r--src/testing/test_testing_peerstartup2.c10
-rw-r--r--src/testing/test_testing_sharedservices.c3
-rw-r--r--src/testing/testing.c4
5 files changed, 11 insertions, 17 deletions
diff --git a/src/testing/gnunet-testing.c b/src/testing/gnunet-testing.c
index 1e640ec96..92dd17d98 100644
--- a/src/testing/gnunet-testing.c
+++ b/src/testing/gnunet-testing.c
@@ -197,10 +197,9 @@ create_hostkeys (const unsigned int no)
* Removes the temporary file.
*
* @param cls unused
- * @param tc scheduler context
*/
static void
-cleanup (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+cleanup (void *cls)
{
if (NULL != tmpfilename)
{
@@ -224,14 +223,15 @@ cleanup (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
* Called whenever we can read stdin non-blocking
*
* @param cls unused
- * @param tc scheduler context
*/
static void
-stdin_cb (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+stdin_cb (void *cls)
{
int c;
+ const struct GNUNET_SCHEDULER_TaskContext *tc;
tid = NULL;
+ tc = GNUNET_SCHEDULER_get_task_context ();
if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason))
return;
GNUNET_assert (0 != (GNUNET_SCHEDULER_REASON_READ_READY & tc->reason));
diff --git a/src/testing/test_testing_peerstartup.c b/src/testing/test_testing_peerstartup.c
index 9b0c53642..956788f6c 100644
--- a/src/testing/test_testing_peerstartup.c
+++ b/src/testing/test_testing_peerstartup.c
@@ -63,10 +63,9 @@ struct TestingContext
* Task for shutdown
*
* @param cls the testing context
- * @param tc the tast context
*/
static void
-do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+do_shutdown (void *cls)
{
struct TestingContext *test_ctx = cls;
diff --git a/src/testing/test_testing_peerstartup2.c b/src/testing/test_testing_peerstartup2.c
index edbd24df0..fd46e5c3e 100644
--- a/src/testing/test_testing_peerstartup2.c
+++ b/src/testing/test_testing_peerstartup2.c
@@ -83,7 +83,7 @@ struct TestingContext
static void
-do_shutdown2 (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+do_shutdown2 (void *cls)
{
struct TestingContext *test_ctx = cls;
@@ -102,10 +102,9 @@ do_shutdown2 (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
* Task for shutdown
*
* @param cls the testing context
- * @param tc the tast context
*/
static void
-do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
+do_shutdown (void *cls);
static void
@@ -133,10 +132,9 @@ peer_status_cb (void *cls, struct GNUNET_TESTING_Peer *peer, int success)
* Task for shutdown
*
* @param cls the testing context
- * @param tc the tast context
*/
static void
-do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+do_shutdown (void *cls)
{
struct TestingContext *test_ctx = cls;
@@ -149,7 +147,7 @@ do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
test_ctx));
}
else
- do_shutdown2 (test_ctx, tc);
+ do_shutdown2 (test_ctx);
}
diff --git a/src/testing/test_testing_sharedservices.c b/src/testing/test_testing_sharedservices.c
index 7d1a3905d..ee1ac8530 100644
--- a/src/testing/test_testing_sharedservices.c
+++ b/src/testing/test_testing_sharedservices.c
@@ -64,10 +64,9 @@ struct TestingContext
* Task for shutdown
*
* @param cls the testing context
- * @param tc the tast context
*/
static void
-do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+do_shutdown (void *cls)
{
struct TestingContext *test_ctx = cls;
struct GNUNET_TESTING_Peer *peer;
diff --git a/src/testing/testing.c b/src/testing/testing.c
index 07129fd6f..32cd09b84 100644
--- a/src/testing/testing.c
+++ b/src/testing/testing.c
@@ -1654,11 +1654,9 @@ struct ServiceContext
* Callback to be called when SCHEDULER has been started
*
* @param cls the ServiceContext
- * @param tc the TaskContext
*/
static void
-service_run_main (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+service_run_main (void *cls)
{
struct ServiceContext *sc = cls;