]> sourceware.org Git - glibc.git/commitdiff
malloc: Various cleanups for malloc/tst-mxfast
authorFlorian Weimer <fweimer@redhat.com>
Thu, 15 Aug 2019 09:37:18 +0000 (11:37 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Thu, 15 Aug 2019 09:37:18 +0000 (11:37 +0200)
ChangeLog
malloc/Makefile
malloc/tst-mxfast.c

index 3a2ec67c92339d7b909036fb6b38c4eef09c8748..05cc2be530312c0e3486477de21b4cbfebc1ce41 100644 (file)
--- 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-15  Florian Weimer  <fweimer@redhat.com>
 
        * login/utmp_file.c (__libc_updwtmp): Unlock the right file
index 94b74b5c45a5cdc35ed4622d8dda6f1e528ae675..742c515eb2fc82410f70c0d02241649f16c34791 100644 (file)
@@ -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
 
index 7a371d2f9d2f00058dc53efc031010b16e34f453..7a7750bc71024bfb37975b8ae916fc429108face 100644 (file)
@@ -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
    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);
This page took 0.073182 seconds and 5 git commands to generate.