| 541 | } |
| 542 | |
| 543 | int main(int argc, char *argv[]) |
| 544 | { |
| 545 | struct io_uring ring; |
| 546 | const char *fname; |
| 547 | char buf[32]; |
| 548 | int ret; |
| 549 | |
| 550 | srand(getpid()); |
| 551 | |
| 552 | if (argc > 1) { |
| 553 | fname = argv[1]; |
| 554 | } else { |
| 555 | sprintf(buf, ".file-verify.%d", getpid()); |
| 556 | fname = buf; |
| 557 | t_create_file(fname, FSIZE); |
| 558 | } |
| 559 | |
| 560 | ret = io_uring_queue_init(READ_BATCH, &ring, 0); |
| 561 | if (ret) { |
| 562 | fprintf(stderr, "ring setup failed: %d\n", ret); |
| 563 | goto err; |
| 564 | } |
| 565 | |
| 566 | ret = fill_pattern(fname); |
| 567 | if (ret == T_EXIT_SKIP) |
| 568 | return T_EXIT_SKIP; |
| 569 | else if (ret) |
| 570 | goto err; |
| 571 | |
| 572 | ret = test(&ring, fname, 1, 0, 0, 0, 0); |
| 573 | if (ret == T_EXIT_SKIP) |
| 574 | return T_EXIT_SKIP; |
| 575 | if (ret) { |
| 576 | fprintf(stderr, "Buffered novec test failed\n"); |
| 577 | goto err; |
| 578 | } |
| 579 | ret = test(&ring, fname, 1, 0, 0, 1, 0); |
| 580 | if (ret == T_EXIT_FAIL) { |
| 581 | fprintf(stderr, "Buffered novec reg test failed\n"); |
| 582 | goto err; |
| 583 | } |
| 584 | ret = test(&ring, fname, 1, 0, 0, 0, 1); |
| 585 | if (ret == T_EXIT_FAIL) { |
| 586 | fprintf(stderr, "Buffered novec provide test failed\n"); |
| 587 | goto err; |
| 588 | } |
| 589 | ret = test(&ring, fname, 1, 1, 0, 0, 0); |
| 590 | if (ret == T_EXIT_FAIL) { |
| 591 | fprintf(stderr, "Buffered vec test failed\n"); |
| 592 | goto err; |
| 593 | } |
| 594 | ret = test(&ring, fname, 1, 1, 1, 0, 0); |
| 595 | if (ret == T_EXIT_FAIL) { |
| 596 | fprintf(stderr, "Buffered small vec test failed\n"); |
| 597 | goto err; |
| 598 | } |
| 599 | |
| 600 | ret = test(&ring, fname, 0, 0, 0, 0, 0); |
nothing calls this directly
no test coverage detected