| 947 | #define MIN_HANDLERS 32 |
| 948 | |
| 949 | static int |
| 950 | test_many_handler_registrations(void) |
| 951 | { |
| 952 | int rc; |
| 953 | int num_regs = 0; |
| 954 | int reg_ids[MORE_THAN_MAX_HANDLERS]; |
| 955 | int reg_id; |
| 956 | int i; |
| 957 | |
| 958 | rc = test_app_unregister_callbacks(test_app); |
| 959 | if (rc != TEST_SUCCESS) |
| 960 | return rc; |
| 961 | |
| 962 | for (i = 0; i < MORE_THAN_MAX_HANDLERS; i++) { |
| 963 | reg_id = rte_dispatcher_register(test_app->dispatcher, |
| 964 | never_match, NULL, |
| 965 | test_app_never_process, NULL); |
| 966 | if (reg_id < 0) |
| 967 | break; |
| 968 | |
| 969 | reg_ids[num_regs++] = reg_id; |
| 970 | } |
| 971 | |
| 972 | TEST_ASSERT_EQUAL(reg_id, -ENOMEM, "Incorrect return code. Expected " |
| 973 | "%d but was %d", -ENOMEM, reg_id); |
| 974 | TEST_ASSERT(num_regs >= MIN_HANDLERS, "Registration failed already " |
| 975 | "after %d handler registrations.", num_regs); |
| 976 | |
| 977 | for (i = 0; i < num_regs; i++) { |
| 978 | rc = rte_dispatcher_unregister(test_app->dispatcher, |
| 979 | reg_ids[i]); |
| 980 | TEST_ASSERT_SUCCESS(rc, "Unable to unregister handler %d", |
| 981 | reg_ids[i]); |
| 982 | } |
| 983 | |
| 984 | return TEST_SUCCESS; |
| 985 | } |
| 986 | |
| 987 | static void |
| 988 | dummy_finalize(uint8_t event_dev_id __rte_unused, |
nothing calls this directly
no test coverage detected