From patchwork Thu Feb 18 02:56:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [v2] tst-mallinfo2.c: Use correct multiple for total variable X-Patchwork-Submitter: Yang Xu X-Patchwork-Id: 49279 Message-Id: <1613616993-2623-1-git-send-email-xuyang2018.jy@cn.fujitsu.com> To: Cc: Yang Xu Date: Thu, 18 Feb 2021 10:56:33 +0800 From: Yang Xu List-Id: Libc-alpha mailing list 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. Also change the ">" to ">=" so that the test is technically valid. --- malloc/tst-mallinfo2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.23.0 diff --git a/malloc/tst-mallinfo2.c b/malloc/tst-mallinfo2.c index 59a15cf7a8..7d00b65f6e 100644 --- a/malloc/tst-mallinfo2.c +++ b/malloc/tst-mallinfo2.c @@ -68,14 +68,14 @@ do_test (void) for (i = 1; i < 20; ++i) { ptr = malloc (160 * i); - total += 16 * i; + total += 160 * i; } mi2 = mallinfo2 (); print_mi ("after", &mi2); /* Check at least something changed. */ - TEST_VERIFY (mi2.uordblks > mi1.uordblks + total); + TEST_VERIFY (mi2.uordblks >= mi1.uordblks + total); return 0; }