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

Function test_additions

test/file-register.c:269–303  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

267}
268
269static int test_additions(struct io_uring *ring)
270{
271 int *files, *fds = NULL;
272 int ret;
273
274 files = open_files(100, 100, 0);
275 ret = io_uring_register_files(ring, files, 200);
276 if (ret) {
277 fprintf(stderr, "%s: register ret=%d\n", __FUNCTION__, ret);
278 goto err;
279 }
280
281 fds = open_files(2, 0, 1);
282 ret = io_uring_register_files_update(ring, 100, fds, 2);
283 if (ret != 2) {
284 fprintf(stderr, "%s: update ret=%d\n", __FUNCTION__, ret);
285 goto err;
286 }
287
288 ret = io_uring_unregister_files(ring);
289 if (ret) {
290 fprintf(stderr, "%s: unregister ret=%d\n", __FUNCTION__, ret);
291 goto err;
292 }
293
294 close_files(files, 100, 0);
295 if (fds)
296 close_files(fds, 2, 1);
297 return 0;
298err:
299 close_files(files, 100, 0);
300 if (fds)
301 close_files(fds, 2, 1);
302 return 1;
303}
304
305static int test_sparse(struct io_uring *ring)
306{

Callers 1

mainFunction · 0.85

Calls 5

io_uring_register_filesFunction · 0.85
open_filesFunction · 0.70
close_filesFunction · 0.70

Tested by

no test coverage detected