From patchwork Wed Feb 3 05:45:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Xu X-Patchwork-Id: 1435111 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=libc-alpha-bounces@sourceware.org; receiver=) Received: from sourceware.org (unknown [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DVrHn4T7Lz9sVt for ; Wed, 3 Feb 2021 16:45:25 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id ACD8F398D005; Wed, 3 Feb 2021 05:45:23 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from heian.cn.fujitsu.com (mail.cn.fujitsu.com [183.91.158.132]) by sourceware.org (Postfix) with ESMTP id EA9FE398D005 for ; Wed, 3 Feb 2021 05:45:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org EA9FE398D005 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=cn.fujitsu.com Authentication-Results: sourceware.org; spf=none smtp.mailfrom=xuyang2018.jy@cn.fujitsu.com X-IronPort-AV: E=Sophos;i="5.79,397,1602518400"; d="scan'208";a="104132857" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 03 Feb 2021 13:45:15 +0800 Received: from G08CNEXMBPEKD04.g08.fujitsu.local (unknown [10.167.33.201]) by cn.fujitsu.com (Postfix) with ESMTP id 8F6174CE6D74 for ; Wed, 3 Feb 2021 13:45:10 +0800 (CST) Received: from localhost.localdomain (10.167.220.84) by G08CNEXMBPEKD04.g08.fujitsu.local (10.167.33.201) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 3 Feb 2021 13:45:09 +0800 From: Yang Xu To: Subject: [PATCH] tst-mallinfo2.c: Use correct multiple for total variable Date: Wed, 3 Feb 2021 13:45:00 +0800 Message-ID: <1612331100-30275-1-git-send-email-xuyang2018.jy@cn.fujitsu.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-Originating-IP: [10.167.220.84] X-ClientProxiedBy: G08CNEXCHPEKD06.g08.fujitsu.local (10.167.33.205) To G08CNEXMBPEKD04.g08.fujitsu.local (10.167.33.201) X-yoursite-MailScanner-ID: 8F6174CE6D74.AAA72 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: xuyang2018.jy@cn.fujitsu.com X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Yang Xu Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Since test uses 160 multiple for malloc size, we should also use 160 multiple for total variable instead of 16, then comparison is meaningful. So fix it. Signed-off-by: Yang Xu --- malloc/tst-mallinfo2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/malloc/tst-mallinfo2.c b/malloc/tst-mallinfo2.c index 59a15cf7a8..a2a2550931 100644 --- a/malloc/tst-mallinfo2.c +++ b/malloc/tst-mallinfo2.c @@ -68,7 +68,7 @@ do_test (void) for (i = 1; i < 20; ++i) { ptr = malloc (160 * i); - total += 16 * i; + total += 160 * i; } mi2 = mallinfo2 ();