aboutsummaryrefslogtreecommitdiff
path: root/src/dv/test_transport_api_dv.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-03-18 10:56:52 +0000
committerChristian Grothoff <christian@grothoff.org>2013-03-18 10:56:52 +0000
commitb7847284934b21a228b332daf15804e2605e3355 (patch)
treeb07f86904ba4852787e607b1a37c1cf40e68ea89 /src/dv/test_transport_api_dv.c
parentff0c0c5eb34e719b56d969ae15ee9e311c446553 (diff)
downloadgnunet-b7847284934b21a228b332daf15804e2605e3355.tar.gz
gnunet-b7847284934b21a228b332daf15804e2605e3355.zip
-fix
Diffstat (limited to 'src/dv/test_transport_api_dv.c')
-rw-r--r--src/dv/test_transport_api_dv.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/src/dv/test_transport_api_dv.c b/src/dv/test_transport_api_dv.c
index ef3ba4e7c..e36622f2f 100644
--- a/src/dv/test_transport_api_dv.c
+++ b/src/dv/test_transport_api_dv.c
@@ -484,6 +484,7 @@ static struct GNUNET_CORE_MessageHandler handlers[] = {
484 {NULL, 0, 0} 484 {NULL, 0, 0}
485}; 485};
486 486
487
487/** 488/**
488 * Notify of all peer1's peers, once peer 2 is found, schedule connect 489 * Notify of all peer1's peers, once peer 2 is found, schedule connect
489 * to peer two for message send. 490 * to peer two for message send.
@@ -525,6 +526,7 @@ connect_notify_peer2 (void *cls, const struct GNUNET_PeerIdentity *peer,
525 } 526 }
526} 527}
527 528
529
528static void 530static void
529init_notify_peer2 (void *cls, struct GNUNET_CORE_Handle *server, 531init_notify_peer2 (void *cls, struct GNUNET_CORE_Handle *server,
530 const struct GNUNET_PeerIdentity *my_identity) 532 const struct GNUNET_PeerIdentity *my_identity)
@@ -535,6 +537,7 @@ init_notify_peer2 (void *cls, struct GNUNET_CORE_Handle *server,
535 total_server_connections++; 537 total_server_connections++;
536} 538}
537 539
540
538/** 541/**
539 * Notify of all peer1's peers, once peer 2 is found, schedule connect 542 * Notify of all peer1's peers, once peer 2 is found, schedule connect
540 * to peer two for message send. 543 * to peer two for message send.
@@ -566,6 +569,7 @@ connect_notify_peer1 (void *cls, const struct GNUNET_PeerIdentity *peer,
566 } 569 }
567} 570}
568 571
572
569static void 573static void
570init_notify_peer1 (void *cls, struct GNUNET_CORE_Handle *server, 574init_notify_peer1 (void *cls, struct GNUNET_CORE_Handle *server,
571 const struct GNUNET_PeerIdentity *my_identity) 575 const struct GNUNET_PeerIdentity *my_identity)
@@ -624,6 +628,7 @@ send_test_messages (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
624 } 628 }
625} 629}
626 630
631
627static void 632static void
628send_other_messages (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 633send_other_messages (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
629{ 634{
@@ -706,6 +711,7 @@ send_other_messages (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
706 "from send_other_messages"); 711 "from send_other_messages");
707} 712}
708 713
714
709static void 715static void
710topology_callback (void *cls, const struct GNUNET_PeerIdentity *first, 716topology_callback (void *cls, const struct GNUNET_PeerIdentity *first,
711 const struct GNUNET_PeerIdentity *second, uint32_t distance, 717 const struct GNUNET_PeerIdentity *second, uint32_t distance,
@@ -860,6 +866,7 @@ all_connect_handler (void *cls, const struct GNUNET_PeerIdentity *peer,
860 } 866 }
861} 867}
862 868
869
863static void 870static void
864peers_started_callback (void *cls, const struct GNUNET_PeerIdentity *id, 871peers_started_callback (void *cls, const struct GNUNET_PeerIdentity *id,
865 const struct GNUNET_CONFIGURATION_Handle *cfg, 872 const struct GNUNET_CONFIGURATION_Handle *cfg,
@@ -926,6 +933,7 @@ peers_started_callback (void *cls, const struct GNUNET_PeerIdentity *id,
926 } 933 }
927} 934}
928 935
936
929/** 937/**
930 * Callback indicating that the hostkey was created for a peer. 938 * Callback indicating that the hostkey was created for a peer.
931 * 939 *
@@ -981,6 +989,7 @@ hostkey_callback (void *cls, const struct GNUNET_PeerIdentity *id,
981 } 989 }
982} 990}
983 991
992
984static void 993static void
985run (void *cls, char *const *args, const char *cfgfile, 994run (void *cls, char *const *args, const char *cfgfile,
986 const struct GNUNET_CONFIGURATION_Handle *cfg) 995 const struct GNUNET_CONFIGURATION_Handle *cfg)
@@ -1116,8 +1125,9 @@ run (void *cls, char *const *args, const char *cfgfile,
1116 1125
1117} 1126}
1118 1127
1119static int 1128
1120check () 1129int
1130main (int argc, char *argv[])
1121{ 1131{
1122 int ret; 1132 int ret;
1123 1133
@@ -1129,6 +1139,9 @@ check ()
1129 struct GNUNET_GETOPT_CommandLineOption options[] = { 1139 struct GNUNET_GETOPT_CommandLineOption options[] = {
1130 GNUNET_GETOPT_OPTION_END 1140 GNUNET_GETOPT_OPTION_END
1131 }; 1141 };
1142 GNUNET_log_setup ("test-transport-dv",
1143 "WARNING",
1144 NULL);
1132 ret = 1145 ret =
1133 GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv, 1146 GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv,
1134 "test-transport-dv", "nohelp", options, &run, &ok); 1147 "test-transport-dv", "nohelp", options, &run, &ok);
@@ -1137,18 +1150,6 @@ check ()
1137 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 1150 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
1138 "`test-transport-dv': Failed with error code %d\n", ret); 1151 "`test-transport-dv': Failed with error code %d\n", ret);
1139 } 1152 }
1140 return ok;
1141}
1142
1143int
1144main (int argc, char *argv[])
1145{
1146 int ret;
1147
1148 GNUNET_log_setup ("test-transport-dv",
1149 "WARNING",
1150 NULL);
1151 ret = check ();
1152 /** 1153 /**
1153 * Need to remove base directory, subdirectories taken care 1154 * Need to remove base directory, subdirectories taken care
1154 * of by the testing framework. 1155 * of by the testing framework.
@@ -1158,7 +1159,7 @@ main (int argc, char *argv[])
1158 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 1159 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
1159 "Failed to remove testing directory %s\n", test_directory); 1160 "Failed to remove testing directory %s\n", test_directory);
1160 } 1161 }
1161 return ret; 1162 return (GNUNET_OK == ret) ? 0 : 1;
1162} 1163}
1163 1164
1164/* end of test_transport_api_dv.c */ 1165/* end of test_transport_api_dv.c */