From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 36FD7377C for ; Fri, 7 Oct 2016 00:33:41 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP; 06 Oct 2016 15:33:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,454,1473145200"; d="scan'208";a="887513382" Received: from sie-lab-214-036.ir.intel.com (HELO silpixa00394365.ir.intel.com) ([10.237.214.36]) by orsmga003.jf.intel.com with ESMTP; 06 Oct 2016 15:33:39 -0700 From: Pablo de Lara To: dev@dpdk.org Cc: bruce.richardson@intel.com, Pablo de Lara Date: Thu, 6 Oct 2016 23:34:50 +0100 Message-Id: <1475793290-185602-1-git-send-email-pablo.de.lara.guarch@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dpdk-dev] [PATCH] test: fix hash multiwriter test X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Oct 2016 22:33:41 -0000 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 --- 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