diff options
author | Julius Bünger <buenger@mytum.de> | 2019-06-06 03:29:37 +0200 |
---|---|---|
committer | Julius Bünger <buenger@mytum.de> | 2019-06-06 03:29:37 +0200 |
commit | 17cee253b6820e1c7aa18e51344a2fd5a14b809d (patch) | |
tree | 7f9a29ebf337bc60eeed6c657ac83238b43454db /src/transport/test_communicator_unix.c | |
parent | c2eeb2f69ab1f0aa248781bebf04617cf9908e4b (diff) | |
download | gnunet-17cee253b6820e1c7aa18e51344a2fd5a14b809d.tar.gz gnunet-17cee253b6820e1c7aa18e51344a2fd5a14b809d.zip |
TNG testing: Make executable name variable, try sending test data
Diffstat (limited to 'src/transport/test_communicator_unix.c')
-rw-r--r-- | src/transport/test_communicator_unix.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/transport/test_communicator_unix.c b/src/transport/test_communicator_unix.c index e52391ef2..459af116a 100644 --- a/src/transport/test_communicator_unix.c +++ b/src/transport/test_communicator_unix.c | |||
@@ -32,18 +32,6 @@ | |||
32 | 32 | ||
33 | #include <inttypes.h> | 33 | #include <inttypes.h> |
34 | 34 | ||
35 | /** | ||
36 | * TODO | ||
37 | * - start two communicators | ||
38 | * - act like transport services | ||
39 | * - get_server_addresses (service.c) | ||
40 | * - open_listen_socket (service.c) | ||
41 | * - GNUNET_MQ_queue_for_callbacks (service.c) | ||
42 | * - let them communicate | ||
43 | * | ||
44 | */ | ||
45 | |||
46 | |||
47 | 35 | ||
48 | #define LOG(kind,...) GNUNET_log_from (kind, "test_transport_communicator_unix", __VA_ARGS__) | 36 | #define LOG(kind,...) GNUNET_log_from (kind, "test_transport_communicator_unix", __VA_ARGS__) |
49 | 37 | ||
@@ -55,6 +43,14 @@ static struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_hs[NUM_PE | |||
55 | 43 | ||
56 | //static char *addresses[NUM_PEERS]; | 44 | //static char *addresses[NUM_PEERS]; |
57 | 45 | ||
46 | |||
47 | #define PAYLOAD_SIZE 256 | ||
48 | |||
49 | //static char payload[PAYLOAD_SIZE] = "TEST PAYLOAD"; | ||
50 | //static char payload[] = "TEST PAYLOAD"; | ||
51 | static uint32_t payload = 42; | ||
52 | |||
53 | |||
58 | static void | 54 | static void |
59 | communicator_available_cb (void *cls, | 55 | communicator_available_cb (void *cls, |
60 | struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h, | 56 | struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h, |
@@ -110,6 +106,9 @@ add_queue_cb (void *cls, | |||
110 | { | 106 | { |
111 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 107 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
112 | "Got Queue!\n"); | 108 | "Got Queue!\n"); |
109 | GNUNET_TRANSPORT_TESTING_transport_communicator_send (tc_queue, | ||
110 | &payload, | ||
111 | sizeof (payload)); | ||
113 | } | 112 | } |
114 | 113 | ||
115 | 114 | ||
@@ -120,6 +119,7 @@ run (void *cls) | |||
120 | 119 | ||
121 | tc_hs[0] = GNUNET_TRANSPORT_TESTING_transport_communicator_service_start ( | 120 | tc_hs[0] = GNUNET_TRANSPORT_TESTING_transport_communicator_service_start ( |
122 | "transport", | 121 | "transport", |
122 | "gnunet-communicator-unix", | ||
123 | "test_communicator_1.conf", | 123 | "test_communicator_1.conf", |
124 | &communicator_available_cb, | 124 | &communicator_available_cb, |
125 | NULL, | 125 | NULL, |
@@ -128,6 +128,7 @@ run (void *cls) | |||
128 | NULL); /* cls */ | 128 | NULL); /* cls */ |
129 | tc_hs[1] = GNUNET_TRANSPORT_TESTING_transport_communicator_service_start ( | 129 | tc_hs[1] = GNUNET_TRANSPORT_TESTING_transport_communicator_service_start ( |
130 | "transport", | 130 | "transport", |
131 | "gnunet-communicator-unix", | ||
131 | "test_communicator_2.conf", | 132 | "test_communicator_2.conf", |
132 | &communicator_available_cb, | 133 | &communicator_available_cb, |
133 | &add_address_cb, | 134 | &add_address_cb, |