aboutsummaryrefslogtreecommitdiff
path: root/src/ats-tests
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-07-29 19:34:54 +0000
committerChristian Grothoff <christian@grothoff.org>2016-07-29 19:34:54 +0000
commit461f88a18bb39f3966a1aa4579224fd241b8bc5d (patch)
tree36cbea873db574f99c81f990499977282a5c0c64 /src/ats-tests
parenta88e3f058a8a78645e8d568157d4084a0eab92ae (diff)
downloadgnunet-461f88a18bb39f3966a1aa4579224fd241b8bc5d.tar.gz
gnunet-461f88a18bb39f3966a1aa4579224fd241b8bc5d.zip
-dead code elimination
Diffstat (limited to 'src/ats-tests')
-rw-r--r--src/ats-tests/ats-testing.c9
-rw-r--r--src/ats-tests/ats-testing.h4
-rw-r--r--src/ats-tests/gnunet-ats-sim.c42
-rw-r--r--src/ats-tests/perf_ats.c11
4 files changed, 25 insertions, 41 deletions
diff --git a/src/ats-tests/ats-testing.c b/src/ats-tests/ats-testing.c
index c894f4445..16956489d 100644
--- a/src/ats-tests/ats-testing.c
+++ b/src/ats-tests/ats-testing.c
@@ -841,7 +841,6 @@ GNUNET_ATS_TEST_get_partner (int src, int dest)
841 * @param test_core connect to CORE service (GNUNET_YES) or transport (GNUNET_NO) 841 * @param test_core connect to CORE service (GNUNET_YES) or transport (GNUNET_NO)
842 * @param done_cb function to call when topology is setup 842 * @param done_cb function to call when topology is setup
843 * @param done_cb_cls cls for callback 843 * @param done_cb_cls cls for callback
844 * @param transport_recv_cb callback to call when data are received
845 * @param log_request_cb callback to call when logging is required 844 * @param log_request_cb callback to call when logging is required
846 */ 845 */
847void 846void
@@ -851,7 +850,6 @@ GNUNET_ATS_TEST_create_topology (char *name, char *cfg_file,
851 int test_core, 850 int test_core,
852 GNUNET_ATS_TEST_TopologySetupDoneCallback done_cb, 851 GNUNET_ATS_TEST_TopologySetupDoneCallback done_cb,
853 void *done_cb_cls, 852 void *done_cb_cls,
854 GNUNET_TRANSPORT_ReceiveCallback transport_recv_cb,
855 GNUNET_ATS_AddressInformationCallback log_request_cb) 853 GNUNET_ATS_AddressInformationCallback log_request_cb)
856{ 854{
857 static struct GNUNET_CORE_MessageHandler handlers[] = { 855 static struct GNUNET_CORE_MessageHandler handlers[] = {
@@ -866,11 +864,12 @@ GNUNET_ATS_TEST_create_topology (char *name, char *cfg_file,
866 top->done_cb = done_cb; 864 top->done_cb = done_cb;
867 top->done_cb_cls = done_cb_cls; 865 top->done_cb_cls = done_cb_cls;
868 top->test_core = test_core; 866 top->test_core = test_core;
869 top->transport_recv_cb = transport_recv_cb;
870 top->ats_perf_cb = log_request_cb; 867 top->ats_perf_cb = log_request_cb;
871 868
872 top->mps = GNUNET_malloc (num_masters * sizeof (struct BenchmarkPeer)); 869 top->mps = GNUNET_new_array (num_masters,
873 top->sps = GNUNET_malloc (num_slaves * sizeof (struct BenchmarkPeer)); 870 struct BenchmarkPeer);
871 top->sps = GNUNET_new_array (num_slaves,
872 struct BenchmarkPeer);
874 873
875 /* Start topology */ 874 /* Start topology */
876 uint64_t event_mask; 875 uint64_t event_mask;
diff --git a/src/ats-tests/ats-testing.h b/src/ats-tests/ats-testing.h
index b2a4d13e6..b98988138 100644
--- a/src/ats-tests/ats-testing.h
+++ b/src/ats-tests/ats-testing.h
@@ -447,8 +447,6 @@ struct GNUNET_ATS_TEST_Topology
447 447
448 struct GNUNET_CORE_MessageHandler *handlers; 448 struct GNUNET_CORE_MessageHandler *handlers;
449 449
450 GNUNET_TRANSPORT_ReceiveCallback transport_recv_cb;
451
452 GNUNET_ATS_TEST_TopologySetupDoneCallback done_cb; 450 GNUNET_ATS_TEST_TopologySetupDoneCallback done_cb;
453 GNUNET_ATS_AddressInformationCallback ats_perf_cb; 451 GNUNET_ATS_AddressInformationCallback ats_perf_cb;
454 void *done_cb_cls; 452 void *done_cb_cls;
@@ -721,7 +719,6 @@ GNUNET_ATS_TEST_get_partner (int src, int dest);
721 * @param test_core connect to CORE service (#GNUNET_YES) or transport (#GNUNET_NO) 719 * @param test_core connect to CORE service (#GNUNET_YES) or transport (#GNUNET_NO)
722 * @param done_cb function to call when topology is setup 720 * @param done_cb function to call when topology is setup
723 * @param done_cb_cls cls for callback 721 * @param done_cb_cls cls for callback
724 * @param transport_recv_cb callback to call when data are received
725 * @param log_request_cb callback to call when logging is required 722 * @param log_request_cb callback to call when logging is required
726 */ 723 */
727void 724void
@@ -732,7 +729,6 @@ GNUNET_ATS_TEST_create_topology (char *name,
732 int test_core, 729 int test_core,
733 GNUNET_ATS_TEST_TopologySetupDoneCallback done_cb, 730 GNUNET_ATS_TEST_TopologySetupDoneCallback done_cb,
734 void *done_cb_cls, 731 void *done_cb_cls,
735 GNUNET_TRANSPORT_ReceiveCallback recv_cb,
736 GNUNET_ATS_TEST_LogRequest ats_perf_cb); 732 GNUNET_ATS_TEST_LogRequest ats_perf_cb);
737 733
738 734
diff --git a/src/ats-tests/gnunet-ats-sim.c b/src/ats-tests/gnunet-ats-sim.c
index f624c2b21..56f8f2223 100644
--- a/src/ats-tests/gnunet-ats-sim.c
+++ b/src/ats-tests/gnunet-ats-sim.c
@@ -168,32 +168,25 @@ do_timeout (void *cls)
168 168
169 169
170static void 170static void
171transport_recv_cb (void *cls, 171log_request__cb (void *cls,
172 const struct GNUNET_PeerIdentity *peer, 172 const struct GNUNET_HELLO_Address *address,
173 const struct GNUNET_MessageHeader *message) 173 int address_active,
174 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out,
175 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in,
176 const struct GNUNET_ATS_Properties *ats)
174{ 177{
175
176}
177
178static void
179log_request__cb (void *cls, const struct GNUNET_HELLO_Address *address,
180 int address_active, struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out,
181 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in,
182 const struct GNUNET_ATS_Properties *ats)
183{
184
185 if (NULL != l) 178 if (NULL != l)
186 { 179 {
187 //GNUNET_break (0); 180 //GNUNET_break (0);
188 //GNUNET_ATS_TEST_logging_now (l); 181 //GNUNET_ATS_TEST_logging_now (l);
189 } 182 }
190
191} 183}
192 184
193 185
194static void 186static void
195experiment_done_cb (struct Experiment *e, 187experiment_done_cb (struct Experiment *e,
196 struct GNUNET_TIME_Relative duration,int success) 188 struct GNUNET_TIME_Relative duration,
189 int success)
197{ 190{
198 if (GNUNET_OK == success) 191 if (GNUNET_OK == success)
199 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 192 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
@@ -222,15 +215,19 @@ experiment_done_cb (struct Experiment *e,
222static void 215static void
223episode_done_cb (struct Episode *ep) 216episode_done_cb (struct Episode *ep)
224{ 217{
225 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Episode %u done\n", ep->id); 218 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
219 "Episode %u done\n",
220 ep->id);
226} 221}
227 222
228 223
229static void topology_setup_done (void *cls, 224static void
230 struct BenchmarkPeer *masters, 225topology_setup_done (void *cls,
231 struct BenchmarkPeer *slaves) 226 struct BenchmarkPeer *masters,
227 struct BenchmarkPeer *slaves)
232{ 228{
233 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Topology setup complete!\n"); 229 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
230 "Topology setup complete!\n");
234 231
235 masters_p = masters; 232 masters_p = masters;
236 slaves_p = slaves; 233 slaves_p = slaves;
@@ -240,7 +237,9 @@ static void topology_setup_done (void *cls,
240 masters_p, 237 masters_p,
241 e->num_masters, e->num_slaves, 238 e->num_masters, e->num_slaves,
242 opt_verbose); 239 opt_verbose);
243 GNUNET_ATS_TEST_experimentation_run (e, &episode_done_cb, &experiment_done_cb); 240 GNUNET_ATS_TEST_experimentation_run (e,
241 &episode_done_cb,
242 &experiment_done_cb);
244/* 243/*
245 GNUNET_ATS_TEST_generate_preferences_start(&masters[0],&masters[0].partners[0], 244 GNUNET_ATS_TEST_generate_preferences_start(&masters[0],&masters[0].partners[0],
246 GNUNET_ATS_TEST_TG_CONSTANT, 1, 1, GNUNET_TIME_UNIT_SECONDS, 245 GNUNET_ATS_TEST_TG_CONSTANT, 1, 1, GNUNET_TIME_UNIT_SECONDS,
@@ -385,7 +384,6 @@ main (int argc, char *argv[])
385 GNUNET_NO, 384 GNUNET_NO,
386 &topology_setup_done, 385 &topology_setup_done,
387 NULL, 386 NULL,
388 &transport_recv_cb,
389 &log_request__cb); 387 &log_request__cb);
390 GNUNET_free (opt_exp_file); 388 GNUNET_free (opt_exp_file);
391 return 0; 389 return 0;
diff --git a/src/ats-tests/perf_ats.c b/src/ats-tests/perf_ats.c
index a7c1dc3bf..da664bc94 100644
--- a/src/ats-tests/perf_ats.c
+++ b/src/ats-tests/perf_ats.c
@@ -339,15 +339,6 @@ find_partner (struct BenchmarkPeer *me,
339 339
340 340
341static void 341static void
342test_recv_cb (void *cls,
343 const struct GNUNET_PeerIdentity * peer,
344 const struct GNUNET_MessageHeader * message)
345{
346
347}
348
349
350static void
351log_request_cb (void *cls, 342log_request_cb (void *cls,
352 const struct GNUNET_HELLO_Address *address, 343 const struct GNUNET_HELLO_Address *address,
353 int address_active, 344 int address_active,
@@ -586,7 +577,7 @@ main (int argc, char *argv[])
586 test_core, 577 test_core,
587 &do_benchmark, 578 &do_benchmark,
588 NULL, 579 NULL,
589 &test_recv_cb, 580 NULL,
590 &log_request_cb); 581 &log_request_cb);
591 582
592 return result; 583 return result;