diff options
author | Pádraig Brady <P@draigBrady.com> | 2011-01-21 08:47:51 +0000 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2011-01-21 11:40:16 +0000 |
commit | 76187a084bf2379a1577bf306b6742a447271a3c (patch) | |
tree | dba8d8b326a0afdb96d755a4d03db989089f08cd | |
parent | 59b2af7a94294306360f00ba99961d2874db7959 (diff) | |
download | gnulib-76187a084bf2379a1577bf306b6742a447271a3c.tar.gz |
test-malloca: unset MALLOC_PERTURB_ to speed up test
* tests/test-malloca.c (main): Unset the environment variable
to greatly speed up the test.
* tests/init.sh: Don't say that MALLOC_PERTURB_ is cheap.
* modules/malloca-tests: Depend on unsetenv.
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | modules/malloca-tests | 1 | ||||
-rw-r--r-- | tests/init.sh | 2 | ||||
-rw-r--r-- | tests/test-malloca.c | 3 |
4 files changed, 13 insertions, 1 deletions
@@ -1,5 +1,13 @@ 2011-01-21 Pádraig Brady <P@draigBrady.com> + malloca-tests: make faster by unsetting MALLOC_PERTURB_ + * tests/test-malloca.c (main): Unset the environment variable + to greatly speed up the test. + * tests/init.sh: Don't say that MALLOC_PERTURB_ is cheap. + * modules/malloca-tests: Depend on unsetenv. + +2011-01-21 Pádraig Brady <P@draigBrady.com> + ignore-value: remove stdint dependency * lib/ignore-value.h: Remove <stdint.h> * modules/ignore-value: Remove stdint dependency. diff --git a/modules/malloca-tests b/modules/malloca-tests index c473b35bfb..57cd1bce23 100644 --- a/modules/malloca-tests +++ b/modules/malloca-tests @@ -2,6 +2,7 @@ Files: tests/test-malloca.c Depends-on: +unsetenv configure.ac: diff --git a/tests/init.sh b/tests/init.sh index acb1ae541e..71c6516962 100644 --- a/tests/init.sh +++ b/tests/init.sh @@ -193,7 +193,7 @@ fi test -n "$EXEEXT" && shopt -s expand_aliases # Enable glibc's malloc-perturbing option. -# This is cheap and useful for exposing code that depends on the fact that +# This is useful for exposing code that depends on the fact that # malloc-related functions often return memory that is mostly zeroed. # If you have the time and cycles, use valgrind to do an even better job. : ${MALLOC_PERTURB_=87} diff --git a/tests/test-malloca.c b/tests/test-malloca.c index 0dce83aa66..92c86f206c 100644 --- a/tests/test-malloca.c +++ b/tests/test-malloca.c @@ -37,6 +37,9 @@ main () { int i; + /* This slows down malloc a lot. */ + unsetenv ("MALLOC_PERTURB_"); + /* Repeat a lot of times, to make sure there's no memory leak. */ for (i = 0; i < 50000; i++) { |