app/bbdev: improve readability
authorKamil Chalupnik <kamilx.chalupnik@intel.com>
Wed, 9 May 2018 14:42:10 +0000 (16:42 +0200)
committerPablo de Lara <pablo.de.lara.guarch@intel.com>
Thu, 10 May 2018 16:46:20 +0000 (17:46 +0100)
Improve readability of test application by replacing
int values with rte_bbdev_event_type enum.

Signed-off-by: Kamil Chalupnik <kamilx.chalupnik@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
app/test-bbdev/test_bbdev.c

index 5d325b6..a914817 100644 (file)
@@ -895,12 +895,12 @@ test_bbdev_callback(void)
                        "Failed to callback rgstr for RTE_BBDEV_EVENT_UNKNOWN");
 
        rte_bbdev_pmd_callback_process(dev1, RTE_BBDEV_EVENT_UNKNOWN, NULL);
-       TEST_ASSERT(event_status == 0,
+       TEST_ASSERT(event_status == (int) RTE_BBDEV_EVENT_UNKNOWN,
                        "Failed test for rte_bbdev_pmd_callback_process "
                        "for RTE_BBDEV_EVENT_UNKNOWN ");
 
        rte_bbdev_pmd_callback_process(dev1, RTE_BBDEV_EVENT_ERROR, NULL);
-       TEST_ASSERT(event_status == 0,
+       TEST_ASSERT(event_status == (int) RTE_BBDEV_EVENT_UNKNOWN,
                        "Failed test for rte_bbdev_pmd_callback_process: "
                        "event RTE_BBDEV_EVENT_ERROR was not registered ");
 
@@ -919,12 +919,12 @@ test_bbdev_callback(void)
 
        event_status = -1;
        rte_bbdev_pmd_callback_process(dev1, RTE_BBDEV_EVENT_UNKNOWN, NULL);
-       TEST_ASSERT(event_status == 0,
+       TEST_ASSERT(event_status == (int) RTE_BBDEV_EVENT_UNKNOWN,
                        "Failed test for rte_bbdev_pmd_callback_process "
                        "for RTE_BBDEV_EVENT_UNKNOWN ");
 
        rte_bbdev_pmd_callback_process(dev1, RTE_BBDEV_EVENT_ERROR, NULL);
-       TEST_ASSERT(event_status == 1,
+       TEST_ASSERT(event_status == (int) RTE_BBDEV_EVENT_ERROR,
                        "Failed test for rte_bbdev_pmd_callback_process "
                        "for RTE_BBDEV_EVENT_ERROR ");
 
@@ -938,12 +938,12 @@ test_bbdev_callback(void)
 
        event_status = -1;
        rte_bbdev_pmd_callback_process(dev1, RTE_BBDEV_EVENT_UNKNOWN, NULL);
-       TEST_ASSERT(event_status == 0,
+       TEST_ASSERT(event_status == (int) RTE_BBDEV_EVENT_UNKNOWN,
                        "Failed test for rte_bbdev_pmd_callback_process "
                        "for RTE_BBDEV_EVENT_UNKNOWN ");
 
        rte_bbdev_pmd_callback_process(dev1, RTE_BBDEV_EVENT_ERROR, NULL);
-       TEST_ASSERT(event_status == 0,
+       TEST_ASSERT(event_status == (int) RTE_BBDEV_EVENT_UNKNOWN,
                        "Failed test for rte_bbdev_pmd_callback_process: "
                        "event RTE_BBDEV_EVENT_ERROR was unregistered ");
 
@@ -992,7 +992,7 @@ test_bbdev_callback(void)
                "for RTE_BBDEV_EVENT_ERROR ");
 
        rte_bbdev_pmd_callback_process(dev2, RTE_BBDEV_EVENT_ERROR, NULL);
-       TEST_ASSERT(event_status == 1,
+       TEST_ASSERT(event_status == (int) RTE_BBDEV_EVENT_ERROR,
                "Failed test for rte_bbdev_pmd_callback_process in dev2 "
                "for RTE_BBDEV_EVENT_ERROR ");
 
@@ -1006,7 +1006,7 @@ test_bbdev_callback(void)
                        "in dev 2 ");
 
        rte_bbdev_pmd_callback_process(dev2, RTE_BBDEV_EVENT_UNKNOWN, NULL);
-       TEST_ASSERT(event_status == 0,
+       TEST_ASSERT(event_status == (int) RTE_BBDEV_EVENT_UNKNOWN,
                        "Failed test for rte_bbdev_pmd_callback_process in dev2"
                        " for RTE_BBDEV_EVENT_UNKNOWN ");
 
@@ -1026,7 +1026,7 @@ test_bbdev_callback(void)
                " for RTE_BBDEV_EVENT_UNKNOWN ");
 
        rte_bbdev_pmd_callback_process(dev1, RTE_BBDEV_EVENT_UNKNOWN, NULL);
-       TEST_ASSERT(event_status == 0,
+       TEST_ASSERT(event_status == (int) RTE_BBDEV_EVENT_UNKNOWN,
                        "Failed test for rte_bbdev_pmd_callback_process in dev2 "
                        "for RTE_BBDEV_EVENT_UNKNOWN ");