From: Harman Kalra Date: Mon, 10 Dec 2018 08:39:15 +0000 (+0000) Subject: test/metrics: fix a negative case X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=99f16073b2a3d9881aa8fabe24c62834d902afda;p=dpdk.git 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 Acked-by: Remy Horton --- diff --git a/test/test/test_metrics.c b/test/test/test_metrics.c index 94d54d71c0..3c2f36b8a4 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 */