return TEST_SUCCESS;
}
+/* To test free the resources from bitrate_create test */
+static int
+test_stats_bitrate_free(void)
+{
+ int ret = 0;
+
+ rte_stats_bitrate_free(bitrate_data);
+
+ ret = rte_metrics_deinit();
+ TEST_ASSERT(ret >= 0, "Test Failed: rte_metrics_deinit failed");
+
+ return TEST_SUCCESS;
+}
+
/* To test bit rate registration */
static int
test_stats_bitrate_reg(void)
int ret = 0;
ret = rte_stats_bitrate_calc(bitrate_data, 33);
- TEST_ASSERT(ret == -EINVAL, "Test Failed: Expected -%d for higher "
- "portid rte_stats_bitrate_calc ret:%d", EINVAL, ret);
+ TEST_ASSERT(ret == -ENODEV, "Test Failed: Expected -%d for higher "
+ "portid rte_stats_bitrate_calc ret:%d", ENODEV, ret);
return TEST_SUCCESS;
}
int ret = 0;
ret = rte_stats_bitrate_calc(bitrate_data, -1);
- TEST_ASSERT(ret == -EINVAL, "Test Failed: Expected -%d for invalid "
- "portid rte_stats_bitrate_calc ret:%d", EINVAL, ret);
+ TEST_ASSERT(ret == -ENODEV, "Test Failed: Expected -%d for invalid "
+ "portid rte_stats_bitrate_calc ret:%d", ENODEV, ret);
return TEST_SUCCESS;
}
int ret = 0;
ret = rte_stats_bitrate_calc(bitrate_data, 31);
- TEST_ASSERT(ret == -EINVAL, "Test Failed: Expected -%d for "
+ TEST_ASSERT(ret == -ENODEV, "Test Failed: Expected -%d for "
"non-existing portid rte_stats_bitrate_calc ret:%d",
- EINVAL, ret);
+ ENODEV, ret);
return TEST_SUCCESS;
}
*/
TEST_CASE_ST(test_bit_packet_forward, NULL,
test_stats_bitrate_calc),
+ /* TEST CASE 9: Test to do the cleanup w.r.t create */
+ TEST_CASE(test_stats_bitrate_free),
TEST_CASES_END()
}
};