Test case to get latency stats values */
| 105 | |
| 106 | /* Test case to get latency stats values */ |
| 107 | static int test_latencystats_get(void) |
| 108 | { |
| 109 | int ret = 0, i = 0; |
| 110 | int size = 0; |
| 111 | struct rte_metric_value values[NUM_STATS]; |
| 112 | |
| 113 | size_t v_size = sizeof(struct rte_metric_value); |
| 114 | for (i = 0; i < NUM_STATS; i++) |
| 115 | memset(&values[i], 0, v_size); |
| 116 | |
| 117 | /* Success Test: Valid values and valid size */ |
| 118 | size = NUM_STATS; |
| 119 | ret = rte_latencystats_get(values, size); |
| 120 | TEST_ASSERT((ret == NUM_STATS), "Test Failed to get latency metrics" |
| 121 | " values"); |
| 122 | |
| 123 | /* Failure Test: Invalid values and valid size */ |
| 124 | ret = rte_latencystats_get(NULL, size); |
| 125 | TEST_ASSERT((ret == NUM_STATS), "Test Failed to get the stats count," |
| 126 | "Actual: %d Expected: %d", ret, NUM_STATS); |
| 127 | |
| 128 | /* Failure Test: Valid values and invalid size */ |
| 129 | size = 0; |
| 130 | ret = rte_latencystats_get(values, size); |
| 131 | TEST_ASSERT((ret == NUM_STATS), "Test Failed to get the stats count," |
| 132 | "Actual: %d Expected: %d", ret, NUM_STATS); |
| 133 | |
| 134 | return TEST_SUCCESS; |
| 135 | } |
| 136 | |
| 137 | static int test_latency_ring_setup(void) |
| 138 | { |
nothing calls this directly
no test coverage detected