DPDK patches and discussions
 help / color / mirror / Atom feed
From: Pablo de Lara <pablo.de.lara.guarch@intel.com>
To: dev@dpdk.org
Cc: fiona.trahe@intel.com, lee.daly@intel.com,
	shally.verma@cavium.com, ahmed.mansour@nxp.com,
	Ashish.Gupta@cavium.com,
	Pablo de Lara <pablo.de.lara.guarch@intel.com>
Subject: [dpdk-dev] [PATCH v4 3/5] test/compress: add multi level test
Date: Fri,  4 May 2018 11:22:16 +0100	[thread overview]
Message-ID: <20180504102218.30672-4-pablo.de.lara.guarch@intel.com> (raw)
In-Reply-To: <20180504102218.30672-1-pablo.de.lara.guarch@intel.com>

Add test that checks if all compression levels
are supported and compress a buffer correctly.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Lee Daly <lee.daly@intel.com>
---
 test/test/test_compressdev.c | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/test/test/test_compressdev.c b/test/test/test_compressdev.c
index 629509f9b..28e2913e7 100644
--- a/test/test/test_compressdev.c
+++ b/test/test/test_compressdev.c
@@ -863,6 +863,37 @@ test_compressdev_deflate_stateless_multi_op(void)
 	return TEST_SUCCESS;
 }
 
+
+static int
+test_compressdev_deflate_stateless_multi_level(void)
+{
+	struct comp_testsuite_params *ts_params = &testsuite_params;
+	const char *test_buffer;
+	unsigned int level;
+	uint16_t i;
+	struct rte_comp_xform compress_xform;
+
+	memcpy(&compress_xform, &ts_params->def_comp_xform,
+			sizeof(struct rte_comp_xform));
+
+	for (i = 0; i < RTE_DIM(compress_test_bufs); i++) {
+		test_buffer = compress_test_bufs[i];
+		for (level = RTE_COMP_LEVEL_MIN; level <= RTE_COMP_LEVEL_MAX;
+				level++) {
+			compress_xform.compress.level = level;
+			/* Compress with compressdev, decompress with Zlib */
+			if (test_deflate_comp_decomp(&test_buffer, 1,
+					&i,
+					&compress_xform,
+					&ts_params->def_decomp_xform,
+					RTE_COMP_OP_STATELESS,
+					ZLIB_DECOMPRESS) < 0)
+				return TEST_FAILED;
+		}
+	}
+
+	return TEST_SUCCESS;
+}
 static struct unit_test_suite compressdev_testsuite  = {
 	.suite_name = "compressdev unit test suite",
 	.setup = testsuite_setup,
@@ -874,6 +905,8 @@ static struct unit_test_suite compressdev_testsuite  = {
 			test_compressdev_deflate_stateless_dynamic),
 		TEST_CASE_ST(generic_ut_setup, generic_ut_teardown,
 			test_compressdev_deflate_stateless_multi_op),
+		TEST_CASE_ST(generic_ut_setup, generic_ut_teardown,
+			test_compressdev_deflate_stateless_multi_level),
 		TEST_CASES_END() /**< NULL terminate unit test array */
 	}
 };
-- 
2.17.0

  parent reply	other threads:[~2018-05-04 10:22 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-28 14:00 [dpdk-dev] [PATCH 0/5] Initial compressdev unit tests Pablo de Lara
2018-02-28 14:00 ` [dpdk-dev] [PATCH 1/5] compressdev: add const for xform in session init Pablo de Lara
2018-02-28 14:00 ` [dpdk-dev] [PATCH 2/5] test/compress: add initial unit tests Pablo de Lara
2018-02-28 14:00 ` [dpdk-dev] [PATCH 3/5] test/compress: add multi op test Pablo de Lara
2018-02-28 14:00 ` [dpdk-dev] [PATCH 4/5] test/compress: add multi level test Pablo de Lara
2018-02-28 14:00 ` [dpdk-dev] [PATCH 5/5] test/compress: add multi session test Pablo de Lara
2018-04-08 14:00 ` [dpdk-dev] [PATCH v2 0/5] Initial compressdev unit tests Pablo de Lara
2018-04-08 14:00   ` [dpdk-dev] [PATCH v2 1/5] test/compress: add initial " Pablo de Lara
2018-04-08 14:00   ` [dpdk-dev] [PATCH v2 2/5] test/compress: add multi op test Pablo de Lara
2018-04-08 14:00   ` [dpdk-dev] [PATCH v2 3/5] test/compress: add multi level test Pablo de Lara
2018-04-08 14:00   ` [dpdk-dev] [PATCH v2 4/5] test/compress: add multi xform test Pablo de Lara
2018-04-08 14:00   ` [dpdk-dev] [PATCH v2 5/5] test/compress: add invalid configuration tests Pablo de Lara
2018-04-27 14:14 ` [dpdk-dev] [PATCH v3 0/5] Initial compressdev unit tests Pablo de Lara
2018-04-27 14:14   ` [dpdk-dev] [PATCH v3 1/5] test/compress: add initial " Pablo de Lara
2018-05-02 13:44     ` Daly, Lee
2018-05-04  8:49       ` De Lara Guarch, Pablo
2018-04-27 14:14   ` [dpdk-dev] [PATCH v3 2/5] test/compress: add multi op test Pablo de Lara
2018-04-27 14:15   ` [dpdk-dev] [PATCH v3 3/5] test/compress: add multi level test Pablo de Lara
2018-04-27 14:15   ` [dpdk-dev] [PATCH v3 4/5] test/compress: add multi xform test Pablo de Lara
2018-05-02 13:49     ` Daly, Lee
2018-04-27 14:15   ` [dpdk-dev] [PATCH v3 5/5] test/compress: add invalid configuration tests Pablo de Lara
2018-05-01 13:00   ` [dpdk-dev] [PATCH v3 0/5] Initial compressdev unit tests Daly, Lee
2018-05-04 10:22 ` [dpdk-dev] [PATCH v4 " Pablo de Lara
2018-05-04 10:22   ` [dpdk-dev] [PATCH v4 1/5] test/compress: add initial " Pablo de Lara
2018-05-14  8:29     ` Verma, Shally
2018-05-14  8:40       ` De Lara Guarch, Pablo
2018-05-04 10:22   ` [dpdk-dev] [PATCH v4 2/5] test/compress: add multi op test Pablo de Lara
2018-05-04 10:22   ` Pablo de Lara [this message]
2018-05-04 10:22   ` [dpdk-dev] [PATCH v4 4/5] test/compress: add multi xform test Pablo de Lara
2018-05-04 10:22   ` [dpdk-dev] [PATCH v4 5/5] test/compress: add invalid configuration tests Pablo de Lara
2018-05-08 15:47   ` [dpdk-dev] [PATCH v4 0/5] Initial compressdev unit tests Trahe, Fiona
2018-05-08 21:26   ` De Lara Guarch, Pablo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180504102218.30672-4-pablo.de.lara.guarch@intel.com \
    --to=pablo.de.lara.guarch@intel.com \
    --cc=Ashish.Gupta@cavium.com \
    --cc=ahmed.mansour@nxp.com \
    --cc=dev@dpdk.org \
    --cc=fiona.trahe@intel.com \
    --cc=lee.daly@intel.com \
    --cc=shally.verma@cavium.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).