| 53 | } |
| 54 | |
| 55 | static int |
| 56 | test_reorder_init(void) |
| 57 | { |
| 58 | struct rte_reorder_buffer *b = NULL; |
| 59 | unsigned int size; |
| 60 | /* |
| 61 | * The minimum memory area size that should be passed to library determined |
| 62 | * by rte_reorder_memory_footprint_get(). |
| 63 | * Otherwise error will be thrown |
| 64 | */ |
| 65 | |
| 66 | size = rte_reorder_memory_footprint_get(REORDER_BUFFER_SIZE) - 1; |
| 67 | b = rte_reorder_init(b, size, "PKT1", REORDER_BUFFER_SIZE); |
| 68 | TEST_ASSERT((b == NULL) && (rte_errno == EINVAL), |
| 69 | "No error on init with NULL buffer."); |
| 70 | |
| 71 | b = rte_malloc(NULL, size, 0); |
| 72 | b = rte_reorder_init(b, size, "PKT1", REORDER_BUFFER_SIZE); |
| 73 | TEST_ASSERT((b == NULL) && (rte_errno == EINVAL), |
| 74 | "No error on init with invalid mem zone size."); |
| 75 | rte_free(b); |
| 76 | |
| 77 | size = rte_reorder_memory_footprint_get(REORDER_BUFFER_SIZE); |
| 78 | b = rte_malloc(NULL, size, 0); |
| 79 | b = rte_reorder_init(b, size, "PKT1", REORDER_BUFFER_SIZE_INVALID); |
| 80 | TEST_ASSERT((b == NULL) && (rte_errno == EINVAL), |
| 81 | "No error on init with invalid buffer size param."); |
| 82 | |
| 83 | b = rte_reorder_init(b, size, NULL, REORDER_BUFFER_SIZE); |
| 84 | TEST_ASSERT((b == NULL) && (rte_errno == EINVAL), |
| 85 | "No error on init with invalid name."); |
| 86 | rte_free(b); |
| 87 | |
| 88 | return 0; |
| 89 | } |
| 90 | |
| 91 | static int |
| 92 | test_reorder_find_existing(void) |
nothing calls this directly
no test coverage detected