aboutsummaryrefslogtreecommitdiff
path: root/src/testing
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-11-04 14:00:32 +0000
committerChristian Grothoff <christian@grothoff.org>2011-11-04 14:00:32 +0000
commit83b19539f4d322b43683f5838b72e9ec2c8e6073 (patch)
treed0ab9329fcbefe360d9d14e2ace21a6b3396dfe9 /src/testing
parent28a2eb43281a1f08a67954f07beb9af3a9bc9a35 (diff)
downloadgnunet-83b19539f4d322b43683f5838b72e9ec2c8e6073.tar.gz
gnunet-83b19539f4d322b43683f5838b72e9ec2c8e6073.zip
curly wars / auto-indentation
Diffstat (limited to 'src/testing')
-rw-r--r--src/testing/test_testing_connect.c6
-rw-r--r--src/testing/test_testing_reconnect.c12
-rw-r--r--src/testing/test_testing_topology.c11
-rw-r--r--src/testing/testing.c7
-rw-r--r--src/testing/testing_group.c25
-rw-r--r--src/testing/testing_peergroup.c7
6 files changed, 36 insertions, 32 deletions
diff --git a/src/testing/test_testing_connect.c b/src/testing/test_testing_connect.c
index f32e2e40f..87501469d 100644
--- a/src/testing/test_testing_connect.c
+++ b/src/testing/test_testing_connect.c
@@ -148,10 +148,12 @@ run (void *cls, char *const *args, const char *cfgfile,
148#endif 148#endif
149 c1 = GNUNET_CONFIGURATION_create (); 149 c1 = GNUNET_CONFIGURATION_create ();
150 GNUNET_assert (GNUNET_OK == 150 GNUNET_assert (GNUNET_OK ==
151 GNUNET_CONFIGURATION_load (c1, "test_testing_connect_peer1.conf")); 151 GNUNET_CONFIGURATION_load (c1,
152 "test_testing_connect_peer1.conf"));
152 c2 = GNUNET_CONFIGURATION_create (); 153 c2 = GNUNET_CONFIGURATION_create ();
153 GNUNET_assert (GNUNET_OK == 154 GNUNET_assert (GNUNET_OK ==
154 GNUNET_CONFIGURATION_load (c2, "test_testing_connect_peer2.conf")); 155 GNUNET_CONFIGURATION_load (c2,
156 "test_testing_connect_peer2.conf"));
155 d1 = GNUNET_TESTING_daemon_start (c1, TIMEOUT, GNUNET_NO, NULL, NULL, 0, NULL, 157 d1 = GNUNET_TESTING_daemon_start (c1, TIMEOUT, GNUNET_NO, NULL, NULL, 0, NULL,
156 NULL, NULL, &my_cb1, NULL); 158 NULL, NULL, &my_cb1, NULL);
157 GNUNET_assert (d1 != NULL); 159 GNUNET_assert (d1 != NULL);
diff --git a/src/testing/test_testing_reconnect.c b/src/testing/test_testing_reconnect.c
index f317040fb..20c628c6a 100644
--- a/src/testing/test_testing_reconnect.c
+++ b/src/testing/test_testing_reconnect.c
@@ -101,8 +101,8 @@ end1_cb (void *cls, const char *emsg)
101 if (d2 != NULL) 101 if (d2 != NULL)
102 { 102 {
103 GNUNET_TESTING_daemon_stop (d2, TIMEOUT, &end2_cb, NULL, 103 GNUNET_TESTING_daemon_stop (d2, TIMEOUT, &end2_cb, NULL,
104 (phase == NUM_PHASES) ? GNUNET_YES : GNUNET_NO, 104 (phase == NUM_PHASES) ? GNUNET_YES : GNUNET_NO,
105 GNUNET_NO); 105 GNUNET_NO);
106 d2 = NULL; 106 d2 = NULL;
107 } 107 }
108} 108}
@@ -192,9 +192,13 @@ run (void *cls, char *const *args, const char *cfgfile,
192 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Starting daemon.\n"); 192 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Starting daemon.\n");
193#endif 193#endif
194 c1 = GNUNET_CONFIGURATION_create (); 194 c1 = GNUNET_CONFIGURATION_create ();
195 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (c1, "test_testing_connect_peer1.conf")); 195 GNUNET_assert (GNUNET_OK ==
196 GNUNET_CONFIGURATION_load (c1,
197 "test_testing_connect_peer1.conf"));
196 c2 = GNUNET_CONFIGURATION_create (); 198 c2 = GNUNET_CONFIGURATION_create ();
197 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (c2, "test_testing_connect_peer2.conf")); 199 GNUNET_assert (GNUNET_OK ==
200 GNUNET_CONFIGURATION_load (c2,
201 "test_testing_connect_peer2.conf"));
198 run_phase (); 202 run_phase ();
199} 203}
200 204
diff --git a/src/testing/test_testing_topology.c b/src/testing/test_testing_topology.c
index e563f4d64..deaeae457 100644
--- a/src/testing/test_testing_topology.c
+++ b/src/testing/test_testing_topology.c
@@ -349,7 +349,7 @@ static int
349process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer, 349process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer,
350 const struct GNUNET_MessageHeader *message, 350 const struct GNUNET_MessageHeader *message,
351 const struct GNUNET_ATS_Information *atsi, 351 const struct GNUNET_ATS_Information *atsi,
352 unsigned int atsi_count) 352 unsigned int atsi_count)
353{ 353{
354 char *dotOutFileNameFinished; 354 char *dotOutFileNameFinished;
355 FILE *dotOutFileFinished; 355 FILE *dotOutFileFinished;
@@ -543,7 +543,7 @@ init_notify_peer2 (void *cls, struct GNUNET_CORE_Handle *server,
543static void 543static void
544connect_notify_peers (void *cls, const struct GNUNET_PeerIdentity *peer, 544connect_notify_peers (void *cls, const struct GNUNET_PeerIdentity *peer,
545 const struct GNUNET_ATS_Information *atsi, 545 const struct GNUNET_ATS_Information *atsi,
546 unsigned int atsi_count) 546 unsigned int atsi_count)
547{ 547{
548 struct TestMessageContext *pos = cls; 548 struct TestMessageContext *pos = cls;
549 549
@@ -604,8 +604,7 @@ init_notify_peer1 (void *cls, struct GNUNET_CORE_Handle *server,
604 */ 604 */
605 pos->peer2handle = 605 pos->peer2handle =
606 GNUNET_CORE_connect (pos->peer2->cfg, 1, pos, &init_notify_peer2, NULL, 606 GNUNET_CORE_connect (pos->peer2->cfg, 1, pos, &init_notify_peer2, NULL,
607 NULL, NULL, GNUNET_YES, NULL, GNUNET_YES, 607 NULL, NULL, GNUNET_YES, NULL, GNUNET_YES, handlers);
608 handlers);
609 608
610} 609}
611 610
@@ -643,8 +642,8 @@ send_test_messages (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
643 */ 642 */
644 pos->peer1handle = 643 pos->peer1handle =
645 GNUNET_CORE_connect (pos->peer1->cfg, 1, pos, &init_notify_peer1, 644 GNUNET_CORE_connect (pos->peer1->cfg, 1, pos, &init_notify_peer1,
646 &connect_notify_peers, NULL, NULL, GNUNET_NO, 645 &connect_notify_peers, NULL, NULL, GNUNET_NO, NULL,
647 NULL, GNUNET_NO, no_handlers); 646 GNUNET_NO, no_handlers);
648 647
649 GNUNET_assert (pos->peer1handle != NULL); 648 GNUNET_assert (pos->peer1handle != NULL);
650 649
diff --git a/src/testing/testing.c b/src/testing/testing.c
index e81a92fb5..6edc1fc8c 100644
--- a/src/testing/testing.c
+++ b/src/testing/testing.c
@@ -1888,7 +1888,7 @@ notify_connect_result (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1888static void 1888static void
1889connect_notify (void *cls, const struct GNUNET_PeerIdentity *peer, 1889connect_notify (void *cls, const struct GNUNET_PeerIdentity *peer,
1890 const struct GNUNET_ATS_Information *atsi, 1890 const struct GNUNET_ATS_Information *atsi,
1891 unsigned int atsi_count) 1891 unsigned int atsi_count)
1892{ 1892{
1893 struct GNUNET_TESTING_ConnectContext *ctx = cls; 1893 struct GNUNET_TESTING_ConnectContext *ctx = cls;
1894 1894
@@ -1965,8 +1965,7 @@ core_init_notify (void *cls, struct GNUNET_CORE_Handle *server,
1965 1965
1966 if (connect_ctx->send_hello == GNUNET_NO) 1966 if (connect_ctx->send_hello == GNUNET_NO)
1967 { 1967 {
1968 GNUNET_TRANSPORT_try_connect (connect_ctx->d1th, 1968 GNUNET_TRANSPORT_try_connect (connect_ctx->d1th, &connect_ctx->d2->id);
1969 &connect_ctx->d2->id);
1970#if DEBUG_TESTING 1969#if DEBUG_TESTING
1971 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1970 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1972 "Sending connect request to TRANSPORT of %s for peer %s\n", 1971 "Sending connect request to TRANSPORT of %s for peer %s\n",
@@ -2088,7 +2087,7 @@ reattempt_daemons_connect (void *cls,
2088static void 2087static void
2089core_initial_iteration (void *cls, const struct GNUNET_PeerIdentity *peer, 2088core_initial_iteration (void *cls, const struct GNUNET_PeerIdentity *peer,
2090 const struct GNUNET_ATS_Information *atsi, 2089 const struct GNUNET_ATS_Information *atsi,
2091 unsigned int atsi_count) 2090 unsigned int atsi_count)
2092{ 2091{
2093 struct GNUNET_TESTING_ConnectContext *ctx = cls; 2092 struct GNUNET_TESTING_ConnectContext *ctx = cls;
2094 2093
diff --git a/src/testing/testing_group.c b/src/testing/testing_group.c
index 04c2cfd00..171cf1c48 100644
--- a/src/testing/testing_group.c
+++ b/src/testing/testing_group.c
@@ -2669,8 +2669,8 @@ create_from_file (struct GNUNET_TESTING_PeerGroup *pg, char *filename,
2669 return connect_attempts; 2669 return connect_attempts;
2670 } 2670 }
2671#if DEBUG_TESTING 2671#if DEBUG_TESTING
2672 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2672 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Found %u total peers in topology\n",
2673 "Found %u total peers in topology\n", total_peers); 2673 total_peers);
2674#endif 2674#endif
2675 GNUNET_assert (total_peers == pg->total); 2675 GNUNET_assert (total_peers == pg->total);
2676 curr_state = PEER_INDEX; 2676 curr_state = PEER_INDEX;
@@ -3348,7 +3348,9 @@ send_core_connect_requests (void *cls,
3348 while (conn != NULL) 3348 while (conn != NULL)
3349 { 3349 {
3350 GNUNET_TRANSPORT_try_connect (send_hello_context->peer->daemon->th, 3350 GNUNET_TRANSPORT_try_connect (send_hello_context->peer->daemon->th,
3351 &send_hello_context->pg->peers[conn->index].daemon->id); 3351 &send_hello_context->pg->peers[conn->
3352 index].daemon->
3353 id);
3352 conn = conn->next; 3354 conn = conn->next;
3353 } 3355 }
3354 send_hello_context->core_connect_task = 3356 send_hello_context->core_connect_task =
@@ -3486,7 +3488,7 @@ core_connect_notify (void *cls, const struct GNUNET_PeerIdentity *peer,
3486 */ 3488 */
3487void 3489void
3488core_init (void *cls, struct GNUNET_CORE_Handle *server, 3490core_init (void *cls, struct GNUNET_CORE_Handle *server,
3489 struct GNUNET_PeerIdentity *my_identity) 3491 struct GNUNET_PeerIdentity *my_identity)
3490{ 3492{
3491 struct SendHelloContext *send_hello_context = cls; 3493 struct SendHelloContext *send_hello_context = cls;
3492 3494
@@ -4878,7 +4880,7 @@ perform_dfs (struct GNUNET_TESTING_PeerGroup *pg, unsigned int num)
4878static void 4880static void
4879internal_topology_callback (void *cls, const struct GNUNET_PeerIdentity *peer, 4881internal_topology_callback (void *cls, const struct GNUNET_PeerIdentity *peer,
4880 const struct GNUNET_ATS_Information *atsi, 4882 const struct GNUNET_ATS_Information *atsi,
4881 unsigned int atsi_count) 4883 unsigned int atsi_count)
4882{ 4884{
4883 struct CoreContext *core_ctx = cls; 4885 struct CoreContext *core_ctx = cls;
4884 struct TopologyIterateContext *iter_ctx = core_ctx->iter_context; 4886 struct TopologyIterateContext *iter_ctx = core_ctx->iter_context;
@@ -5835,9 +5837,8 @@ start_peer_helper (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
5835 "peerStartHelper.pl", tempdir, NULL); 5837 "peerStartHelper.pl", tempdir, NULL);
5836 GNUNET_assert (helper->proc != NULL); 5838 GNUNET_assert (helper->proc != NULL);
5837#if DEBUG_TESTING 5839#if DEBUG_TESTING
5838 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 5840 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "starting peers with cmd ssh %s %s %s\n",
5839 "starting peers with cmd ssh %s %s %s\n", arg, 5841 arg, "peerStartHelper.pl", tempdir);
5840 "peerStartHelper.pl", tempdir);
5841#endif 5842#endif
5842 GNUNET_SCHEDULER_add_now (&check_peers_started, helper); 5843 GNUNET_SCHEDULER_add_now (&check_peers_started, helper);
5843 GNUNET_free (tempdir); 5844 GNUNET_free (tempdir);
@@ -6109,8 +6110,7 @@ GNUNET_TESTING_daemons_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
6109 fs = 0; 6110 fs = 0;
6110#if DEBUG_TESTING 6111#if DEBUG_TESTING
6111 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 6112 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
6112 "Found file size %llu for hostkeys\n", 6113 "Found file size %llu for hostkeys\n", fs);
6113 fs);
6114#endif 6114#endif
6115 if (0 != (fs % HOSTKEYFILESIZE)) 6115 if (0 != (fs % HOSTKEYFILESIZE))
6116 { 6116 {
@@ -6784,9 +6784,8 @@ GNUNET_TESTING_daemons_start_service (struct GNUNET_TESTING_PeerGroup *pg,
6784 for (i = 0; i < pg->total; i++) 6784 for (i = 0; i < pg->total; i++)
6785 { 6785 {
6786#if DEBUG_START 6786#if DEBUG_START
6787 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 6787 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Starting up service %s on peer %d!\n",
6788 "Starting up service %s on peer %d!\n", service, 6788 service, stopped_arr[stopped_permute[i]]);
6789 stopped_arr[stopped_permute[i]]);
6790#endif 6789#endif
6791 peer_start_ctx = GNUNET_malloc (sizeof (struct PeerServiceStartContext)); 6790 peer_start_ctx = GNUNET_malloc (sizeof (struct PeerServiceStartContext));
6792 peer_start_ctx->start_ctx = start_ctx; 6791 peer_start_ctx->start_ctx = start_ctx;
diff --git a/src/testing/testing_peergroup.c b/src/testing/testing_peergroup.c
index 470fdf8fa..a46e1bfb2 100644
--- a/src/testing/testing_peergroup.c
+++ b/src/testing/testing_peergroup.c
@@ -591,8 +591,8 @@ internal_hostkey_callback (void *cls, const struct GNUNET_PeerIdentity *id,
591 591
592 GNUNET_SCHEDULER_cancel (pg_start_ctx->die_task); 592 GNUNET_SCHEDULER_cancel (pg_start_ctx->die_task);
593 GNUNET_free_non_null (pg_start_ctx->fail_reason); 593 GNUNET_free_non_null (pg_start_ctx->fail_reason);
594 pg_start_ctx->fail_reason = 594 pg_start_ctx->fail_reason =
595 GNUNET_strdup ("from continue startup (timeout)"); 595 GNUNET_strdup ("from continue startup (timeout)");
596 pg_start_ctx->die_task = 596 pg_start_ctx->die_task =
597 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_absolute_get_remaining 597 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_absolute_get_remaining
598 (pg_start_ctx->timeout), &end_badly, 598 (pg_start_ctx->timeout), &end_badly,
@@ -928,7 +928,8 @@ GNUNET_TESTING_peergroup_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
928 /* Make compilers happy */ 928 /* Make compilers happy */
929 reset_meter (pg_start_ctx->peer_start_meter); 929 reset_meter (pg_start_ctx->peer_start_meter);
930 pg_start_ctx->fail_reason = 930 pg_start_ctx->fail_reason =
931 GNUNET_strdup ("didn't generate all hostkeys within allowed startup time!"); 931 GNUNET_strdup
932 ("didn't generate all hostkeys within allowed startup time!");
932 pg_start_ctx->die_task = 933 pg_start_ctx->die_task =
933 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_absolute_get_remaining 934 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_absolute_get_remaining
934 (pg_start_ctx->timeout), &end_badly, 935 (pg_start_ctx->timeout), &end_badly,