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

Function run_tests

test/recvsend_bundle.c:621–706  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

619}
620
621static int run_tests(int is_udp)
622{
623 int ret, eagain_hit;
624
625 nr_msgs = NR_MIN_MSGS;
626
627 /* test basic send bundle first */
628 ret = test(0, 0, NULL, 0, 0);
629 if (ret) {
630 fprintf(stderr, "test a failed\n");
631 return T_EXIT_FAIL;
632 }
633 if (no_send_mshot)
634 return T_EXIT_SKIP;
635
636 /* test recv bundle */
637 ret = test(0, 0, NULL, 0, 1);
638 if (ret) {
639 fprintf(stderr, "test b failed\n");
640 return T_EXIT_FAIL;
641 }
642
643 /* test bundling recv and send */
644 ret = test(0, 0, NULL, 1, 1);
645 if (ret) {
646 fprintf(stderr, "test c failed\n");
647 return T_EXIT_FAIL;
648 }
649
650 /* test bundling with full socket */
651 ret = test(1, 1000000, &eagain_hit, 1, 1);
652 if (ret) {
653 fprintf(stderr, "test d failed\n");
654 return T_EXIT_FAIL;
655 }
656
657 /* test bundling with almost full socket */
658 ret = test(1, eagain_hit - (nr_msgs / 2), NULL, 1, 1);
659 if (ret) {
660 fprintf(stderr, "test e failed\n");
661 return T_EXIT_FAIL;
662 }
663
664 /* test recv bundle with almost full socket */
665 ret = test(1, eagain_hit - (nr_msgs / 2), NULL, 0, 1);
666 if (ret) {
667 fprintf(stderr, "test f failed\n");
668 return T_EXIT_FAIL;
669 }
670
671 if (is_udp)
672 return T_EXIT_PASS;
673
674 /* test send bundle with almost full socket */
675 ret = test(1, eagain_hit - (nr_msgs / 2), &eagain_hit, 1, 0);
676 if (ret) {
677 fprintf(stderr, "test g failed\n");
678 return T_EXIT_FAIL;

Callers 2

test_tcpFunction · 0.70
test_udpFunction · 0.70

Calls 1

testFunction · 0.70

Tested by 2

test_tcpFunction · 0.56
test_udpFunction · 0.56