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

Function test_dummy

test/regbuf-clone.c:480–525  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

478}
479
480static int test_dummy(void)
481{
482 struct iovec vec = { };
483 struct io_uring src, dst;
484 int ret;
485
486 ret = io_uring_queue_init(1, &src, 0);
487 if (ret) {
488 fprintf(stderr, "ring_init: %d\n", ret);
489 return T_EXIT_FAIL;
490 }
491 ret = io_uring_queue_init(1, &dst, 0);
492 if (ret) {
493 fprintf(stderr, "ring_init: %d\n", ret);
494 return T_EXIT_FAIL;
495 }
496
497 ret = io_uring_register_buffers(&src, &vec, 1);
498 if (ret < 0) {
499 fprintf(stderr, "failed to register dummy buffer: %d\n", ret);
500 return T_EXIT_FAIL;
501 }
502
503 ret = io_uring_clone_buffers(&dst, &src);
504 if (ret) {
505 fprintf(stderr, "clone dummy buf: %d\n", ret);
506 return T_EXIT_FAIL;
507 }
508
509 ret = io_uring_unregister_buffers(&src);
510 if (ret) {
511 fprintf(stderr, "rsc unregister buffers: %d\n", ret);
512 return T_EXIT_FAIL;
513 }
514
515 ret = io_uring_unregister_buffers(&dst);
516 if (ret) {
517 fprintf(stderr, "dst unregister buffers: %d\n", ret);
518 return T_EXIT_FAIL;
519 }
520
521 io_uring_queue_exit(&src);
522 io_uring_queue_exit(&dst);
523
524 return T_EXIT_PASS;
525}
526
527/*
528 * Register sparse buffer table, then try updating that with a few huge

Callers 1

mainFunction · 0.85

Calls 5

io_uring_queue_initFunction · 0.85
io_uring_queue_exitFunction · 0.85
io_uring_clone_buffersFunction · 0.50

Tested by

no test coverage detected