[dpdk-dev,01/17] app/test: few small fixes fot test_acl.c

Message ID 1418580659-12595-2-git-send-email-konstantin.ananyev@intel.com (mailing list archive)
State Superseded, archived
Headers

Commit Message

Ananyev, Konstantin Dec. 14, 2014, 6:10 p.m. UTC
  Make sure that test_acl would not ignore error conditions.
Run classify() with all possible values.

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
---
 app/test/test_acl.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
  

Patch

diff --git a/app/test/test_acl.c b/app/test/test_acl.c
index 356d620..7119ad3 100644
--- a/app/test/test_acl.c
+++ b/app/test/test_acl.c
@@ -111,7 +111,7 @@  test_classify_run(struct rte_acl_ctx *acx)
 	 * these will run quite a few times, it's necessary to test code paths
 	 * from num=0 to num>8
 	 */
-	for (count = 0; count < RTE_DIM(acl_test_data); count++) {
+	for (count = 0; count <= RTE_DIM(acl_test_data); count++) {
 		ret = rte_acl_classify(acx, data, results,
 				count, RTE_ACL_MAX_CATEGORIES);
 		if (ret != 0) {
@@ -128,6 +128,7 @@  test_classify_run(struct rte_acl_ctx *acx)
 					"(expected %"PRIu32" got %"PRIu32")!\n",
 					__LINE__, i, acl_test_data[i].allow,
 					result);
+				ret = -EINVAL;
 				goto err;
 			}
 		}
@@ -140,6 +141,7 @@  test_classify_run(struct rte_acl_ctx *acx)
 					"(expected %"PRIu32" got %"PRIu32")!\n",
 					__LINE__, i, acl_test_data[i].deny,
 					result);
+				ret = -EINVAL;
 				goto err;
 			}
 		}
@@ -150,7 +152,7 @@  test_classify_run(struct rte_acl_ctx *acx)
 			RTE_DIM(acl_test_data), RTE_ACL_MAX_CATEGORIES,
 			RTE_ACL_CLASSIFY_SCALAR);
 	if (ret != 0) {
-		printf("Line %i: SSE classify failed!\n", __LINE__);
+		printf("Line %i: scalar classify failed!\n", __LINE__);
 		goto err;
 	}
 
@@ -162,6 +164,7 @@  test_classify_run(struct rte_acl_ctx *acx)
 					"(expected %"PRIu32" got %"PRIu32")!\n",
 					__LINE__, i, acl_test_data[i].allow,
 					result);
+			ret = -EINVAL;
 			goto err;
 		}
 	}
@@ -174,6 +177,7 @@  test_classify_run(struct rte_acl_ctx *acx)
 					"(expected %"PRIu32" got %"PRIu32")!\n",
 					__LINE__, i, acl_test_data[i].deny,
 					result);
+			ret = -EINVAL;
 			goto err;
 		}
 	}