From patchwork Fri Apr 19 16:52:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fiona Trahe X-Patchwork-Id: 52966 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A31F51BC08; Fri, 19 Apr 2019 18:53:08 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 8AD291BC07 for ; Fri, 19 Apr 2019 18:53:07 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Apr 2019 09:53:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,370,1549958400"; d="scan'208";a="163339974" Received: from sivswdev09.ir.intel.com (HELO localhost.localdomain) ([10.237.217.48]) by fmsmga004.fm.intel.com with ESMTP; 19 Apr 2019 09:53:04 -0700 From: Fiona Trahe To: dev@dpdk.org Cc: david.marchand@redhat.com, tomaszx.jozwiak@intel.com, yskoh@mellanox.com, bruce.richardson@intel.com, thomas@monjalon.net, Fiona Trahe Date: Fri, 19 Apr 2019 17:52:48 +0100 Message-Id: <1555692768-17046-1-git-send-email-fiona.trahe@intel.com> X-Mailer: git-send-email 1.7.0.7 In-Reply-To: <1555674338-4887-1-git-send-email-tomaszx.jozwiak@intel.com> References: <1555674338-4887-1-git-send-email-tomaszx.jozwiak@intel.com> Subject: [dpdk-dev] [PATCH v3] test/compress: fix max mbuf size test case X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Fixed the compilation error: ../app/test/test_compressdev.c:1949:11: note: previous definition of 'i' was here ../app/test/test_compressdev.c:1992:2: error: 'for' loop initial declarations are only allowed in C99 mode ../app/test/test_compressdev.c:1992:2: note: use option -std=c99 or -std=gnu99 to compile your code ../app/test/test_compressdev.c:1996:19: warning: assignment from incompatible pointer type [enabled by default] Fixes: 355b02eedc65 ("test/compress: add max mbuf size test case") Signed-off-by: Tomasz Jozwiak Signed-off-by: Fiona Trahe --- v3 changes: - moved idx variable to improve code clarity and consistency with other tests v2 changes: - added compile error to commit msg app/test/test_compressdev.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/test/test_compressdev.c b/app/test/test_compressdev.c index 404b98f60..8d6dbf00d 100644 --- a/app/test/test_compressdev.c +++ b/app/test/test_compressdev.c @@ -1948,6 +1948,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 +1971,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 +1990,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;