[v6,14/14] test: use rte strerror

Message ID 20241114114000.1677350-15-huangdengdui@huawei.com (mailing list archive)
State New
Delegated to: Thomas Monjalon
Headers
Series use rte_strerror() for rte_errno |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/intel-Functional success Functional PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-marvell-Functional success Functional Testing PASS
ci/iol-unit-arm64-testing pending Testing pending
ci/iol-sample-apps-testing warning Testing issues
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-compile-amd64-testing warning Testing issues

Commit Message

Dengdui Huang Nov. 14, 2024, 11:40 a.m. UTC
The rte_errno may be an RTE-specific error code,
use rte_strerror() instead of strerror().

Signed-off-by: Dengdui Huang <huangdengdui@huawei.com>
---
 app/test/test_bpf.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
  

Patch

diff --git a/app/test/test_bpf.c b/app/test/test_bpf.c
index 90e10d7d2c..2f9412e28c 100644
--- a/app/test/test_bpf.c
+++ b/app/test/test_bpf.c
@@ -3225,7 +3225,7 @@  run_test(const struct bpf_test *tst)
 	bpf = rte_bpf_load(&tst->prm);
 	if (bpf == NULL) {
 		printf("%s@%d: failed to load bpf code, error=%d(%s);\n",
-			__func__, __LINE__, rte_errno, strerror(rte_errno));
+			__func__, __LINE__, rte_errno, rte_strerror(rte_errno));
 		return -1;
 	}
 
@@ -3321,14 +3321,14 @@  test_bpf_match(pcap_t *pcap, const char *str,
 	prm = rte_bpf_convert(&fcode);
 	if (prm == NULL) {
 		printf("%s@%d: bpf_convert('%s') failed,, error=%d(%s);\n",
-		       __func__, __LINE__, str, rte_errno, strerror(rte_errno));
+		       __func__, __LINE__, str, rte_errno, rte_strerror(rte_errno));
 		goto error;
 	}
 
 	bpf = rte_bpf_load(prm);
 	if (bpf == NULL) {
 		printf("%s@%d: failed to load bpf code, error=%d(%s);\n",
-			__func__, __LINE__, rte_errno, strerror(rte_errno));
+			__func__, __LINE__, rte_errno, rte_strerror(rte_errno));
 		goto error;
 	}
 
@@ -3444,7 +3444,7 @@  test_bpf_filter(pcap_t *pcap, const char *s)
 	prm = rte_bpf_convert(&fcode);
 	if (prm == NULL) {
 		printf("%s@%d: bpf_convert('%s') failed,, error=%d(%s);\n",
-		       __func__, __LINE__, s, rte_errno, strerror(rte_errno));
+		       __func__, __LINE__, s, rte_errno, rte_strerror(rte_errno));
 		goto error;
 	}
 
@@ -3454,7 +3454,7 @@  test_bpf_filter(pcap_t *pcap, const char *s)
 	bpf = rte_bpf_load(prm);
 	if (bpf == NULL) {
 		printf("%s@%d: failed to load bpf code, error=%d(%s);\n",
-			__func__, __LINE__, rte_errno, strerror(rte_errno));
+			__func__, __LINE__, rte_errno, rte_strerror(rte_errno));
 		goto error;
 	}