diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-08-15 21:54:06 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-08-15 21:54:06 +0000 |
commit | 5746309cb4be2073d550ad7a6885e918631dbc38 (patch) | |
tree | 89455bc4aadf977816b38df13f990372cd81d71a /src/transport/test_plugin_transport.c | |
parent | 6fd3e715cae09fa6e657c96f1c6f9711ee51f42f (diff) | |
download | gnunet-5746309cb4be2073d550ad7a6885e918631dbc38.tar.gz gnunet-5746309cb4be2073d550ad7a6885e918631dbc38.zip |
indentation
Diffstat (limited to 'src/transport/test_plugin_transport.c')
-rw-r--r-- | src/transport/test_plugin_transport.c | 42 |
1 files changed, 16 insertions, 26 deletions
diff --git a/src/transport/test_plugin_transport.c b/src/transport/test_plugin_transport.c index e66e04ead..6bb187b19 100644 --- a/src/transport/test_plugin_transport.c +++ b/src/transport/test_plugin_transport.c | |||
@@ -87,20 +87,16 @@ static int ok; | |||
87 | /** | 87 | /** |
88 | */ | 88 | */ |
89 | static void | 89 | static void |
90 | receive (void *cls, | 90 | receive (void *cls, const struct GNUNET_PeerIdentity *peer, |
91 | const struct GNUNET_PeerIdentity | 91 | const struct GNUNET_MessageHeader *message, uint32_t distance, |
92 | *peer, const struct GNUNET_MessageHeader *message, | ||
93 | uint32_t distance, | ||
94 | const char *sender_address, size_t sender_address_len) | 92 | const char *sender_address, size_t sender_address_len) |
95 | { | 93 | { |
96 | /* do nothing */ | 94 | /* do nothing */ |
97 | } | 95 | } |
98 | 96 | ||
99 | void | 97 | void |
100 | notify_address (void *cls, | 98 | notify_address (void *cls, const char *name, const void *addr, size_t addrlen, |
101 | const char *name, | 99 | struct GNUNET_TIME_Relative expires) |
102 | const void *addr, | ||
103 | size_t addrlen, struct GNUNET_TIME_Relative expires) | ||
104 | { | 100 | { |
105 | } | 101 | } |
106 | 102 | ||
@@ -161,8 +157,7 @@ test_validation () | |||
161 | GNUNET_assert (GNUNET_OK == | 157 | GNUNET_assert (GNUNET_OK == |
162 | api->check_address (api->cls, &soaddr, sizeof (soaddr))); | 158 | api->check_address (api->cls, &soaddr, sizeof (soaddr))); |
163 | ok = 0; | 159 | ok = 0; |
164 | GNUNET_SCHEDULER_add_continuation (&unload_task, | 160 | GNUNET_SCHEDULER_add_continuation (&unload_task, (void *) cfg, |
165 | (void *) cfg, | ||
166 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | 161 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); |
167 | } | 162 | } |
168 | 163 | ||
@@ -186,9 +181,8 @@ setup_plugin_environment () | |||
186 | * @param c configuration to use | 181 | * @param c configuration to use |
187 | */ | 182 | */ |
188 | static void | 183 | static void |
189 | run (void *cls, | 184 | run (void *cls, char *const *args, const char *cfgfile, |
190 | char *const *args, | 185 | const struct GNUNET_CONFIGURATION_Handle *c) |
191 | const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *c) | ||
192 | { | 186 | { |
193 | unsigned long long tneigh; | 187 | unsigned long long tneigh; |
194 | char *keyfile; | 188 | char *keyfile; |
@@ -197,14 +191,11 @@ run (void *cls, | |||
197 | cfg = c; | 191 | cfg = c; |
198 | /* parse configuration */ | 192 | /* parse configuration */ |
199 | if ((GNUNET_OK != | 193 | if ((GNUNET_OK != |
200 | GNUNET_CONFIGURATION_get_value_number (c, | 194 | GNUNET_CONFIGURATION_get_value_number (c, "TRANSPORT", "NEIGHBOUR_LIMIT", |
201 | "TRANSPORT", | ||
202 | "NEIGHBOUR_LIMIT", | ||
203 | &tneigh)) || | 195 | &tneigh)) || |
204 | (GNUNET_OK != | 196 | (GNUNET_OK != |
205 | GNUNET_CONFIGURATION_get_value_filename (c, | 197 | GNUNET_CONFIGURATION_get_value_filename (c, "GNUNETD", "HOSTKEY", |
206 | "GNUNETD", | 198 | &keyfile))) |
207 | "HOSTKEY", &keyfile))) | ||
208 | { | 199 | { |
209 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 200 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
210 | _ | 201 | _ |
@@ -223,8 +214,8 @@ run (void *cls, | |||
223 | return; | 214 | return; |
224 | } | 215 | } |
225 | GNUNET_CRYPTO_rsa_key_get_public (my_private_key, &my_public_key); | 216 | GNUNET_CRYPTO_rsa_key_get_public (my_private_key, &my_public_key); |
226 | GNUNET_CRYPTO_hash (&my_public_key, | 217 | GNUNET_CRYPTO_hash (&my_public_key, sizeof (my_public_key), |
227 | sizeof (my_public_key), &my_identity.hashPubKey); | 218 | &my_identity.hashPubKey); |
228 | 219 | ||
229 | 220 | ||
230 | 221 | ||
@@ -281,11 +272,10 @@ main (int argc, char *const *argv) | |||
281 | #endif | 272 | #endif |
282 | NULL); | 273 | NULL); |
283 | ok = 1; /* set to fail */ | 274 | ok = 1; /* set to fail */ |
284 | ret = (GNUNET_OK == | 275 | ret = |
285 | GNUNET_PROGRAM_run (5, | 276 | (GNUNET_OK == |
286 | argv_prog, | 277 | GNUNET_PROGRAM_run (5, argv_prog, "test-plugin-transport", "testcase", |
287 | "test-plugin-transport", | 278 | options, &run, NULL)) ? ok : 1; |
288 | "testcase", options, &run, NULL)) ? ok : 1; | ||
289 | GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-plugin-transport"); | 279 | GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-plugin-transport"); |
290 | return ret; | 280 | return ret; |
291 | } | 281 | } |