| 705 | struct test_app *test_app; |
| 706 | |
| 707 | static int |
| 708 | test_setup(void) |
| 709 | { |
| 710 | int rc; |
| 711 | |
| 712 | if (rte_lcore_count() < MIN_LCORES) { |
| 713 | printf("Not enough cores for dispatcher_autotest; expecting at " |
| 714 | "least %d.\n", MIN_LCORES); |
| 715 | return TEST_SKIPPED; |
| 716 | } |
| 717 | |
| 718 | test_app = test_app_create(); |
| 719 | TEST_ASSERT(test_app != NULL, "Unable to allocate memory"); |
| 720 | |
| 721 | rc = test_app_setup_event_dev(test_app); |
| 722 | if (rc != TEST_SUCCESS) |
| 723 | goto err_free_app; |
| 724 | |
| 725 | rc = test_app_create_dispatcher(test_app); |
| 726 | if (rc != TEST_SUCCESS) |
| 727 | goto err_teardown_event_dev; |
| 728 | |
| 729 | rc = test_app_setup_service_cores(test_app); |
| 730 | if (rc != TEST_SUCCESS) |
| 731 | goto err_free_dispatcher; |
| 732 | |
| 733 | rc = test_app_register_callbacks(test_app); |
| 734 | if (rc != TEST_SUCCESS) |
| 735 | goto err_teardown_service_cores; |
| 736 | |
| 737 | rc = test_app_bind_ports(test_app); |
| 738 | if (rc != TEST_SUCCESS) |
| 739 | goto err_unregister_callbacks; |
| 740 | |
| 741 | return TEST_SUCCESS; |
| 742 | |
| 743 | err_unregister_callbacks: |
| 744 | test_app_unregister_callbacks(test_app); |
| 745 | err_teardown_service_cores: |
| 746 | test_app_teardown_service_cores(test_app); |
| 747 | err_free_dispatcher: |
| 748 | test_app_free_dispatcher(test_app); |
| 749 | err_teardown_event_dev: |
| 750 | test_app_teardown_event_dev(test_app); |
| 751 | err_free_app: |
| 752 | test_app_free(test_app); |
| 753 | |
| 754 | test_app = NULL; |
| 755 | |
| 756 | return rc; |
| 757 | } |
| 758 | |
| 759 | static void test_teardown(void) |
| 760 | { |
nothing calls this directly
no test coverage detected