aboutsummaryrefslogtreecommitdiff
path: root/src/testing
diff options
context:
space:
mode:
authort3sserakt <t3ss@posteo.de>2021-11-13 09:36:00 +0100
committert3sserakt <t3ss@posteo.de>2021-11-13 09:36:00 +0100
commit154d13fcb10205edf5fb56c12ac47e65abfec5a6 (patch)
tree9ea19addc17db8085650e95251bd4738d61f0894 /src/testing
parenta97852fb9e6a3eccd4261319787a26db68b0a801 (diff)
downloadgnunet-154d13fcb10205edf5fb56c12ac47e65abfec5a6.tar.gz
gnunet-154d13fcb10205edf5fb56c12ac47e65abfec5a6.zip
- Added broadcast test case. changed transport_api_cmd_start_peer.c to be configure to use broadcast or not. Changed transport_api_cmd_send_simple.c to use map of connected peers. Fixed bugs in service and udp communicator.
Diffstat (limited to 'src/testing')
-rw-r--r--src/testing/testing.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/testing/testing.c b/src/testing/testing.c
index 4ccf93c6b..ced04e65d 100644
--- a/src/testing/testing.c
+++ b/src/testing/testing.c
@@ -2122,13 +2122,14 @@ GNUNET_TESTING_get_connections (unsigned int num, struct
2122 sizeof (*hkey)); 2122 sizeof (*hkey));
2123 node = GNUNET_CONTAINER_multishortmap_get (topology->map_globals, 2123 node = GNUNET_CONTAINER_multishortmap_get (topology->map_globals,
2124 hkey); 2124 hkey);
2125 node_connections = node->node_connections_head; 2125 if (NULL != node)
2126 node_connections = node->node_connections_head;
2126 } 2127 }
2127 else 2128 else
2128 { 2129 {
2129 namespace_n = (unsigned int) ceil ((double) (num - topology->nodes_x) 2130 namespace_n = (unsigned int) ceil ((double) (num - topology->nodes_x)
2130 / topology->nodes_m); 2131 / topology->nodes_m);
2131 LOG (GNUNET_ERROR_TYPE_ERROR, 2132 LOG (GNUNET_ERROR_TYPE_DEBUG,
2132 "ceil num: %u nodes_x: %u nodes_m: %u namespace_n: %u\n", 2133 "ceil num: %u nodes_x: %u nodes_m: %u namespace_n: %u\n",
2133 num, 2134 num,
2134 topology->nodes_x, 2135 topology->nodes_x,
@@ -2141,6 +2142,8 @@ GNUNET_TESTING_get_connections (unsigned int num, struct
2141 sizeof (*hkey)); 2142 sizeof (*hkey));
2142 namespace = GNUNET_CONTAINER_multishortmap_get (topology->map_namespaces, 2143 namespace = GNUNET_CONTAINER_multishortmap_get (topology->map_namespaces,
2143 hkey); 2144 hkey);
2145 if (NULL == namespace)
2146 return NULL;
2144 node_m = num - topology->nodes_x - topology->nodes_m * (namespace_n - 1); 2147 node_m = num - topology->nodes_x - topology->nodes_m * (namespace_n - 1);
2145 hkey = GNUNET_new (struct GNUNET_ShortHashCode); 2148 hkey = GNUNET_new (struct GNUNET_ShortHashCode);
2146 GNUNET_CRYPTO_hash (&node_m, sizeof(node_m), &hc); 2149 GNUNET_CRYPTO_hash (&node_m, sizeof(node_m), &hc);
@@ -2149,7 +2152,8 @@ GNUNET_TESTING_get_connections (unsigned int num, struct
2149 sizeof (*hkey)); 2152 sizeof (*hkey));
2150 node = GNUNET_CONTAINER_multishortmap_get (namespace->nodes, 2153 node = GNUNET_CONTAINER_multishortmap_get (namespace->nodes,
2151 hkey); 2154 hkey);
2152 node_connections = node->node_connections_head; 2155 if (NULL != node)
2156 node_connections = node->node_connections_head;
2153 } 2157 }
2154 2158
2155 GNUNET_free (hkey); 2159 GNUNET_free (hkey);