diff options
Diffstat (limited to 'src/ats/test_ats_api_scheduling_block_and_reset.c')
-rw-r--r-- | src/ats/test_ats_api_scheduling_block_and_reset.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/ats/test_ats_api_scheduling_block_and_reset.c b/src/ats/test_ats_api_scheduling_block_and_reset.c index d5bd58031..c4dd8b4bb 100644 --- a/src/ats/test_ats_api_scheduling_block_and_reset.c +++ b/src/ats/test_ats_api_scheduling_block_and_reset.c | |||
@@ -150,7 +150,7 @@ address_suggest_cb (void *cls, const struct GNUNET_HELLO_Address *address, | |||
150 | if (3 == stage) | 150 | if (3 == stage) |
151 | { | 151 | { |
152 | /* Suggestion after resetting block interval */ | 152 | /* Suggestion after resetting block interval */ |
153 | reset_block_duration = GNUNET_TIME_absolute_get_difference (reset_block_start, | 153 | reset_block_duration = GNUNET_TIME_absolute_get_difference (reset_block_start, |
154 | GNUNET_TIME_absolute_get()); | 154 | GNUNET_TIME_absolute_get()); |
155 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 155 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
156 | "Address suggestion after resetting blocking took about %s!\n", | 156 | "Address suggestion after resetting blocking took about %s!\n", |
@@ -180,7 +180,7 @@ address_suggest_cb (void *cls, const struct GNUNET_HELLO_Address *address, | |||
180 | if (((initial_duration.rel_value_us * 3) <= block_duration.rel_value_us) && | 180 | if (((initial_duration.rel_value_us * 3) <= block_duration.rel_value_us) && |
181 | ((reset_block_duration.rel_value_us * 3) <= block_duration.rel_value_us)) | 181 | ((reset_block_duration.rel_value_us * 3) <= block_duration.rel_value_us)) |
182 | { | 182 | { |
183 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 183 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
184 | "Address suggestion after resetting blocking and initial suggestion (%llu us) much faster than with blocking (%llu us)\n", | 184 | "Address suggestion after resetting blocking and initial suggestion (%llu us) much faster than with blocking (%llu us)\n", |
185 | (unsigned long long) initial_duration.rel_value_us, | 185 | (unsigned long long) initial_duration.rel_value_us, |
186 | (unsigned long long) block_duration.rel_value_us); | 186 | (unsigned long long) block_duration.rel_value_us); |
@@ -188,7 +188,7 @@ address_suggest_cb (void *cls, const struct GNUNET_HELLO_Address *address, | |||
188 | } | 188 | } |
189 | else | 189 | else |
190 | { | 190 | { |
191 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 191 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
192 | "Address suggestion after resetting blocking and initial suggestion (%llu us) not faster than with blocking (%llu us)\n", | 192 | "Address suggestion after resetting blocking and initial suggestion (%llu us) not faster than with blocking (%llu us)\n", |
193 | (unsigned long long) initial_duration.rel_value_us, | 193 | (unsigned long long) initial_duration.rel_value_us, |
194 | (unsigned long long) block_duration.rel_value_us); | 194 | (unsigned long long) block_duration.rel_value_us); |
@@ -211,7 +211,7 @@ address_suggest_cb (void *cls, const struct GNUNET_HELLO_Address *address, | |||
211 | 211 | ||
212 | if (GNUNET_OK == compare_addresses (address, session, &test_hello_address, test_session)) | 212 | if (GNUNET_OK == compare_addresses (address, session, &test_hello_address, test_session)) |
213 | { | 213 | { |
214 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 214 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
215 | "Stage %u: Callback with correct address `%s'\n", stage, | 215 | "Stage %u: Callback with correct address `%s'\n", stage, |
216 | GNUNET_i2s (&address->peer)); | 216 | GNUNET_i2s (&address->peer)); |
217 | ret = 0; | 217 | ret = 0; |
@@ -228,7 +228,7 @@ address_suggest_cb (void *cls, const struct GNUNET_HELLO_Address *address, | |||
228 | 228 | ||
229 | if (GNUNET_OK != compare_ats(atsi, ats_count, test_ats_info, test_ats_count)) | 229 | if (GNUNET_OK != compare_ats(atsi, ats_count, test_ats_info, test_ats_count)) |
230 | { | 230 | { |
231 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 231 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
232 | "Stage %u: Callback with incorrect ats info \n"); | 232 | "Stage %u: Callback with incorrect ats info \n"); |
233 | GNUNET_ATS_suggest_address_cancel (sched_ats, &p.id); | 233 | GNUNET_ATS_suggest_address_cancel (sched_ats, &p.id); |
234 | GNUNET_SCHEDULER_add_now (&end, NULL); | 234 | GNUNET_SCHEDULER_add_now (&end, NULL); |
@@ -246,16 +246,16 @@ address_suggest_cb (void *cls, const struct GNUNET_HELLO_Address *address, | |||
246 | /* Initial suggestion */ | 246 | /* Initial suggestion */ |
247 | if (GNUNET_OK == compare_addresses (address, session, &test_hello_address, test_session)) | 247 | if (GNUNET_OK == compare_addresses (address, session, &test_hello_address, test_session)) |
248 | { | 248 | { |
249 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 249 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
250 | "Stage %u: Callback with correct address `%s'\n", | 250 | "Stage %u: Callback with correct address `%s'\n", |
251 | stage, | 251 | stage, |
252 | GNUNET_i2s (&address->peer)); | 252 | GNUNET_i2s (&address->peer)); |
253 | ret = 0; | 253 | ret = 0; |
254 | } | 254 | } |
255 | else | 255 | else |
256 | { | 256 | { |
257 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 257 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
258 | "Stage %u: Callback with invalid address `%s'\n", | 258 | "Stage %u: Callback with invalid address `%s'\n", |
259 | stage, | 259 | stage, |
260 | GNUNET_i2s (&address->peer)); | 260 | GNUNET_i2s (&address->peer)); |
261 | GNUNET_ATS_suggest_address_cancel (sched_ats, &p.id); | 261 | GNUNET_ATS_suggest_address_cancel (sched_ats, &p.id); |
@@ -265,7 +265,7 @@ address_suggest_cb (void *cls, const struct GNUNET_HELLO_Address *address, | |||
265 | 265 | ||
266 | if (GNUNET_OK != compare_ats(atsi, ats_count, test_ats_info, test_ats_count)) | 266 | if (GNUNET_OK != compare_ats(atsi, ats_count, test_ats_info, test_ats_count)) |
267 | { | 267 | { |
268 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 268 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
269 | "Stage %u: Callback with incorrect ats info\n", | 269 | "Stage %u: Callback with incorrect ats info\n", |
270 | stage); | 270 | stage); |
271 | GNUNET_ATS_suggest_address_cancel (sched_ats, &p.id); | 271 | GNUNET_ATS_suggest_address_cancel (sched_ats, &p.id); |
@@ -274,8 +274,8 @@ address_suggest_cb (void *cls, const struct GNUNET_HELLO_Address *address, | |||
274 | } | 274 | } |
275 | stage++; | 275 | stage++; |
276 | initial_duration = GNUNET_TIME_absolute_get_difference(initial_start, GNUNET_TIME_absolute_get()); | 276 | initial_duration = GNUNET_TIME_absolute_get_difference(initial_start, GNUNET_TIME_absolute_get()); |
277 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 277 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
278 | "Stage %u: Initial suggestion took about %s\n", | 278 | "Stage %u: Initial suggestion took about %s\n", |
279 | stage, | 279 | stage, |
280 | GNUNET_STRINGS_relative_time_to_string (block_duration, | 280 | GNUNET_STRINGS_relative_time_to_string (block_duration, |
281 | GNUNET_YES)); | 281 | GNUNET_YES)); |
@@ -288,8 +288,8 @@ address_suggest_cb (void *cls, const struct GNUNET_HELLO_Address *address, | |||
288 | /* Startup suggestion */ | 288 | /* Startup suggestion */ |
289 | if (GNUNET_OK == compare_addresses (address, session, &test_hello_address, test_session)) | 289 | if (GNUNET_OK == compare_addresses (address, session, &test_hello_address, test_session)) |
290 | { | 290 | { |
291 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 291 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
292 | "Stage %u: Callback with correct address `%s'\n", | 292 | "Stage %u: Callback with correct address `%s'\n", |
293 | stage, | 293 | stage, |
294 | GNUNET_i2s (&address->peer)); | 294 | GNUNET_i2s (&address->peer)); |
295 | ret = 0; | 295 | ret = 0; |
@@ -297,7 +297,7 @@ address_suggest_cb (void *cls, const struct GNUNET_HELLO_Address *address, | |||
297 | else | 297 | else |
298 | { | 298 | { |
299 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 299 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
300 | "Stage %u: Callback with invalid address `%s'\n", | 300 | "Stage %u: Callback with invalid address `%s'\n", |
301 | stage, | 301 | stage, |
302 | GNUNET_i2s (&address->peer)); | 302 | GNUNET_i2s (&address->peer)); |
303 | GNUNET_ATS_suggest_address_cancel (sched_ats, &p.id); | 303 | GNUNET_ATS_suggest_address_cancel (sched_ats, &p.id); |
@@ -307,7 +307,7 @@ address_suggest_cb (void *cls, const struct GNUNET_HELLO_Address *address, | |||
307 | 307 | ||
308 | if (GNUNET_OK != compare_ats (atsi, ats_count, test_ats_info, test_ats_count)) | 308 | if (GNUNET_OK != compare_ats (atsi, ats_count, test_ats_info, test_ats_count)) |
309 | { | 309 | { |
310 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 310 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
311 | "Stage %u: Callback with incorrect ats info\n", | 311 | "Stage %u: Callback with incorrect ats info\n", |
312 | stage); | 312 | stage); |
313 | GNUNET_ATS_suggest_address_cancel (sched_ats, &p.id); | 313 | GNUNET_ATS_suggest_address_cancel (sched_ats, &p.id); |
@@ -325,7 +325,7 @@ address_suggest_cb (void *cls, const struct GNUNET_HELLO_Address *address, | |||
325 | 325 | ||
326 | 326 | ||
327 | static void | 327 | static void |
328 | run (void *cls, | 328 | run (void *cls, |
329 | const struct GNUNET_CONFIGURATION_Handle *cfg, | 329 | const struct GNUNET_CONFIGURATION_Handle *cfg, |
330 | struct GNUNET_TESTING_Peer *peer) | 330 | struct GNUNET_TESTING_Peer *peer) |
331 | { | 331 | { |
@@ -336,7 +336,7 @@ run (void *cls, | |||
336 | sched_ats = GNUNET_ATS_scheduling_init (cfg, &address_suggest_cb, NULL); | 336 | sched_ats = GNUNET_ATS_scheduling_init (cfg, &address_suggest_cb, NULL); |
337 | if (sched_ats == NULL) | 337 | if (sched_ats == NULL) |
338 | { | 338 | { |
339 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 339 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
340 | "Could not connect to ATS scheduling!\n"); | 340 | "Could not connect to ATS scheduling!\n"); |
341 | ret = 1; | 341 | ret = 1; |
342 | end (); | 342 | end (); |