DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] test: fix hash multiwriter test
@ 2016-10-06 22:34 Pablo de Lara
  2016-10-13 13:00 ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: Pablo de Lara @ 2016-10-06 22:34 UTC (permalink / raw)
  To: dev; +Cc: bruce.richardson, Pablo de Lara

Hash multiwriter test consists of two subtests.
If the any of the subtests fails, the overall test should fail,
but the overall test only passed if the second subtest passed,
because the return of the first subtest was being overwritten.

Fixes: be856325cba3 ("hash: add scalable multi-writer insertion with Intel TSX")

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
 app/test/test_hash_multiwriter.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/app/test/test_hash_multiwriter.c b/app/test/test_hash_multiwriter.c
index 40af95d..4dcbd9d 100644
--- a/app/test/test_hash_multiwriter.c
+++ b/app/test/test_hash_multiwriter.c
@@ -247,8 +247,6 @@ err1:
 static int
 test_hash_multiwriter_main(void)
 {
-	int r = -1;
-
 	if (rte_lcore_count() == 1) {
 		printf("More than one lcore is required to do multiwriter test\n");
 		return 0;
@@ -268,14 +266,16 @@ test_hash_multiwriter_main(void)
 		printf("Test multi-writer with Hardware transactional memory\n");
 
 		use_htm = 1;
-		r = test_hash_multiwriter();
+		if (test_hash_multiwriter() < 0)
+			return -1;
 	}
 
 	printf("Test multi-writer without Hardware transactional memory\n");
 	use_htm = 0;
-	r = test_hash_multiwriter();
+	if (test_hash_multiwriter() < 0)
+		return -1;
 
-	return r;
+	return 0;
 }
 
 REGISTER_TEST_COMMAND(hash_multiwriter_autotest, test_hash_multiwriter_main);
-- 
2.7.4

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH] test: fix hash multiwriter test
  2016-10-06 22:34 [dpdk-dev] [PATCH] test: fix hash multiwriter test Pablo de Lara
@ 2016-10-13 13:00 ` Thomas Monjalon
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Monjalon @ 2016-10-13 13:00 UTC (permalink / raw)
  To: Pablo de Lara; +Cc: dev, bruce.richardson

2016-10-06 23:34, Pablo de Lara:
> Hash multiwriter test consists of two subtests.
> If the any of the subtests fails, the overall test should fail,
> but the overall test only passed if the second subtest passed,
> because the return of the first subtest was being overwritten.
> 
> Fixes: be856325cba3 ("hash: add scalable multi-writer insertion with Intel TSX")
> 
> Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

Applied, thanks

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-10-13 13:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-06 22:34 [dpdk-dev] [PATCH] test: fix hash multiwriter test Pablo de Lara
2016-10-13 13:00 ` Thomas Monjalon

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).