aboutsummaryrefslogtreecommitdiff
path: root/src/testing
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-12-30 22:43:52 +0000
committerChristian Grothoff <christian@grothoff.org>2011-12-30 22:43:52 +0000
commitf5a017ed63ee50feeefc6f0c2b28549aeca92ded (patch)
treeefb619e68756960821ff3ad667a1452db9add7f7 /src/testing
parent416c2f5a713b93ba689a8cd1e038682a53e6bc17 (diff)
downloadgnunet-f5a017ed63ee50feeefc6f0c2b28549aeca92ded.tar.gz
gnunet-f5a017ed63ee50feeefc6f0c2b28549aeca92ded.zip
-LRN: use FOPEN/CLOSE instead of fopen/close - #2051
Diffstat (limited to 'src/testing')
-rw-r--r--src/testing/test_testing_large_topology.c10
-rw-r--r--src/testing/test_testing_topology.c8
-rw-r--r--src/testing/test_testing_topology_blacklist.c12
-rw-r--r--src/testing/testing_group.c8
4 files changed, 19 insertions, 19 deletions
diff --git a/src/testing/test_testing_large_topology.c b/src/testing/test_testing_large_topology.c
index 2bca7b3b9..605761105 100644
--- a/src/testing/test_testing_large_topology.c
+++ b/src/testing/test_testing_large_topology.c
@@ -246,7 +246,7 @@ finish_testing ()
246 if (dotOutFile != NULL) 246 if (dotOutFile != NULL)
247 { 247 {
248 FPRINTF (dotOutFile, "%s", "}"); 248 FPRINTF (dotOutFile, "%s", "}");
249 fclose (dotOutFile); 249 FCLOSE (dotOutFile);
250 } 250 }
251 251
252 ok = 0; 252 ok = 0;
@@ -303,7 +303,7 @@ topology_cb (void *cls, const struct GNUNET_PeerIdentity *first,
303 if (outfile != NULL) 303 if (outfile != NULL)
304 { 304 {
305 FPRINTF (outfile, "%s", "}\n"); 305 FPRINTF (outfile, "%s", "}\n");
306 fclose (outfile); 306 FCLOSE (outfile);
307 GNUNET_SCHEDULER_add_now (&finish_testing, NULL); 307 GNUNET_SCHEDULER_add_now (&finish_testing, NULL);
308 } 308 }
309 } 309 }
@@ -358,7 +358,7 @@ process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer,
358#endif 358#endif
359 GNUNET_SCHEDULER_cancel (die_task); 359 GNUNET_SCHEDULER_cancel (die_task);
360 GNUNET_asprintf (&dotOutFileNameFinished, "%s.dot", "final_topology"); 360 GNUNET_asprintf (&dotOutFileNameFinished, "%s.dot", "final_topology");
361 dotOutFileFinished = fopen (dotOutFileNameFinished, "w"); 361 dotOutFileFinished = FOPEN (dotOutFileNameFinished, "w");
362 GNUNET_free (dotOutFileNameFinished); 362 GNUNET_free (dotOutFileNameFinished);
363 if (dotOutFileFinished != NULL) 363 if (dotOutFileFinished != NULL)
364 { 364 {
@@ -425,7 +425,7 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
425 if (dotOutFile != NULL) 425 if (dotOutFile != NULL)
426 { 426 {
427 FPRINTF (dotOutFile, "%s", "}"); 427 FPRINTF (dotOutFile, "%s", "}");
428 fclose (dotOutFile); 428 FCLOSE (dotOutFile);
429 } 429 }
430} 430}
431 431
@@ -949,7 +949,7 @@ run (void *cls, char *const *args, const char *cfgfile,
949 949
950 ok = 1; 950 ok = 1;
951 951
952 dotOutFile = fopen (dotOutFileName, "w"); 952 dotOutFile = FOPEN (dotOutFileName, "w");
953 if (dotOutFile != NULL) 953 if (dotOutFile != NULL)
954 { 954 {
955 FPRINTF (dotOutFile, "%s", "strict graph G {\n"); 955 FPRINTF (dotOutFile, "%s", "strict graph G {\n");
diff --git a/src/testing/test_testing_topology.c b/src/testing/test_testing_topology.c
index 17f3be89a..7404aa73e 100644
--- a/src/testing/test_testing_topology.c
+++ b/src/testing/test_testing_topology.c
@@ -339,7 +339,7 @@ topology_cb (void *cls, const struct GNUNET_PeerIdentity *first,
339 if (outfile != NULL) 339 if (outfile != NULL)
340 { 340 {
341 FPRINTF (outfile, "%s", "}\n"); 341 FPRINTF (outfile, "%s", "}\n");
342 fclose (outfile); 342 FCLOSE (outfile);
343#if DO_STATS 343#if DO_STATS
344 GNUNET_TESTING_get_statistics (pg, &stats_finished, &stats_print, NULL); 344 GNUNET_TESTING_get_statistics (pg, &stats_finished, &stats_print, NULL);
345#endif 345#endif
@@ -398,7 +398,7 @@ process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer,
398#endif 398#endif
399 GNUNET_SCHEDULER_cancel (die_task); 399 GNUNET_SCHEDULER_cancel (die_task);
400 GNUNET_asprintf (&dotOutFileNameFinished, "%s.dot", "final_topology"); 400 GNUNET_asprintf (&dotOutFileNameFinished, "%s.dot", "final_topology");
401 dotOutFileFinished = fopen (dotOutFileNameFinished, "w"); 401 dotOutFileFinished = FOPEN (dotOutFileNameFinished, "w");
402 GNUNET_free (dotOutFileNameFinished); 402 GNUNET_free (dotOutFileNameFinished);
403 if (dotOutFileFinished != NULL) 403 if (dotOutFileFinished != NULL)
404 { 404 {
@@ -465,7 +465,7 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
465 if (dotOutFile != NULL) 465 if (dotOutFile != NULL)
466 { 466 {
467 FPRINTF (dotOutFile, "%s", "}"); 467 FPRINTF (dotOutFile, "%s", "}");
468 fclose (dotOutFile); 468 FCLOSE (dotOutFile);
469 } 469 }
470} 470}
471 471
@@ -1006,7 +1006,7 @@ run (void *cls, char *const *args, const char *cfgfile,
1006 1006
1007 ok = 1; 1007 ok = 1;
1008 1008
1009 dotOutFile = fopen (dotOutFileName, "w"); 1009 dotOutFile = FOPEN (dotOutFileName, "w");
1010 if (dotOutFile != NULL) 1010 if (dotOutFile != NULL)
1011 { 1011 {
1012 FPRINTF (dotOutFile, "%s", "strict graph G {\n"); 1012 FPRINTF (dotOutFile, "%s", "strict graph G {\n");
diff --git a/src/testing/test_testing_topology_blacklist.c b/src/testing/test_testing_topology_blacklist.c
index 9ff1fcbaa..d207ac2fc 100644
--- a/src/testing/test_testing_topology_blacklist.c
+++ b/src/testing/test_testing_topology_blacklist.c
@@ -143,7 +143,7 @@ finish_testing ()
143 if (dotOutFile != NULL) 143 if (dotOutFile != NULL)
144 { 144 {
145 FPRINTF (dotOutFile, "%s", "}"); 145 FPRINTF (dotOutFile, "%s", "}");
146 fclose (dotOutFile); 146 FCLOSE (dotOutFile);
147 } 147 }
148 148
149 ok = 0; 149 ok = 0;
@@ -168,7 +168,7 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
168 if (dotOutFile != NULL) 168 if (dotOutFile != NULL)
169 { 169 {
170 FPRINTF (dotOutFile, "%s", "}"); 170 FPRINTF (dotOutFile, "%s", "}");
171 fclose (dotOutFile); 171 FCLOSE (dotOutFile);
172 } 172 }
173} 173}
174 174
@@ -396,7 +396,7 @@ run (void *cls, char *const *args, const char *cfgfile,
396 396
397 ok = 1; 397 ok = 1;
398 398
399 dotOutFile = fopen (dotOutFileName, "w"); 399 dotOutFile = FOPEN (dotOutFileName, "w");
400 if (dotOutFile != NULL) 400 if (dotOutFile != NULL)
401 { 401 {
402 FPRINTF (dotOutFile, "%s", "strict graph G {\n"); 402 FPRINTF (dotOutFile, "%s", "strict graph G {\n");
@@ -414,7 +414,7 @@ run (void *cls, char *const *args, const char *cfgfile,
414 ok = 404; 414 ok = 404;
415 if (dotOutFile != NULL) 415 if (dotOutFile != NULL)
416 { 416 {
417 fclose (dotOutFile); 417 FCLOSE (dotOutFile);
418 } 418 }
419 return; 419 return;
420 } 420 }
@@ -453,7 +453,7 @@ run (void *cls, char *const *args, const char *cfgfile,
453 ok = 707; 453 ok = 707;
454 if (dotOutFile != NULL) 454 if (dotOutFile != NULL)
455 { 455 {
456 fclose (dotOutFile); 456 FCLOSE (dotOutFile);
457 } 457 }
458 return; 458 return;
459 } 459 }
@@ -470,7 +470,7 @@ run (void *cls, char *const *args, const char *cfgfile,
470 ok = 808; 470 ok = 808;
471 if (dotOutFile != NULL) 471 if (dotOutFile != NULL)
472 { 472 {
473 fclose (dotOutFile); 473 FCLOSE (dotOutFile);
474 } 474 }
475 return; 475 return;
476 } 476 }
diff --git a/src/testing/testing_group.c b/src/testing/testing_group.c
index 4f67179c1..32adf465e 100644
--- a/src/testing/testing_group.c
+++ b/src/testing/testing_group.c
@@ -2891,7 +2891,7 @@ create_and_copy_friend_files (struct GNUNET_TESTING_PeerGroup *pg)
2891 { 2891 {
2892 mytemp = GNUNET_DISK_mktemp ("friends"); 2892 mytemp = GNUNET_DISK_mktemp ("friends");
2893 GNUNET_assert (mytemp != NULL); 2893 GNUNET_assert (mytemp != NULL);
2894 temp_friend_handle = fopen (mytemp, "wt"); 2894 temp_friend_handle = FOPEN (mytemp, "wt");
2895 GNUNET_assert (temp_friend_handle != NULL); 2895 GNUNET_assert (temp_friend_handle != NULL);
2896#if OLD 2896#if OLD
2897 conn_iter = pg->peers[pg_iter].allowed_peers_head; 2897 conn_iter = pg->peers[pg_iter].allowed_peers_head;
@@ -2907,7 +2907,7 @@ create_and_copy_friend_files (struct GNUNET_TESTING_PeerGroup *pg)
2907 &friend_file_iterator, 2907 &friend_file_iterator,
2908 temp_friend_handle); 2908 temp_friend_handle);
2909#endif 2909#endif
2910 fclose (temp_friend_handle); 2910 FCLOSE (temp_friend_handle);
2911 2911
2912 if (GNUNET_OK != 2912 if (GNUNET_OK !=
2913 GNUNET_CONFIGURATION_get_value_string (pg->peers[pg_iter].daemon->cfg, 2913 GNUNET_CONFIGURATION_get_value_string (pg->peers[pg_iter].daemon->cfg,
@@ -3064,7 +3064,7 @@ create_and_copy_blacklist_files (struct GNUNET_TESTING_PeerGroup *pg,
3064 { 3064 {
3065 mytemp = GNUNET_DISK_mktemp ("blacklist"); 3065 mytemp = GNUNET_DISK_mktemp ("blacklist");
3066 GNUNET_assert (mytemp != NULL); 3066 GNUNET_assert (mytemp != NULL);
3067 temp_file_handle = fopen (mytemp, "wt"); 3067 temp_file_handle = FOPEN (mytemp, "wt");
3068 GNUNET_assert (temp_file_handle != NULL); 3068 GNUNET_assert (temp_file_handle != NULL);
3069 temp_transports = GNUNET_strdup (transports); 3069 temp_transports = GNUNET_strdup (transports);
3070#if !OLD 3070#if !OLD
@@ -3106,7 +3106,7 @@ create_and_copy_blacklist_files (struct GNUNET_TESTING_PeerGroup *pg,
3106 } 3106 }
3107 3107
3108 GNUNET_free (temp_transports); 3108 GNUNET_free (temp_transports);
3109 fclose (temp_file_handle); 3109 FCLOSE (temp_file_handle);
3110 3110
3111 if (GNUNET_OK != 3111 if (GNUNET_OK !=
3112 GNUNET_CONFIGURATION_get_value_string (pg->peers[pg_iter].daemon->cfg, 3112 GNUNET_CONFIGURATION_get_value_string (pg->peers[pg_iter].daemon->cfg,