aboutsummaryrefslogtreecommitdiff
path: root/src/util/test_scheduler.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-08-15 21:46:35 +0000
committerChristian Grothoff <christian@grothoff.org>2011-08-15 21:46:35 +0000
commit502af2167f7c218366666ca4944bd7cc54b5b19a (patch)
treea91fec5cc9769d260640bd91c6633cb9cf395524 /src/util/test_scheduler.c
parent03af5a603b7cc53432249d5854cd412aa90dde0d (diff)
downloadgnunet-502af2167f7c218366666ca4944bd7cc54b5b19a.tar.gz
gnunet-502af2167f7c218366666ca4944bd7cc54b5b19a.zip
indentation
Diffstat (limited to 'src/util/test_scheduler.c')
-rw-r--r--src/util/test_scheduler.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/util/test_scheduler.c b/src/util/test_scheduler.c
index f0c908d7d..d5a701692 100644
--- a/src/util/test_scheduler.c
+++ b/src/util/test_scheduler.c
@@ -33,8 +33,10 @@ static void
33task3 (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 33task3 (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
34{ 34{
35 int *ok = cls; 35 int *ok = cls;
36
36 /* t4 should be ready (albeit with lower priority) */ 37 /* t4 should be ready (albeit with lower priority) */
37 GNUNET_assert (1 == GNUNET_SCHEDULER_get_load (GNUNET_SCHEDULER_PRIORITY_COUNT)); 38 GNUNET_assert (1 ==
39 GNUNET_SCHEDULER_get_load (GNUNET_SCHEDULER_PRIORITY_COUNT));
38 GNUNET_assert (3 == *ok); 40 GNUNET_assert (3 == *ok);
39 (*ok) = 4; 41 (*ok) = 4;
40} 42}
@@ -44,6 +46,7 @@ static void
44task2 (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 46task2 (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
45{ 47{
46 int *ok = cls; 48 int *ok = cls;
49
47 GNUNET_assert (2 == *ok); 50 GNUNET_assert (2 == *ok);
48 (*ok) = 3; 51 (*ok) = 3;
49 /* t3 will go before t4: higher priority */ 52 /* t3 will go before t4: higher priority */
@@ -55,6 +58,7 @@ static void
55task4 (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 58task4 (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
56{ 59{
57 int *ok = cls; 60 int *ok = cls;
61
58 GNUNET_assert (4 == *ok); 62 GNUNET_assert (4 == *ok);
59 (*ok) = 5; 63 (*ok) = 5;
60} 64}
@@ -68,6 +72,7 @@ taskWrt (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
68{ 72{
69 static char c; 73 static char c;
70 int *ok = cls; 74 int *ok = cls;
75
71 GNUNET_assert (6 == *ok); 76 GNUNET_assert (6 == *ok);
72 GNUNET_assert (GNUNET_NETWORK_fdset_handle_isset (tc->write_ready, fds[1])); 77 GNUNET_assert (GNUNET_NETWORK_fdset_handle_isset (tc->write_ready, fds[1]));
73 (*ok) = 7; 78 (*ok) = 7;
@@ -85,6 +90,7 @@ static void
85taskLast (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 90taskLast (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
86{ 91{
87 int *ok = cls; 92 int *ok = cls;
93
88 /* t4 should be ready (albeit with lower priority) */ 94 /* t4 should be ready (albeit with lower priority) */
89 GNUNET_assert (8 == *ok); 95 GNUNET_assert (8 == *ok);
90 (*ok) = 0; 96 (*ok) = 0;
@@ -95,6 +101,7 @@ taskRd (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
95{ 101{
96 static char c; 102 static char c;
97 int *ok = cls; 103 int *ok = cls;
104
98 GNUNET_assert (7 == *ok); 105 GNUNET_assert (7 == *ok);
99 GNUNET_assert (GNUNET_NETWORK_fdset_handle_isset (tc->read_ready, fds[0])); 106 GNUNET_assert (GNUNET_NETWORK_fdset_handle_isset (tc->read_ready, fds[0]));
100 GNUNET_assert (1 == GNUNET_DISK_file_read (fds[0], &c, 1)); 107 GNUNET_assert (1 == GNUNET_DISK_file_read (fds[0], &c, 1));
@@ -109,6 +116,7 @@ static void
109task5 (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 116task5 (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
110{ 117{
111 int *ok = cls; 118 int *ok = cls;
119
112 GNUNET_assert (5 == *ok); 120 GNUNET_assert (5 == *ok);
113 (*ok) = 6; 121 (*ok) = 6;
114 p = GNUNET_DISK_pipe (GNUNET_NO, GNUNET_NO, GNUNET_NO); 122 p = GNUNET_DISK_pipe (GNUNET_NO, GNUNET_NO, GNUNET_NO);
@@ -160,6 +168,7 @@ static void
160taskShutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 168taskShutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
161{ 169{
162 int *ok = cls; 170 int *ok = cls;
171
163 GNUNET_assert (1 == *ok); 172 GNUNET_assert (1 == *ok);
164 *ok = 8; 173 *ok = 8;
165 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &taskLast, cls); 174 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &taskLast, cls);
@@ -186,6 +195,7 @@ static void
186taskSig (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 195taskSig (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
187{ 196{
188 int *ok = cls; 197 int *ok = cls;
198
189 GNUNET_assert (1 == *ok); 199 GNUNET_assert (1 == *ok);
190 *ok = 8; 200 *ok = 8;
191 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &taskLast, cls); 201 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &taskLast, cls);