* Tests for rte_intr_disable(). */
| 315 | * Tests for rte_intr_disable(). |
| 316 | */ |
| 317 | static int |
| 318 | test_interrupt_disable(void) |
| 319 | { |
| 320 | struct rte_intr_handle *test_intr_handle; |
| 321 | |
| 322 | /* check with null intr_handle */ |
| 323 | if (rte_intr_disable(NULL) == 0) { |
| 324 | printf("unexpectedly disable null intr_handle " |
| 325 | "successfully\n"); |
| 326 | return -1; |
| 327 | } |
| 328 | |
| 329 | /* check with invalid intr_handle */ |
| 330 | test_intr_handle = intr_handles[TEST_INTERRUPT_HANDLE_INVALID]; |
| 331 | if (rte_intr_disable(test_intr_handle) == 0) { |
| 332 | printf("unexpectedly disable invalid intr_handle " |
| 333 | "successfully\n"); |
| 334 | return -1; |
| 335 | } |
| 336 | |
| 337 | /* check with valid intr_handle */ |
| 338 | test_intr_handle = intr_handles[TEST_INTERRUPT_HANDLE_VALID]; |
| 339 | if (rte_intr_disable(test_intr_handle) == 0) { |
| 340 | printf("unexpectedly disable a specific intr_handle " |
| 341 | "successfully\n"); |
| 342 | return -1; |
| 343 | } |
| 344 | |
| 345 | /* check with specific valid intr_handle */ |
| 346 | test_intr_handle = intr_handles[TEST_INTERRUPT_HANDLE_VALID_ALARM]; |
| 347 | if (rte_intr_disable(test_intr_handle) == 0) { |
| 348 | printf("unexpectedly disable a specific intr_handle " |
| 349 | "successfully\n"); |
| 350 | return -1; |
| 351 | } |
| 352 | |
| 353 | /* check with specific valid intr_handle */ |
| 354 | test_intr_handle = intr_handles[TEST_INTERRUPT_HANDLE_VALID_DEV_EVENT]; |
| 355 | if (rte_intr_disable(test_intr_handle) == 0) { |
| 356 | printf("unexpectedly disable a specific intr_handle " |
| 357 | "successfully\n"); |
| 358 | return -1; |
| 359 | } |
| 360 | |
| 361 | /* check with valid handler and its type */ |
| 362 | test_intr_handle = intr_handles[TEST_INTERRUPT_HANDLE_CASE1]; |
| 363 | if (rte_intr_disable(test_intr_handle) < 0) { |
| 364 | printf("fail to disable interrupt on a simulated handler\n"); |
| 365 | return -1; |
| 366 | } |
| 367 | |
| 368 | test_intr_handle = intr_handles[TEST_INTERRUPT_HANDLE_VALID_UIO]; |
| 369 | if (rte_intr_disable(test_intr_handle) == 0) { |
| 370 | printf("unexpectedly disable a specific intr_handle " |
| 371 | "successfully\n"); |
| 372 | return -1; |
| 373 | } |
| 374 |
no test coverage detected