MCPcopy Create free account
hub / github.com/axboe/liburing / main

Function main

test/min-timeout.c:152–232  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

150}
151
152int main(int argc, char *argv[])
153{
154 int ret;
155
156 if (argc > 1)
157 return T_EXIT_SKIP;
158 ret = test(0, NWRITES + 1, 0, 2000, NWRITES, WAIT_USEC / 1000);
159 if (ret == T_EXIT_FAIL)
160 return T_EXIT_FAIL;
161 if (no_min_timeout)
162 return T_EXIT_SKIP;
163
164 ret = test(0, NWRITES + 1, 50000, 2000, NWRITES, 50);
165 if (ret == T_EXIT_FAIL)
166 return T_EXIT_FAIL;
167
168 ret = test(0, NWRITES + 1, 500000, 2000, NWRITES, 500);
169 if (ret == T_EXIT_FAIL)
170 return T_EXIT_FAIL;
171
172 /* no writes within min timeout, but it's given. expect 1 cqe */
173 ret = test(0, 1, 10000, 20000, 1, 20);
174 if (ret == T_EXIT_FAIL)
175 return T_EXIT_FAIL;
176
177 /* same as above, but no min timeout. should time out and we get 6 */
178 ret = test(0, NWRITES + 1, 0, 20000, NWRITES, WAIT_USEC / 1000);
179 if (ret == T_EXIT_FAIL)
180 return T_EXIT_FAIL;
181
182 ret = test(IORING_SETUP_SINGLE_ISSUER | IORING_SETUP_DEFER_TASKRUN, 1,
183 0, 2000, NWRITES, WAIT_USEC / 1000);
184 if (ret == T_EXIT_FAIL)
185 return T_EXIT_FAIL;
186
187 ret = test(IORING_SETUP_SINGLE_ISSUER | IORING_SETUP_DEFER_TASKRUN, 1,
188 50000, 2000, NWRITES, 50);
189 if (ret == T_EXIT_FAIL)
190 return T_EXIT_FAIL;
191
192 ret = test(IORING_SETUP_SINGLE_ISSUER | IORING_SETUP_DEFER_TASKRUN, 1,
193 500000, 2000, NWRITES, 500);
194 if (ret == T_EXIT_FAIL)
195 return T_EXIT_FAIL;
196
197 /* no writes within min timeout, but it's given. expect 1 cqe */
198 ret = test(IORING_SETUP_SINGLE_ISSUER | IORING_SETUP_DEFER_TASKRUN, 1,
199 10000, 20000, 1, 20);
200 if (ret == T_EXIT_FAIL)
201 return T_EXIT_FAIL;
202
203 /* same as above, but no min timeout. should time out and we get 6 */
204 ret = test(IORING_SETUP_SINGLE_ISSUER | IORING_SETUP_DEFER_TASKRUN, 1,
205 0, 20000, NWRITES, WAIT_USEC / 1000);
206 if (ret == T_EXIT_FAIL)
207 return T_EXIT_FAIL;
208
209 ret = test(IORING_SETUP_SQPOLL, 1, 0, 2000, NWRITES, WAIT_USEC / 1000);

Callers

nothing calls this directly

Calls 1

testFunction · 0.70

Tested by

no test coverage detected