From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2E8E942B43; Fri, 19 May 2023 06:30:40 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1C95242D32; Fri, 19 May 2023 06:30:40 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mails.dpdk.org (Postfix) with ESMTP id 70DE54161A; Fri, 19 May 2023 06:30:38 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D2C341FB; Thu, 18 May 2023 21:31:22 -0700 (PDT) Received: from net-arm-n1amp-02.shanghai.arm.com (net-arm-n1amp-02.shanghai.arm.com [10.169.210.108]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id AACA93F762; Thu, 18 May 2023 21:30:35 -0700 (PDT) From: Ruifeng Wang To: Anatoly Burakov Cc: dev@dpdk.org, honnappa.nagarahalli@arm.com, feifei.wang2@arm.com, nd@arm.com, Ruifeng Wang , stable@dpdk.org Subject: [PATCH 4/4] test/malloc: fix case expectation Date: Fri, 19 May 2023 12:29:23 +0800 Message-Id: <20230519042923.314670-5-ruifeng.wang@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230519042923.314670-1-ruifeng.wang@arm.com> References: <20230519042923.314670-1-ruifeng.wang@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The case expects all stats to be equal. Therefor the conditions in check should be logically or'ed. Fixes: a40a1f8231b4 ("app: various tests update") Cc: stable@dpdk.org Signed-off-by: Ruifeng Wang Reviewed-by: Feifei Wang --- app/test/test_malloc.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/app/test/test_malloc.c b/app/test/test_malloc.c index f144b89d88..ff081dd931 100644 --- a/app/test/test_malloc.c +++ b/app/test/test_malloc.c @@ -302,11 +302,11 @@ test_multi_alloc_statistics(void) rte_malloc_get_socket_stats(socket,&post_stats); /* Check statistics reported are correct */ /* All post stats should be equal to pre stats after alloc freed */ - if ((post_stats.heap_totalsz_bytes != pre_stats.heap_totalsz_bytes) && - (post_stats.heap_freesz_bytes!=pre_stats.heap_freesz_bytes) && - (post_stats.heap_allocsz_bytes!=pre_stats.heap_allocsz_bytes)&& - (post_stats.alloc_count!=pre_stats.alloc_count)&& - (post_stats.free_count!=pre_stats.free_count)) { + if ((post_stats.heap_totalsz_bytes != pre_stats.heap_totalsz_bytes) || + (post_stats.heap_freesz_bytes != pre_stats.heap_freesz_bytes) || + (post_stats.heap_allocsz_bytes != pre_stats.heap_allocsz_bytes) || + (post_stats.alloc_count != pre_stats.alloc_count) || + (post_stats.free_count != pre_stats.free_count)) { printf("Malloc statistics are incorrect - freed alloc\n"); return -1; } @@ -363,11 +363,11 @@ test_multi_alloc_statistics(void) return -1; } - if ((post_stats.heap_totalsz_bytes != pre_stats.heap_totalsz_bytes) && - (post_stats.heap_freesz_bytes!=pre_stats.heap_freesz_bytes) && - (post_stats.heap_allocsz_bytes!=pre_stats.heap_allocsz_bytes)&& - (post_stats.alloc_count!=pre_stats.alloc_count)&& - (post_stats.free_count!=pre_stats.free_count)) { + if ((post_stats.heap_totalsz_bytes != pre_stats.heap_totalsz_bytes) || + (post_stats.heap_freesz_bytes != pre_stats.heap_freesz_bytes) || + (post_stats.heap_allocsz_bytes != pre_stats.heap_allocsz_bytes) || + (post_stats.alloc_count != pre_stats.alloc_count) || + (post_stats.free_count != pre_stats.free_count)) { printf("Malloc statistics are incorrect - freed alloc\n"); return -1; } -- 2.25.1