summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarman Kalra <hkalra@marvell.com>2018-12-10 08:39:15 +0000
committerThomas Monjalon <thomas@monjalon.net>2019-01-20 22:30:11 +0100
commit99f16073b2a3d9881aa8fabe24c62834d902afda (patch)
tree0ebc23a387464d1ef1624f3972fd1dee917a5ece
parent5f40555b99ca65fca808c6546f0af34d9caa53bc (diff)
downloaddpdk-99f16073b2a3d9881aa8fabe24c62834d902afda.zip
dpdk-99f16073b2a3d9881aa8fabe24c62834d902afda.tar.gz
dpdk-99f16073b2a3d9881aa8fabe24c62834d902afda.tar.xz
test/metrics: fix a negative case
Negative test case for passing invalid count size to rte_metrics_update_values() will pass if count value is any value greater than 1 because set size wrt to key id 1 is 1 and passing 0 as no of values to be updated will not hit the ERANGE check. Fixes: cd3804242901 ("test/metrics: add unit tests for metrics library") Cc: stable@dpdk.org Signed-off-by: Harman Kalra <hkalra@marvell.com> Acked-by: Remy Horton <remy.horton@intel.com>
-rw-r--r--test/test/test_metrics.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/test/test_metrics.c b/test/test/test_metrics.c
index 94d54d7..3c2f36b 100644
--- a/test/test/test_metrics.c
+++ b/test/test/test_metrics.c
@@ -154,7 +154,7 @@ test_metrics_update_values(void)
/* Failed Test: Invalid count size */
err = rte_metrics_update_values(RTE_METRICS_GLOBAL,
- KEY, &value[0], 0);
+ KEY, &value[0], ARRAY_SIZE(value));
TEST_ASSERT(err < 0, "%s, %d", __func__, __LINE__);
/* Failed Test: Invalid port_id(lower value) and valid data */