DPDK patches and discussions
 help / color / mirror / Atom feed
From: Volodymyr Fialko <vfialko@marvell.com>
To: <dev@dpdk.org>, Anoob Joseph <anoobj@marvell.com>,
	Volodymyr Fialko <vfialko@marvell.com>,
	Akhil Goyal <gakhil@marvell.com>
Cc: <jerinj@marvell.com>
Subject: [PATCH] test/pdcp: remove side affect from assertion
Date: Mon, 19 Jun 2023 11:04:03 +0200	[thread overview]
Message-ID: <20230619090403.3420173-1-vfialko@marvell.com> (raw)

Remove side affect from test assertion, to avoid different behaviour in
non-debug build. Issues reported by coverity scan.

Coverity issue: 385419, 385420
Fixes: 6f00462979ad ("test/pdcp: add timer expiry cases")

Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
---
 app/test/test_pdcp.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/app/test/test_pdcp.c b/app/test/test_pdcp.c
index 423526380f..6c73c1db36 100644
--- a/app/test/test_pdcp.c
+++ b/app/test/test_pdcp.c
@@ -1338,8 +1338,9 @@ test_expiry_with_event_timer(const struct pdcp_test_conf *ul_conf)
 	while (n != 1) {
 		rte_delay_us(testsuite_params.min_resolution_ns / 1000);
 		n = rte_event_dequeue_burst(testsuite_params.evdev, TEST_EV_PORT_ID, &event, 1, 0);
-		ASSERT_TRUE_OR_GOTO(nb_try-- > 0, exit,
+		ASSERT_TRUE_OR_GOTO(nb_try > 0, exit,
 				"Dequeued unexpected timer expiry event: %i\n", n);
+		nb_try--;
 	}
 
 	ASSERT_TRUE_OR_GOTO(event.event_type == RTE_EVENT_TYPE_TIMER, exit, "Unexpected event type\n");
@@ -1433,8 +1434,9 @@ test_expiry_with_rte_timer(const struct pdcp_test_conf *ul_conf)
 	while (timer_args.status != 1) {
 		rte_delay_us(1);
 		rte_timer_manage();
-		ASSERT_TRUE_OR_GOTO(nb_try-- > 0, exit, "Bad expire handle status %i\n",
+		ASSERT_TRUE_OR_GOTO(nb_try > 0, exit, "Bad expire handle status %i\n",
 			timer_args.status);
+		nb_try--;
 	}
 
 	ret = TEST_SUCCESS;
-- 
2.34.1


             reply	other threads:[~2023-06-19  9:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-19  9:04 Volodymyr Fialko [this message]
2023-06-19 10:21 ` Anoob Joseph
2023-06-20 13:29   ` Akhil Goyal

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=20230619090403.3420173-1-vfialko@marvell.com \
    --to=vfialko@marvell.com \
    --cc=anoobj@marvell.com \
    --cc=dev@dpdk.org \
    --cc=gakhil@marvell.com \
    --cc=jerinj@marvell.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).