aboutsummaryrefslogtreecommitdiff
path: root/src/ats
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-05-21 12:24:19 +0000
committerChristian Grothoff <christian@grothoff.org>2015-05-21 12:24:19 +0000
commitbdbe3ab96590430b7f7501d9187551bf2f418278 (patch)
tree5159e69f94943ab80cacd175164aa382d9915f4d /src/ats
parent525210e28f4ce7b1b117721dced018cccf347d35 (diff)
downloadgnunet-bdbe3ab96590430b7f7501d9187551bf2f418278.tar.gz
gnunet-bdbe3ab96590430b7f7501d9187551bf2f418278.zip
-fix testcase
Diffstat (limited to 'src/ats')
-rw-r--r--src/ats/test_ats_api.c38
-rw-r--r--src/ats/test_ats_lib.c9
2 files changed, 24 insertions, 23 deletions
diff --git a/src/ats/test_ats_api.c b/src/ats/test_ats_api.c
index 97fdd65c1..68d8a217a 100644
--- a/src/ats/test_ats_api.c
+++ b/src/ats/test_ats_api.c
@@ -46,7 +46,7 @@ static struct Command test_commands[] = {
46 } 46 }
47 } 47 }
48 }, 48 },
49 /* adding same address again should fail */ 49 /* 1: adding same address again should fail */
50 { 50 {
51 .code = CMD_ADD_ADDRESS, 51 .code = CMD_ADD_ADDRESS,
52 .label = "add-address-0-0:FAIL", 52 .label = "add-address-0-0:FAIL",
@@ -60,7 +60,7 @@ static struct Command test_commands[] = {
60 .expect_fail = 1 60 .expect_fail = 1
61 } 61 }
62 }, 62 },
63 /* some solver still require explicit start */ 63 /* 2: some solver still require explicit start */
64 { 64 {
65 .code = CMD_REQUEST_CONNECTION_START, 65 .code = CMD_REQUEST_CONNECTION_START,
66 .label = "request-0", 66 .label = "request-0",
@@ -68,21 +68,21 @@ static struct Command test_commands[] = {
68 .pid = 0 68 .pid = 0
69 } 69 }
70 }, 70 },
71 /* check we got an address */ 71 /* 3: check we got an address */
72 { 72 {
73 .code = CMD_AWAIT_ADDRESS_SUGGESTION, 73 .code = CMD_AWAIT_ADDRESS_SUGGESTION,
74 .details.await_address_suggestion = { 74 .details.await_address_suggestion = {
75 .add_label = "add-address-0-0" 75 .add_label = "add-address-0-0"
76 } 76 }
77 }, 77 },
78 /* check monitor also got the address */ 78 /* 4: check monitor also got the address */
79 { 79 {
80 .code = CMD_AWAIT_ADDRESS_INFORMATION, 80 .code = CMD_AWAIT_ADDRESS_INFORMATION,
81 .details.await_address_information = { 81 .details.await_address_information = {
82 .add_label = "add-address-0-0" 82 .add_label = "add-address-0-0"
83 } 83 }
84 }, 84 },
85 /* test session API */ 85 /* 5: test session API */
86 { 86 {
87 .code = CMD_ADD_SESSION, 87 .code = CMD_ADD_SESSION,
88 .label = "add-session-0-0-1", 88 .label = "add-session-0-0-1",
@@ -97,7 +97,7 @@ static struct Command test_commands[] = {
97 .add_session_label = "add-session-0-0-1", 97 .add_session_label = "add-session-0-0-1",
98 } 98 }
99 }, 99 },
100 /* test preference API */ 100 /* 7: test preference API */
101 { 101 {
102 .code = CMD_CHANGE_PREFERENCE, 102 .code = CMD_CHANGE_PREFERENCE,
103 .details.change_preference = { 103 .details.change_preference = {
@@ -113,7 +113,7 @@ static struct Command test_commands[] = {
113 /* FIXME: preference details */ 113 /* FIXME: preference details */
114 } 114 }
115 }, 115 },
116 /* test sanity check address listing */ 116 /* 9: test sanity check address listing */
117 { 117 {
118 .code = CMD_LIST_ADDRESSES, 118 .code = CMD_LIST_ADDRESSES,
119 .details.list_addresses = { 119 .details.list_addresses = {
@@ -125,28 +125,28 @@ static struct Command test_commands[] = {
125 .max_active_calls = 1 125 .max_active_calls = 1
126 } 126 }
127 }, 127 },
128 /* remove address testing */ 128 /* 10: remove address testing */
129 { 129 {
130 .code = CMD_DEL_ADDRESS, 130 .code = CMD_DEL_ADDRESS,
131 .details.del_address = { 131 .details.del_address = {
132 .add_label = "add-address-0-0" 132 .add_label = "add-address-0-0"
133 } 133 }
134 }, 134 },
135 /* check we got disconnected */ 135 /* 11: check we got disconnected */
136 { 136 {
137 .code = CMD_AWAIT_DISCONNECT_SUGGESTION, 137 .code = CMD_AWAIT_DISCONNECT_SUGGESTION,
138 .details.await_disconnect_suggestion = { 138 .details.await_disconnect_suggestion = {
139 .pid = 0 139 .pid = 0
140 } 140 }
141 }, 141 },
142 /* just for symmetry, also stop asking for the connection */ 142 /* 12: just for symmetry, also stop asking for the connection */
143 { 143 {
144 .code = CMD_REQUEST_CONNECTION_STOP, 144 .code = CMD_REQUEST_CONNECTION_STOP,
145 .details.request_connection_stop = { 145 .details.request_connection_stop = {
146 .connect_label = "request-0", 146 .connect_label = "request-0",
147 } 147 }
148 }, 148 },
149 /* add address again */ 149 /* 13: add address again */
150 { 150 {
151 .code = CMD_ADD_ADDRESS, 151 .code = CMD_ADD_ADDRESS,
152 .label = "add-address-0-0:1", 152 .label = "add-address-0-0:1",
@@ -159,7 +159,7 @@ static struct Command test_commands[] = {
159 } 159 }
160 } 160 }
161 }, 161 },
162 /* some solver still require explicit start */ 162 /* 14: some solver still require explicit start */
163 { 163 {
164 .code = CMD_REQUEST_CONNECTION_START, 164 .code = CMD_REQUEST_CONNECTION_START,
165 .label = "request-0", 165 .label = "request-0",
@@ -167,14 +167,14 @@ static struct Command test_commands[] = {
167 .pid = 0 167 .pid = 0
168 } 168 }
169 }, 169 },
170 /* check we got an address */ 170 /* 15: check we got an address */
171 { 171 {
172 .code = CMD_AWAIT_ADDRESS_SUGGESTION, 172 .code = CMD_AWAIT_ADDRESS_SUGGESTION,
173 .details.await_address_suggestion = { 173 .details.await_address_suggestion = {
174 .add_label = "add-address-0-0:1" 174 .add_label = "add-address-0-0:1"
175 } 175 }
176 }, 176 },
177 /* add alternative address */ 177 /* 16: add alternative address */
178 { 178 {
179 .code = CMD_ADD_ADDRESS, 179 .code = CMD_ADD_ADDRESS,
180 .label = "add-address-0-1", 180 .label = "add-address-0-1",
@@ -187,35 +187,35 @@ static struct Command test_commands[] = {
187 } 187 }
188 } 188 }
189 }, 189 },
190 /* remove original address */ 190 /* 17: remove original address */
191 { 191 {
192 .code = CMD_DEL_ADDRESS, 192 .code = CMD_DEL_ADDRESS,
193 .details.del_address = { 193 .details.del_address = {
194 .add_label = "add-address-0-0:1" 194 .add_label = "add-address-0-0:1"
195 } 195 }
196 }, 196 },
197 /* check we switched to alternative address */ 197 /* 18: check we switched to alternative address */
198 { 198 {
199 .code = CMD_AWAIT_ADDRESS_SUGGESTION, 199 .code = CMD_AWAIT_ADDRESS_SUGGESTION,
200 .details.await_address_suggestion = { 200 .details.await_address_suggestion = {
201 .add_label = "add-address-0-1" 201 .add_label = "add-address-0-1"
202 } 202 }
203 }, 203 },
204 /* remove alternative address */ 204 /* 19: remove alternative address */
205 { 205 {
206 .code = CMD_DEL_ADDRESS, 206 .code = CMD_DEL_ADDRESS,
207 .details.del_address = { 207 .details.del_address = {
208 .add_label = "add-address-0-1" 208 .add_label = "add-address-0-1"
209 } 209 }
210 }, 210 },
211 /* check we got disconnected */ 211 /* 20: check we got disconnected */
212 { 212 {
213 .code = CMD_AWAIT_DISCONNECT_SUGGESTION, 213 .code = CMD_AWAIT_DISCONNECT_SUGGESTION,
214 .details.await_disconnect_suggestion = { 214 .details.await_disconnect_suggestion = {
215 .pid = 0 215 .pid = 0
216 } 216 }
217 }, 217 },
218 /* just for symmetry, also stop asking for the connection */ 218 /* 21: just for symmetry, also stop asking for the connection */
219 { 219 {
220 .code = CMD_REQUEST_CONNECTION_STOP, 220 .code = CMD_REQUEST_CONNECTION_STOP,
221 .details.request_connection_stop = { 221 .details.request_connection_stop = {
diff --git a/src/ats/test_ats_lib.c b/src/ats/test_ats_lib.c
index e7cca2a71..d70580b9b 100644
--- a/src/ats/test_ats_lib.c
+++ b/src/ats/test_ats_lib.c
@@ -671,7 +671,7 @@ interpreter (void *cls,
671 if (NULL == asd) 671 if (NULL == asd)
672 return; 672 return;
673 if (GNUNET_NO == asd->active) 673 if (GNUNET_NO == asd->active)
674 return; 674 return; /* last suggestion was to disconnect, wait longer */
675 done = GNUNET_YES; 675 done = GNUNET_YES;
676 if (NULL != cmd->details.await_address_suggestion.add_label) 676 if (NULL != cmd->details.await_address_suggestion.add_label)
677 { 677 {
@@ -703,9 +703,10 @@ interpreter (void *cls,
703 &pid); 703 &pid);
704 asd = find_address_suggestion (&pid); 704 asd = find_address_suggestion (&pid);
705 if (NULL == asd) 705 if (NULL == asd)
706 return; 706 return; /* odd, no suggestion at all yet!? */
707 if (GNUNET_NO == asd->active) 707 if (GNUNET_YES == asd->active)
708 return; 708 return; /* last suggestion was to activate, wait longer */
709 /* last suggestion was to deactivate, condition satisfied! */
709 off++; 710 off++;
710 break; 711 break;
711 } 712 }