diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-06-13 14:30:08 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-06-13 14:30:08 +0000 |
commit | cc7b1f71d30ee032eb38aa4607cb9ea0a1f59f95 (patch) | |
tree | 63e6ee6c544704152faaaa808189d5b371bc4178 /src/testing | |
parent | 37ad983d488bb8c62cd26823850ba01ee2e499d7 (diff) | |
download | gnunet-cc7b1f71d30ee032eb38aa4607cb9ea0a1f59f95.tar.gz gnunet-cc7b1f71d30ee032eb38aa4607cb9ea0a1f59f95.zip |
indentation
Diffstat (limited to 'src/testing')
-rw-r--r-- | src/testing/testing_group.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/testing/testing_group.c b/src/testing/testing_group.c index 32af2efa9..38fbe542b 100644 --- a/src/testing/testing_group.c +++ b/src/testing/testing_group.c | |||
@@ -2202,7 +2202,7 @@ choose_random_connections(struct GNUNET_TESTING_PeerGroup *pg, double percentage | |||
2202 | * @param pg the peergroup we are dealing with | 2202 | * @param pg the peergroup we are dealing with |
2203 | * @param num how many connections at least should each peer have (if possible)? | 2203 | * @param num how many connections at least should each peer have (if possible)? |
2204 | */ | 2204 | */ |
2205 | void | 2205 | static void |
2206 | choose_minimum(struct GNUNET_TESTING_PeerGroup *pg, unsigned int num) | 2206 | choose_minimum(struct GNUNET_TESTING_PeerGroup *pg, unsigned int num) |
2207 | { | 2207 | { |
2208 | struct MinimumContext minimum_ctx; | 2208 | struct MinimumContext minimum_ctx; |
@@ -2216,13 +2216,16 @@ choose_minimum(struct GNUNET_TESTING_PeerGroup *pg, unsigned int num) | |||
2216 | for (pg_iter = 0; pg_iter < pg->total; pg_iter++) | 2216 | for (pg_iter = 0; pg_iter < pg->total; pg_iter++) |
2217 | { | 2217 | { |
2218 | minimum_ctx.first_uid = pg_iter; | 2218 | minimum_ctx.first_uid = pg_iter; |
2219 | minimum_ctx.pg_array = GNUNET_CRYPTO_random_permute(GNUNET_CRYPTO_QUALITY_WEAK, GNUNET_CONTAINER_multihashmap_size(pg->peers[pg_iter].connect_peers)); | 2219 | minimum_ctx.pg_array = GNUNET_CRYPTO_random_permute(GNUNET_CRYPTO_QUALITY_WEAK, |
2220 | GNUNET_CONTAINER_multihashmap_size(pg->peers[pg_iter].connect_peers)); | ||
2220 | minimum_ctx.first = &pg->peers[pg_iter]; | 2221 | minimum_ctx.first = &pg->peers[pg_iter]; |
2221 | minimum_ctx.pg = pg; | 2222 | minimum_ctx.pg = pg; |
2222 | minimum_ctx.num_to_add = num; | 2223 | minimum_ctx.num_to_add = num; |
2223 | minimum_ctx.current = 0; | 2224 | minimum_ctx.current = 0; |
2224 | pg->peers[pg_iter].connect_peers_working_set = GNUNET_CONTAINER_multihashmap_create(pg->total); | 2225 | pg->peers[pg_iter].connect_peers_working_set = GNUNET_CONTAINER_multihashmap_create(pg->total); |
2225 | GNUNET_CONTAINER_multihashmap_iterate(pg->peers[pg_iter].connect_peers, &minimum_connect_iterator, &minimum_ctx); | 2226 | GNUNET_CONTAINER_multihashmap_iterate(pg->peers[pg_iter].connect_peers, |
2227 | &minimum_connect_iterator, | ||
2228 | &minimum_ctx); | ||
2226 | } | 2229 | } |
2227 | 2230 | ||
2228 | for (pg_iter = 0; pg_iter < pg->total; pg_iter++) | 2231 | for (pg_iter = 0; pg_iter < pg->total; pg_iter++) |
@@ -2231,13 +2234,16 @@ choose_minimum(struct GNUNET_TESTING_PeerGroup *pg, unsigned int num) | |||
2231 | GNUNET_CONTAINER_multihashmap_destroy(pg->peers[pg_iter].connect_peers); | 2234 | GNUNET_CONTAINER_multihashmap_destroy(pg->peers[pg_iter].connect_peers); |
2232 | /* And replace with the working set */ | 2235 | /* And replace with the working set */ |
2233 | pg->peers[pg_iter].connect_peers = pg->peers[pg_iter].connect_peers_working_set; | 2236 | pg->peers[pg_iter].connect_peers = pg->peers[pg_iter].connect_peers_working_set; |
2234 | fprintf(stderr, "Finished! Hashmap size %u\n", GNUNET_CONTAINER_multihashmap_size(pg->peers[pg_iter].connect_peers)); | 2237 | fprintf(stderr, |
2238 | "Finished! Hashmap size %u\n", | ||
2239 | GNUNET_CONTAINER_multihashmap_size(pg->peers[pg_iter].connect_peers)); | ||
2235 | } | 2240 | } |
2236 | 2241 | ||
2237 | } | 2242 | } |
2238 | 2243 | ||
2239 | 2244 | ||
2240 | static unsigned int count_workingset_connections(struct GNUNET_TESTING_PeerGroup *pg) | 2245 | static unsigned int |
2246 | count_workingset_connections(struct GNUNET_TESTING_PeerGroup *pg) | ||
2241 | { | 2247 | { |
2242 | unsigned int count; | 2248 | unsigned int count; |
2243 | unsigned int pg_iter; | 2249 | unsigned int pg_iter; |