public inbox for libc-stable@sourceware.org
 help / color / mirror / Atom feed
From: Arjun Shankar <arjun.is@lostca.se>
To: libc-stable@sourceware.org
Subject: [2.29 COMMITTED] malloc: Various cleanups for malloc/tst-mxfast
Date: Tue, 01 Jan 2019 00:00:00 -0000	[thread overview]
Message-ID: <20191118180425.GD73440@aloka.lostca.se> (raw)

(cherry picked from commit f9769a239784772453d595bc2f4bed8739810e06)
---
 ChangeLog           |  8 ++++++++
 malloc/Makefile     |  3 +--
 malloc/tst-mxfast.c | 14 +++++++-------
 3 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index cbdc566fa1..4a0af95f7a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2019-08-15  Florian Weimer  <fweimer@redhat.com>
+
+	* malloc/Makefile (tests): Only add tst-mxfast for
+	$(have-tunables).
+	* malloc/tst-mxfast.c: Fix copyright year.
+	(do_test): Fix GNU style issues.  Use TEST_COMPARE instead of
+	assert for checks.
+
 2019-08-09  DJ Delorie  <dj@redhat.com>
 
 	* elf/dl-tunables.list: Add glibc.malloc.mxfast.
diff --git a/malloc/Makefile b/malloc/Makefile
index 26947feccf..b4409aa670 100644
--- a/malloc/Makefile
+++ b/malloc/Makefile
@@ -39,7 +39,6 @@ tests := mallocbug tst-malloc tst-valloc tst-calloc tst-obstack \
 	 tst-malloc-too-large \
 	 tst-malloc-stats-cancellation \
 	 tst-tcfree1 tst-tcfree2 tst-tcfree3 \
-	 tst-mxfast \
 
 tests-static := \
 	 tst-interpose-static-nothread \
@@ -55,7 +54,7 @@ tests-internal += \
 	 tst-dynarray-at-fail \
 
 ifneq (no,$(have-tunables))
-tests += tst-malloc-usable-tunables
+tests += tst-malloc-usable-tunables tst-mxfast
 tests-static += tst-malloc-usable-static-tunables
 endif
 
diff --git a/malloc/tst-mxfast.c b/malloc/tst-mxfast.c
index 7a371d2f9d..7a7750bc71 100644
--- a/malloc/tst-mxfast.c
+++ b/malloc/tst-mxfast.c
@@ -1,5 +1,5 @@
 /* Test that glibc.malloc.mxfast tunable works.
-   Copyright (C) 2018, 2019 Free Software Foundation, Inc.
+   Copyright (C) 2019 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -21,14 +21,14 @@
    the fast bins.  */
 
 #include <malloc.h>
-#include <assert.h>
+#include <support/check.h>
 
 int
-do_test(void)
+do_test (void)
 {
   struct mallinfo m;
-  char * volatile p1;
-  char * volatile p2;
+  char *volatile p1;
+  char *volatile p2;
 
   /* Arbitrary value; must be in default fastbin range.  */
   p1 = malloc (3);
@@ -36,10 +36,10 @@ do_test(void)
   p2 = malloc (512);
   free (p1);
 
-  m = mallinfo();
+  m = mallinfo ();
 
   /* This will fail if there are any blocks in the fastbins.  */
-  assert (m.smblks == 0);
+  TEST_COMPARE (m.smblks, 0);
 
   /* To keep gcc happy.  */
   free (p2);
-- 
2.21.0


                 reply	other threads:[~2019-11-18 18:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191118180425.GD73440@aloka.lostca.se \
    --to=arjun.is@lostca.se \
    --cc=libc-stable@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).