diff options
author | Bart Polot <bart@net.in.tum.de> | 2016-07-20 12:07:05 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2016-07-20 12:07:05 +0000 |
commit | dbb12b0c0216846ec0cfa30ed2760c221434eaee (patch) | |
tree | 140b649ad916e45f17faa42a5ba5cdf3563b2e52 /src/cadet/cadet_test_lib.c | |
parent | caa4196867da8684c5b1fd2e747ecb9d21cbba8b (diff) | |
download | gnunet-dbb12b0c0216846ec0cfa30ed2760c221434eaee.tar.gz gnunet-dbb12b0c0216846ec0cfa30ed2760c221434eaee.zip |
- adapt test cases / framework to new port system
Diffstat (limited to 'src/cadet/cadet_test_lib.c')
-rw-r--r-- | src/cadet/cadet_test_lib.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/cadet/cadet_test_lib.c b/src/cadet/cadet_test_lib.c index cd9e47b0b..9a70dad49 100644 --- a/src/cadet/cadet_test_lib.c +++ b/src/cadet/cadet_test_lib.c | |||
@@ -80,7 +80,7 @@ struct GNUNET_CADET_TEST_Context | |||
80 | /** | 80 | /** |
81 | * Application ports. | 81 | * Application ports. |
82 | */ | 82 | */ |
83 | const uint32_t *ports; | 83 | const struct GNUNET_HashCode **ports; |
84 | 84 | ||
85 | }; | 85 | }; |
86 | 86 | ||
@@ -94,7 +94,7 @@ struct GNUNET_CADET_TEST_AdapterContext | |||
94 | * Peer number for the particular peer. | 94 | * Peer number for the particular peer. |
95 | */ | 95 | */ |
96 | unsigned int peer; | 96 | unsigned int peer; |
97 | 97 | ||
98 | /** | 98 | /** |
99 | * General context. | 99 | * General context. |
100 | */ | 100 | */ |
@@ -124,6 +124,16 @@ cadet_connect_adapter (void *cls, | |||
124 | (void *) (long) actx->peer, | 124 | (void *) (long) actx->peer, |
125 | ctx->cleaner, | 125 | ctx->cleaner, |
126 | ctx->handlers); | 126 | ctx->handlers); |
127 | if (NULL == ctx->ports) | ||
128 | return h; | ||
129 | |||
130 | for (int i = 0; NULL != ctx->ports[i]; i++) | ||
131 | { | ||
132 | (void ) GNUNET_CADET_open_port (h, ctx->ports[i], | ||
133 | ctx->new_channel, | ||
134 | (void *) (long) actx->peer); | ||
135 | } | ||
136 | |||
127 | return h; | 137 | return h; |
128 | } | 138 | } |
129 | 139 | ||
@@ -269,7 +279,7 @@ GNUNET_CADET_TEST_run (const char *testname, | |||
269 | GNUNET_CADET_InboundChannelNotificationHandler new_channel, | 279 | GNUNET_CADET_InboundChannelNotificationHandler new_channel, |
270 | GNUNET_CADET_ChannelEndHandler cleaner, | 280 | GNUNET_CADET_ChannelEndHandler cleaner, |
271 | struct GNUNET_CADET_MessageHandler* handlers, | 281 | struct GNUNET_CADET_MessageHandler* handlers, |
272 | const uint32_t *ports) | 282 | const struct GNUNET_HashCode **ports) |
273 | { | 283 | { |
274 | struct GNUNET_CADET_TEST_Context *ctx; | 284 | struct GNUNET_CADET_TEST_Context *ctx; |
275 | 285 | ||