In the runtest() function, it will return error if the test return
value is less than 0.

But the 'copy' and 'error_handling' testcase may return 1 if failed
because its internal use or(||) operation.

This commit fix it by treating non-zero as error in runtest() function.

Fixes: 1b86a66a30c2 ("test/dma: add more comprehensive copy tests")
Fixes: 99d7ec4be237 ("test/dma: add failure handling tests")
Cc: sta...@dpdk.org

Signed-off-by: Chengwen Feng <fengcheng...@huawei.com>
---
 app/test/test_dmadev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test/test_dmadev.c b/app/test/test_dmadev.c
index 9cbb9a6552..482d564f7a 100644
--- a/app/test/test_dmadev.c
+++ b/app/test/test_dmadev.c
@@ -92,7 +92,7 @@ runtest(const void *args)
        printf("DMA Dev %d: Running %s Tests %s\n", dev_id, printable,
                        check_err_stats ? " " : "(errors expected)");
        for (i = 0; i < iterations; i++) {
-               if (test_fn(dev_id, vchan) < 0)
+               if (test_fn(dev_id, vchan) != 0)
                        return -1;
 
                rte_dma_stats_get(dev_id, 0, &stats);
-- 
2.17.1

Reply via email to