aboutsummaryrefslogtreecommitdiff
path: root/src/testing
diff options
context:
space:
mode:
Diffstat (limited to 'src/testing')
-rw-r--r--src/testing/Makefile.am3
-rw-r--r--src/testing/gnunet-testing.c2
-rw-r--r--src/testing/test_testing_peerstartup.c2
-rw-r--r--src/testing/test_testing_peerstartup2.c2
-rw-r--r--src/testing/test_testing_sharedservices.c2
-rw-r--r--src/testing/testing.c36
6 files changed, 21 insertions, 26 deletions
diff --git a/src/testing/Makefile.am b/src/testing/Makefile.am
index 9c6357455..2b599f55b 100644
--- a/src/testing/Makefile.am
+++ b/src/testing/Makefile.am
@@ -20,6 +20,9 @@ libgnunettesting_la_LIBADD = \
20 $(top_builddir)/src/arm/libgnunetarm.la \ 20 $(top_builddir)/src/arm/libgnunetarm.la \
21 $(top_builddir)/src/util/libgnunetutil.la \ 21 $(top_builddir)/src/util/libgnunetutil.la \
22 $(LTLIBINTL) 22 $(LTLIBINTL)
23libgnunettesting_la_DEPENDENCIES = \
24 $(top_builddir)/src/arm/libgnunetarm.la \
25 $(top_builddir)/src/util/libgnunetutil.la
23libgnunettesting_la_LDFLAGS = \ 26libgnunettesting_la_LDFLAGS = \
24 $(GN_LIB_LDFLAGS) \ 27 $(GN_LIB_LDFLAGS) \
25 -version-info 2:0:1 28 -version-info 2:0:1
diff --git a/src/testing/gnunet-testing.c b/src/testing/gnunet-testing.c
index a9e5042b2..88906e5fa 100644
--- a/src/testing/gnunet-testing.c
+++ b/src/testing/gnunet-testing.c
@@ -365,7 +365,7 @@ run_no_scheduler (void *cls,
365 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Extracting hostkey %u\n", create_no); 365 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Extracting hostkey %u\n", create_no);
366 ret = create_hostkeys (create_no); 366 ret = create_hostkeys (create_no);
367 } 367 }
368 GNUNET_free_non_null (create_cfg_template); 368 GNUNET_free (create_cfg_template);
369} 369}
370 370
371 371
diff --git a/src/testing/test_testing_peerstartup.c b/src/testing/test_testing_peerstartup.c
index 4e21fedc9..25cbb2a9f 100644
--- a/src/testing/test_testing_peerstartup.c
+++ b/src/testing/test_testing_peerstartup.c
@@ -118,7 +118,7 @@ run (void *cls, char *const *args, const char *cfgfile,
118 118
119end: 119end:
120 GNUNET_SCHEDULER_add_now (&do_shutdown, test_ctx); 120 GNUNET_SCHEDULER_add_now (&do_shutdown, test_ctx);
121 GNUNET_free_non_null (emsg); 121 GNUNET_free (emsg);
122} 122}
123 123
124 124
diff --git a/src/testing/test_testing_peerstartup2.c b/src/testing/test_testing_peerstartup2.c
index 26948b7c5..8d357cb08 100644
--- a/src/testing/test_testing_peerstartup2.c
+++ b/src/testing/test_testing_peerstartup2.c
@@ -197,7 +197,7 @@ run (void *cls, char *const *args, const char *cfgfile,
197end: 197end:
198 FAIL_TEST (0); 198 FAIL_TEST (0);
199 GNUNET_SCHEDULER_add_now (&do_shutdown, test_ctx); 199 GNUNET_SCHEDULER_add_now (&do_shutdown, test_ctx);
200 GNUNET_free_non_null (emsg); 200 GNUNET_free (emsg);
201} 201}
202 202
203 203
diff --git a/src/testing/test_testing_sharedservices.c b/src/testing/test_testing_sharedservices.c
index 77def3453..d2f760d7a 100644
--- a/src/testing/test_testing_sharedservices.c
+++ b/src/testing/test_testing_sharedservices.c
@@ -139,7 +139,7 @@ run (void *cls, char *const *args, const char *cfgfile,
139 139
140end: 140end:
141 GNUNET_SCHEDULER_add_now (&do_shutdown, test_ctx); 141 GNUNET_SCHEDULER_add_now (&do_shutdown, test_ctx);
142 GNUNET_free_non_null (emsg); 142 GNUNET_free (emsg);
143} 143}
144 144
145 145
diff --git a/src/testing/testing.c b/src/testing/testing.c
index 23bc40d7e..9724fb55b 100644
--- a/src/testing/testing.c
+++ b/src/testing/testing.c
@@ -38,12 +38,6 @@
38 38
39 39
40/** 40/**
41 * We need pipe control only on WINDOWS
42 */
43#define PIPE_CONTROL GNUNET_NO
44
45
46/**
47 * Lowest port used for GNUnet testing. Should be high enough to not 41 * Lowest port used for GNUnet testing. Should be high enough to not
48 * conflict with other applications running on the hosts but be low 42 * conflict with other applications running on the hosts but be low
49 * enough to not conflict with client-ports (typically starting around 43 * enough to not conflict with client-ports (typically starting around
@@ -473,8 +467,8 @@ cleanup_shared_service_instance (struct SharedServiceInstance *i)
473 (void) unlink (i->cfg_fn); 467 (void) unlink (i->cfg_fn);
474 GNUNET_free (i->cfg_fn); 468 GNUNET_free (i->cfg_fn);
475 } 469 }
476 GNUNET_free_non_null (i->unix_sock); 470 GNUNET_free (i->unix_sock);
477 GNUNET_free_non_null (i->port_str); 471 GNUNET_free (i->port_str);
478 GNUNET_break (NULL == i->proc); 472 GNUNET_break (NULL == i->proc);
479 GNUNET_break (0 == i->n_refs); 473 GNUNET_break (0 == i->n_refs);
480 GNUNET_free (i); 474 GNUNET_free (i);
@@ -492,8 +486,7 @@ start_shared_service_instance (struct SharedServiceInstance *i)
492 (void) GNUNET_asprintf (&binary, "gnunet-service-%s", i->ss->sname); 486 (void) GNUNET_asprintf (&binary, "gnunet-service-%s", i->ss->sname);
493 libexec_binary = GNUNET_OS_get_libexec_binary_path (binary); 487 libexec_binary = GNUNET_OS_get_libexec_binary_path (binary);
494 GNUNET_free (binary); 488 GNUNET_free (binary);
495 i->proc = GNUNET_OS_start_process (PIPE_CONTROL, 489 i->proc = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
496 GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
497 NULL, 490 NULL,
498 NULL, 491 NULL,
499 NULL, 492 NULL,
@@ -551,17 +544,17 @@ GNUNET_TESTING_system_destroy (struct GNUNET_TESTING_System *system,
551 stop_shared_service_instance (i); 544 stop_shared_service_instance (i);
552 cleanup_shared_service_instance (i); 545 cleanup_shared_service_instance (i);
553 } 546 }
554 GNUNET_free_non_null (ss->instances); 547 GNUNET_free (ss->instances);
555 GNUNET_CONFIGURATION_destroy (ss->cfg); 548 GNUNET_CONFIGURATION_destroy (ss->cfg);
556 GNUNET_free (ss->sname); 549 GNUNET_free (ss->sname);
557 GNUNET_free (ss); 550 GNUNET_free (ss);
558 } 551 }
559 GNUNET_free_non_null (system->shared_services); 552 GNUNET_free (system->shared_services);
560 if (GNUNET_YES == remove_paths) 553 if (GNUNET_YES == remove_paths)
561 GNUNET_DISK_directory_remove (system->tmppath); 554 GNUNET_DISK_directory_remove (system->tmppath);
562 GNUNET_free (system->tmppath); 555 GNUNET_free (system->tmppath);
563 GNUNET_free_non_null (system->trusted_ip); 556 GNUNET_free (system->trusted_ip);
564 GNUNET_free_non_null (system->hostname); 557 GNUNET_free (system->hostname);
565 GNUNET_free (system); 558 GNUNET_free (system);
566} 559}
567 560
@@ -957,7 +950,7 @@ update_config_sections (void *cls, const char *section)
957 } 950 }
958 GNUNET_free (ikeys); 951 GNUNET_free (ikeys);
959 } 952 }
960 GNUNET_free_non_null (val); 953 GNUNET_free (val);
961 ACCEPT_FROM_key = "ACCEPT_FROM"; 954 ACCEPT_FROM_key = "ACCEPT_FROM";
962 if ((NULL != uc->system->trusted_ip) && 955 if ((NULL != uc->system->trusted_ip) &&
963 (NULL != strstr (uc->system->trusted_ip, ":"))) /* IPv6 in use */ 956 (NULL != strstr (uc->system->trusted_ip, ":"))) /* IPv6 in use */
@@ -1120,7 +1113,7 @@ GNUNET_TESTING_configuration_create_ (struct GNUNET_TESTING_System *system,
1120 *nports = uc.nports; 1113 *nports = uc.nports;
1121 } 1114 }
1122 else 1115 else
1123 GNUNET_free_non_null (uc.ports); 1116 GNUNET_free (uc.ports);
1124 return uc.status; 1117 return uc.status;
1125} 1118}
1126 1119
@@ -1316,8 +1309,8 @@ GNUNET_TESTING_peer_configure (struct GNUNET_TESTING_System *system,
1316 return peer; 1309 return peer;
1317 1310
1318err_ret: 1311err_ret:
1319 GNUNET_free_non_null (ss_instances); 1312 GNUNET_free (ss_instances);
1320 GNUNET_free_non_null (ports); 1313 GNUNET_free (ports);
1321 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "%s", emsg_); 1314 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "%s", emsg_);
1322 if (NULL != emsg) 1315 if (NULL != emsg)
1323 *emsg = emsg_; 1316 *emsg = emsg_;
@@ -1378,8 +1371,7 @@ GNUNET_TESTING_peer_start (struct GNUNET_TESTING_Peer *peer)
1378 peer->main_binary = 1371 peer->main_binary =
1379 GNUNET_CONFIGURATION_expand_dollar (peer->cfg, peer->main_binary); 1372 GNUNET_CONFIGURATION_expand_dollar (peer->cfg, peer->main_binary);
1380 peer->main_process = 1373 peer->main_process =
1381 GNUNET_OS_start_process_s (PIPE_CONTROL, 1374 GNUNET_OS_start_process_s (GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
1382 GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
1383 NULL, 1375 NULL,
1384 peer->main_binary, 1376 peer->main_binary,
1385 peer->args, 1377 peer->args,
@@ -1566,8 +1558,8 @@ GNUNET_TESTING_peer_destroy (struct GNUNET_TESTING_Peer *peer)
1566 GNUNET_CONFIGURATION_destroy (peer->cfg); 1558 GNUNET_CONFIGURATION_destroy (peer->cfg);
1567 GNUNET_free (peer->main_binary); 1559 GNUNET_free (peer->main_binary);
1568 GNUNET_free (peer->args); 1560 GNUNET_free (peer->args);
1569 GNUNET_free_non_null (peer->id); 1561 GNUNET_free (peer->id);
1570 GNUNET_free_non_null (peer->ss_instances); 1562 GNUNET_free (peer->ss_instances);
1571 if (NULL != peer->ports) 1563 if (NULL != peer->ports)
1572 { 1564 {
1573 for (cnt = 0; cnt < peer->nports; cnt++) 1565 for (cnt = 0; cnt < peer->nports; cnt++)