[v2] test/metrics: Fixed a negative case to pass

Message ID 20181210084416.3283-1-hkalra@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series [v2] test/metrics: Fixed a negative case to pass |

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/intel-Performance-Testing success Performance Testing PASS

Commit Message

Harman Kalra Dec. 10, 2018, 8:44 a.m. UTC
  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.

Signed-off-by: Harman Kalra <hkalra@marvell.com>
---
Fixed the patch creation issue, now git apply works fine.

 test/test/test_metrics.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/test/test/test_metrics.c b/test/test/test_metrics.c
index 94d54d71c..3c2f36b8a 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 */