| 368 | } |
| 369 | |
| 370 | static int test_splice(struct io_uring *ring, struct test_ctx *ctx) |
| 371 | { |
| 372 | int ret; |
| 373 | |
| 374 | if (has_splice) { |
| 375 | ret = check_zero_splice(ring, ctx); |
| 376 | if (ret) { |
| 377 | fprintf(stderr, "check_zero_splice failed %i %i\n", |
| 378 | ret, errno); |
| 379 | return ret; |
| 380 | } |
| 381 | |
| 382 | ret = splice_to_pipe(ring, ctx); |
| 383 | if (ret) { |
| 384 | fprintf(stderr, "splice_to_pipe failed %i %i\n", |
| 385 | ret, errno); |
| 386 | return ret; |
| 387 | } |
| 388 | |
| 389 | ret = splice_from_pipe(ring, ctx); |
| 390 | if (ret) { |
| 391 | fprintf(stderr, "splice_from_pipe failed %i %i\n", |
| 392 | ret, errno); |
| 393 | return ret; |
| 394 | } |
| 395 | |
| 396 | ret = splice_pipe_to_pipe(ring, ctx); |
| 397 | if (ret) { |
| 398 | fprintf(stderr, "splice_pipe_to_pipe failed %i %i\n", |
| 399 | ret, errno); |
| 400 | return ret; |
| 401 | } |
| 402 | |
| 403 | ret = fail_splice_pipe_offset(ring, ctx); |
| 404 | if (ret) { |
| 405 | fprintf(stderr, "fail_splice_pipe_offset failed %i %i\n", |
| 406 | ret, errno); |
| 407 | return ret; |
| 408 | } |
| 409 | } |
| 410 | |
| 411 | if (has_tee) { |
| 412 | ret = check_zero_tee(ring, ctx); |
| 413 | if (ret) { |
| 414 | fprintf(stderr, "check_zero_tee() failed %i %i\n", |
| 415 | ret, errno); |
| 416 | return ret; |
| 417 | } |
| 418 | |
| 419 | ret = fail_tee_nonpipe(ring, ctx); |
| 420 | if (ret) { |
| 421 | fprintf(stderr, "fail_tee_nonpipe() failed %i %i\n", |
| 422 | ret, errno); |
| 423 | return ret; |
| 424 | } |
| 425 | |
| 426 | ret = fail_tee_offset(ring, ctx); |
| 427 | if (ret) { |
no test coverage detected