aboutsummaryrefslogtreecommitdiff
path: root/src/testing/testing.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testing/testing.c')
-rw-r--r--src/testing/testing.c37
1 files changed, 2 insertions, 35 deletions
diff --git a/src/testing/testing.c b/src/testing/testing.c
index e360d7083..fdfa80d87 100644
--- a/src/testing/testing.c
+++ b/src/testing/testing.c
@@ -272,7 +272,7 @@ struct GNUNET_TESTING_Peer
272 * @param system the testing system handle 272 * @param system the testing system handle
273 * @return #GNUNET_OK on success; #GNUNET_SYSERR on error 273 * @return #GNUNET_OK on success; #GNUNET_SYSERR on error
274 */ 274 */
275static int 275static enum GNUNET_GenericReturnValue
276hostkeys_load (struct GNUNET_TESTING_System *system) 276hostkeys_load (struct GNUNET_TESTING_System *system)
277{ 277{
278 uint64_t fs; 278 uint64_t fs;
@@ -505,7 +505,7 @@ cleanup_shared_service_instance (struct SharedServiceInstance *i)
505} 505}
506 506
507 507
508static int 508static enum GNUNET_GenericReturnValue
509start_shared_service_instance (struct SharedServiceInstance *i) 509start_shared_service_instance (struct SharedServiceInstance *i)
510{ 510{
511 char *binary; 511 char *binary;
@@ -1722,39 +1722,6 @@ GNUNET_TESTING_service_run (const char *testdir,
1722 1722
1723 1723
1724/** 1724/**
1725 * Sometimes we use the binary name to determine which specific
1726 * test to run. In those cases, the string after the last "_"
1727 * in 'argv[0]' specifies a string that determines the configuration
1728 * file or plugin to use.
1729 *
1730 * This function returns the respective substring, taking care
1731 * of issues such as binaries ending in '.exe' on W32.
1732 *
1733 * @param argv0 the name of the binary
1734 * @return string between the last '_' and the '.exe' (or the end of the string),
1735 * NULL if argv0 has no '_'
1736 */
1737char *
1738GNUNET_TESTING_get_testname_from_underscore (const char *argv0)
1739{
1740 size_t slen = strlen (argv0) + 1;
1741 char sbuf[slen];
1742 char *ret;
1743 char *dot;
1744
1745 GNUNET_memcpy (sbuf, argv0, slen);
1746 ret = strrchr (sbuf, '_');
1747 if (NULL == ret)
1748 return NULL;
1749 ret++; /* skip underscore */
1750 dot = strchr (ret, '.');
1751 if (NULL != dot)
1752 *dot = '\0';
1753 return GNUNET_strdup (ret);
1754}
1755
1756
1757/**
1758 * Every line in the topology configuration starts with a string indicating which 1725 * Every line in the topology configuration starts with a string indicating which
1759 * kind of information will be configured with this line. Configuration values following 1726 * kind of information will be configured with this line. Configuration values following
1760 * this string are seperated by special sequences of characters. An integer value seperated 1727 * this string are seperated by special sequences of characters. An integer value seperated