DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Lukas Sismis <sismis@dyna-nic.com>
Cc: dev@dpdk.org
Subject: Re: [PATCH v2 4/7] test: add flow parser unit tests
Date: Tue, 6 Jan 2026 10:04:54 -0800	[thread overview]
Message-ID: <20260106100454.58ec550c@phoenix.local> (raw)
In-Reply-To: <20260106153838.398033-5-sismis@dyna-nic.com>

On Tue,  6 Jan 2026 16:38:34 +0100
Lukas Sismis <sismis@dyna-nic.com> wrote:

> +static int
> +test_flow_parser_command_mapping(void)
> +{
> +	static const char *create_cmd =
> +		"flow create 0 ingress pattern eth / end "
> +		"actions drop / end";
> +	static const char *list_cmd = "flow list 0";
> +	uint8_t outbuf[4096];
> +	struct rte_flow_parser_output *out = (void *)outbuf;
> +	int ret;
> +
> +	ret = rte_flow_parser_init(NULL);
> +	if (ret != 0)
> +		return TEST_FAILED;

Why not:
	TEST_ASSERT(rte_flow_parser_init(NULL) == 0, "rte_flow_parser_init failed");

> +
> +	/* Test flow create command parsing */
> +	memset(outbuf, 0, sizeof(outbuf));

Don't think you need to pre-zero the result buffer.

> +	ret = rte_flow_parser_parse(create_cmd, out, sizeof(outbuf));
> +	if (ret != 0) {
> +		printf("flow create parse failed: %d\n", ret);
> +		return TEST_FAILED;
> +	}

	TEST_ASSERT(ret == 0, "flow create parse failed: %s\n", strerror(-ret));

Or do you want to use rte_errno for error code?

  reply	other threads:[~2026-01-06 18:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-06 15:38 [RFC PATCH v2 0/7] flow_parser: add shared parser library Lukas Sismis
2026-01-06 15:38 ` [PATCH v2 1/7] " Lukas Sismis
2026-01-06 15:38 ` [PATCH v2 2/7] app/testpmd: integrate shared flow " Lukas Sismis
2026-01-06 15:38 ` [PATCH v2 3/7] examples/flow_parsing: add flow parser demo Lukas Sismis
2026-01-06 15:38 ` [PATCH v2 4/7] test: add flow parser unit tests Lukas Sismis
2026-01-06 18:04   ` Stephen Hemminger [this message]
2026-01-06 18:07   ` Stephen Hemminger
2026-01-06 15:38 ` [PATCH v2 5/7] doc: add flow parser library maintainers Lukas Sismis
2026-01-06 15:38 ` [PATCH v2 6/7] dts: fix invalid f-string syntax in testpmd API Lukas Sismis
2026-01-06 15:38 ` [PATCH v2 7/7] cmdline: include stddef.h before defining offsetof Lukas Sismis

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=20260106100454.58ec550c@phoenix.local \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=sismis@dyna-nic.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).