diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-09-20 20:27:36 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-09-20 20:27:36 +0000 |
commit | 60d02b5b0899f454cb65408bd2ed4c453fa75a3d (patch) | |
tree | 7dbd6620eb009071318dfb1bb18bb5401c8528f4 /src/transport/test_transport_api_manipulation_recv_tcp.c | |
parent | 03f0ae4bb10cf55bb9bab601d45fd96c2eb13603 (diff) | |
download | gnunet-60d02b5b0899f454cb65408bd2ed4c453fa75a3d.tar.gz gnunet-60d02b5b0899f454cb65408bd2ed4c453fa75a3d.zip |
-make test more robust
Diffstat (limited to 'src/transport/test_transport_api_manipulation_recv_tcp.c')
-rw-r--r-- | src/transport/test_transport_api_manipulation_recv_tcp.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/transport/test_transport_api_manipulation_recv_tcp.c b/src/transport/test_transport_api_manipulation_recv_tcp.c index 69ccf5763..33f86e8a6 100644 --- a/src/transport/test_transport_api_manipulation_recv_tcp.c +++ b/src/transport/test_transport_api_manipulation_recv_tcp.c | |||
@@ -87,7 +87,9 @@ sendtask (void *cls) | |||
87 | } | 87 | } |
88 | if (0 < messages_recv) | 88 | if (0 < messages_recv) |
89 | { | 89 | { |
90 | memset (&prop, 0, sizeof (prop)); | 90 | memset (&prop, |
91 | 0, | ||
92 | sizeof (prop)); | ||
91 | delay = GNUNET_TIME_UNIT_SECONDS; | 93 | delay = GNUNET_TIME_UNIT_SECONDS; |
92 | GNUNET_TRANSPORT_manipulation_set (ccc->p[1]->tmh, | 94 | GNUNET_TRANSPORT_manipulation_set (ccc->p[1]->tmh, |
93 | &ccc->p[0]->id, | 95 | &ccc->p[0]->id, |
@@ -95,10 +97,13 @@ sendtask (void *cls) | |||
95 | delay, | 97 | delay, |
96 | GNUNET_TIME_UNIT_ZERO); | 98 | GNUNET_TIME_UNIT_ZERO); |
97 | /* wait 1s to allow manipulation to go into effect */ | 99 | /* wait 1s to allow manipulation to go into effect */ |
98 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, | 100 | if (1 == messages_recv) |
99 | &delayed_transmit, | 101 | { |
100 | sc); | 102 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, |
101 | return; | 103 | &delayed_transmit, |
104 | sc); | ||
105 | return; | ||
106 | } | ||
102 | } | 107 | } |
103 | GNUNET_TRANSPORT_TESTING_large_send (sc); | 108 | GNUNET_TRANSPORT_TESTING_large_send (sc); |
104 | } | 109 | } |
@@ -131,7 +136,7 @@ notify_receive (void *cls, | |||
131 | return; | 136 | return; |
132 | } | 137 | } |
133 | 138 | ||
134 | if (messages_recv <= 1) | 139 | if (messages_recv <= 2) |
135 | { | 140 | { |
136 | /* Received non-delayed message */ | 141 | /* Received non-delayed message */ |
137 | dur_normal = GNUNET_TIME_absolute_get_duration (start_normal); | 142 | dur_normal = GNUNET_TIME_absolute_get_duration (start_normal); |