net: be more restrictive with ethernet address format
[dpdk.git] / app / test / test_compressdev.c
index 404b98f..65889c2 100644 (file)
@@ -5,6 +5,7 @@
 #include <zlib.h>
 #include <math.h>
 #include <stdlib.h>
+#include <unistd.h>
 
 #include <rte_cycles.h>
 #include <rte_malloc.h>
@@ -133,8 +134,8 @@ testsuite_setup(void)
        unsigned int i;
 
        if (rte_compressdev_count() == 0) {
-               RTE_LOG(ERR, USER1, "Need at least one compress device\n");
-               return TEST_FAILED;
+               RTE_LOG(WARNING, USER1, "Need at least one compress device\n");
+               return TEST_SKIPPED;
        }
 
        RTE_LOG(NOTICE, USER1, "Running tests on device %s\n",
@@ -1869,7 +1870,7 @@ test_compressdev_out_of_space_buffer(void)
        uint16_t i;
        const struct rte_compressdev_capabilities *capab;
 
-       RTE_LOG(INFO, USER1, "This is a negative test errors are expected\n");
+       RTE_LOG(ERR, USER1, "This is a negative test errors are expected\n");
 
        capab = rte_compressdev_capability_get(0, RTE_COMP_ALGO_DEFLATE);
        TEST_ASSERT(capab != NULL, "Failed to retrieve device capabilities");
@@ -1900,7 +1901,7 @@ test_compressdev_out_of_space_buffer(void)
                RTE_COMP_OP_STATELESS,
                LB_BOTH,
                ZLIB_DECOMPRESS,
-               1,
+               1,  /* run out-of-space test */
                0
        };
        /* Compress with compressdev, decompress with Zlib */
@@ -1948,6 +1949,7 @@ test_compressdev_deflate_stateless_dynamic_big(void)
        struct comp_testsuite_params *ts_params = &testsuite_params;
        uint16_t i = 0;
        int ret = TEST_SUCCESS;
+       int j;
        const struct rte_compressdev_capabilities *capab;
        char *test_buffer = NULL;
 
@@ -1970,7 +1972,7 @@ test_compressdev_deflate_stateless_dynamic_big(void)
        struct interim_data_params int_data = {
                (const char * const *)&test_buffer,
                1,
-               NULL,
+               &i,
                &ts_params->def_comp_xform,
                &ts_params->def_decomp_xform,
                1
@@ -1989,11 +1991,9 @@ test_compressdev_deflate_stateless_dynamic_big(void)
 
        /* fill the buffer with data based on rand. data */
        srand(BIG_DATA_TEST_SIZE);
-       for (uint32_t i = 0; i < BIG_DATA_TEST_SIZE - 1; ++i)
-               test_buffer[i] = (uint8_t)(rand() % ((uint8_t)-1)) | 1;
-
+       for (j = 0; j < BIG_DATA_TEST_SIZE - 1; ++j)
+               test_buffer[j] = (uint8_t)(rand() % ((uint8_t)-1)) | 1;
        test_buffer[BIG_DATA_TEST_SIZE-1] = 0;
-       int_data.buf_idx = &i;
 
        /* Compress with compressdev, decompress with Zlib */
        test_data.zlib_dir = ZLIB_DECOMPRESS;