From: Bruno Haible Date: Wed, 26 Jan 2011 12:36:48 +0000 (+0100) Subject: Enable memory leak tests on AIX. X-Git-Tag: v0.1~3290 X-Git-Url: http://erislabs.net/gitweb/?a=commitdiff_plain;h=f92b8f0781006878574cff1eb4cbd79694739c38;p=gnulib.git Enable memory leak tests on AIX. * tests/test-dprintf-posix2.c (main): Don't skip the test on AIX. * tests/test-fprintf-posix3.c (main): Likewise. --- diff --git a/ChangeLog b/ChangeLog index 6bced9e3a..c6700ecf9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2011-01-26 Bruno Haible + Enable memory leak tests on AIX. + * tests/test-dprintf-posix2.c (main): Don't skip the test on AIX. + * tests/test-fprintf-posix3.c (main): Likewise. + +2011-01-26 Bruno Haible + Tests for module 'get-rusage-data'. * modules/get-rusage-data-tests: New file. * tests/test-get-rusage-data.c: New file. diff --git a/tests/test-dprintf-posix2.c b/tests/test-dprintf-posix2.c index 047cc16fc..5172499e4 100644 --- a/tests/test-dprintf-posix2.c +++ b/tests/test-dprintf-posix2.c @@ -55,7 +55,7 @@ main (int argc, char *argv[]) /* Limit the amount of malloc()ed memory to MAX_ALLOC_TOTAL or less. */ - /* On BSD systems, malloc() is limited by RLIMIT_DATA. */ + /* On AIX systems, malloc() is limited by RLIMIT_DATA. */ #if HAVE_GETRLIMIT && HAVE_SETRLIMIT && defined RLIMIT_DATA { struct rlimit limit; @@ -69,12 +69,14 @@ main (int argc, char *argv[]) } } #endif - /* On Linux systems, malloc() is limited by RLIMIT_AS. + /* On all systems except AIX and OpenBSD, malloc() is limited by RLIMIT_AS. On some systems, setrlimit of RLIMIT_AS doesn't work but get_rusage_as () does. Allow the address space size to grow by at most MAX_ALLOC_TOTAL. */ initial_rusage_as = get_rusage_as (); +#if !defined _AIX if (initial_rusage_as == 0) return 77; +#endif arg = atoi (argv[1]); if (arg == 0) diff --git a/tests/test-fprintf-posix3.c b/tests/test-fprintf-posix3.c index 1f13fd484..a1c3f76ce 100644 --- a/tests/test-fprintf-posix3.c +++ b/tests/test-fprintf-posix3.c @@ -54,7 +54,7 @@ main (int argc, char *argv[]) /* Limit the amount of malloc()ed memory to MAX_ALLOC_TOTAL or less. */ - /* On BSD systems, malloc() is limited by RLIMIT_DATA. */ + /* On AIX systems, malloc() is limited by RLIMIT_DATA. */ #if HAVE_GETRLIMIT && HAVE_SETRLIMIT && defined RLIMIT_DATA { struct rlimit limit; @@ -68,12 +68,14 @@ main (int argc, char *argv[]) } } #endif - /* On Linux systems, malloc() is limited by RLIMIT_AS. + /* On all systems except AIX and OpenBSD, malloc() is limited by RLIMIT_AS. On some systems, setrlimit of RLIMIT_AS doesn't work but get_rusage_as () does. Allow the address space size to grow by at most MAX_ALLOC_TOTAL. */ initial_rusage_as = get_rusage_as (); +#if !defined _AIX if (initial_rusage_as == 0) return 77; +#endif arg = atoi (argv[1]); if (arg == 0)