aboutsummaryrefslogtreecommitdiff
path: root/src/fs/test_fs_test_lib.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-08-15 21:54:06 +0000
committerChristian Grothoff <christian@grothoff.org>2011-08-15 21:54:06 +0000
commit5746309cb4be2073d550ad7a6885e918631dbc38 (patch)
tree89455bc4aadf977816b38df13f990372cd81d71a /src/fs/test_fs_test_lib.c
parent6fd3e715cae09fa6e657c96f1c6f9711ee51f42f (diff)
downloadgnunet-5746309cb4be2073d550ad7a6885e918631dbc38.tar.gz
gnunet-5746309cb4be2073d550ad7a6885e918631dbc38.zip
indentation
Diffstat (limited to 'src/fs/test_fs_test_lib.c')
-rw-r--r--src/fs/test_fs_test_lib.c37
1 files changed, 16 insertions, 21 deletions
diff --git a/src/fs/test_fs_test_lib.c b/src/fs/test_fs_test_lib.c
index 9aa7b2ee3..458d4606b 100644
--- a/src/fs/test_fs_test_lib.c
+++ b/src/fs/test_fs_test_lib.c
@@ -56,8 +56,7 @@ do_stop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
56 } 56 }
57 else 57 else
58 { 58 {
59 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 59 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Finished download, shutting down\n",
60 "Finished download, shutting down\n",
61 (unsigned long long) FILESIZE); 60 (unsigned long long) FILESIZE);
62 } 61 }
63 GNUNET_FS_TEST_daemons_stop (NUM_DAEMONS, daemons); 62 GNUNET_FS_TEST_daemons_stop (NUM_DAEMONS, daemons);
@@ -74,10 +73,10 @@ do_download (void *cls, const struct GNUNET_FS_Uri *uri)
74 ret = 1; 73 ret = 1;
75 return; 74 return;
76 } 75 }
77 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 76 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Downloading %llu bytes\n",
78 "Downloading %llu bytes\n", (unsigned long long) FILESIZE); 77 (unsigned long long) FILESIZE);
79 GNUNET_FS_TEST_download (daemons[0], 78 GNUNET_FS_TEST_download (daemons[0], TIMEOUT, 1, SEED, uri, VERBOSE, &do_stop,
80 TIMEOUT, 1, SEED, uri, VERBOSE, &do_stop, NULL); 79 NULL);
81} 80}
82 81
83 82
@@ -91,11 +90,9 @@ do_publish (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
91 GNUNET_SCHEDULER_add_now (&do_stop, NULL); 90 GNUNET_SCHEDULER_add_now (&do_stop, NULL);
92 return; 91 return;
93 } 92 }
94 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 93 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Publishing %llu bytes\n",
95 "Publishing %llu bytes\n", (unsigned long long) FILESIZE); 94 (unsigned long long) FILESIZE);
96 GNUNET_FS_TEST_publish (daemons[0], 95 GNUNET_FS_TEST_publish (daemons[0], TIMEOUT, 1, GNUNET_NO, FILESIZE, SEED,
97 TIMEOUT,
98 1, GNUNET_NO, FILESIZE, SEED,
99 VERBOSE, &do_download, NULL); 96 VERBOSE, &do_download, NULL);
100} 97}
101 98
@@ -112,19 +109,17 @@ do_connect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
112 } 109 }
113 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 110 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
114 "Daemons started, will now try to connect them\n"); 111 "Daemons started, will now try to connect them\n");
115 GNUNET_FS_TEST_daemons_connect (daemons[0], 112 GNUNET_FS_TEST_daemons_connect (daemons[0], daemons[1], TIMEOUT, &do_publish,
116 daemons[1], TIMEOUT, &do_publish, NULL); 113 NULL);
117} 114}
118 115
119 116
120static void 117static void
121run (void *cls, 118run (void *cls, char *const *args, const char *cfgfile,
122 char *const *args, 119 const struct GNUNET_CONFIGURATION_Handle *cfg)
123 const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg)
124{ 120{
125 GNUNET_FS_TEST_daemons_start ("fs_test_lib_data.conf", 121 GNUNET_FS_TEST_daemons_start ("fs_test_lib_data.conf", TIMEOUT, NUM_DAEMONS,
126 TIMEOUT, 122 daemons, &do_connect, NULL);
127 NUM_DAEMONS, daemons, &do_connect, NULL);
128} 123}
129 124
130 125
@@ -152,8 +147,8 @@ main (int argc, char *argv[])
152 "WARNING", 147 "WARNING",
153#endif 148#endif
154 NULL); 149 NULL);
155 GNUNET_PROGRAM_run ((sizeof (argvx) / sizeof (char *)) - 1, 150 GNUNET_PROGRAM_run ((sizeof (argvx) / sizeof (char *)) - 1, argvx,
156 argvx, "test-fs-test-lib", "nohelp", options, &run, NULL); 151 "test-fs-test-lib", "nohelp", options, &run, NULL);
157 GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-lib/"); 152 GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-lib/");
158 return ret; 153 return ret;
159} 154}