diff --git a/src/common/test.h b/src/common/test.h index 21e5caf..418eae1 100644 --- a/src/common/test.h +++ b/src/common/test.h @@ -11,6 +11,7 @@ extern volatile int t_status; int t_printf(const char *s, ...); int t_vmfill(void **, size_t *, int); +int t_memfill(void); void t_fdfill(void); diff --git a/src/regression/malloc-oom.c b/src/regression/malloc-oom.c index 4e40ccd..d9a1f6e 100644 --- a/src/regression/malloc-oom.c +++ b/src/regression/malloc-oom.c @@ -6,8 +6,8 @@ int main(void) { - if (t_vmfill(0,0,0) < 0) - t_error("vmfill failed: %s\n", strerror(errno)); + if (t_memfill() < 0) + t_error("memfill failed\n"); errno = 0; if (malloc(50000)) diff --git a/src/regression/pthread_create-oom.c b/src/regression/pthread_create-oom.c index e8d8169..c52a914 100644 --- a/src/regression/pthread_create-oom.c +++ b/src/regression/pthread_create-oom.c @@ -15,11 +15,8 @@ int main(void) pthread_t td; int r, arg; - r = t_vmfill(0, 0, 0); - if (r <= 0) { - t_error("fatal: vmfill has failed\n"); - return 1; - } + if (t_memfill() < 0) + t_error("memfill failed\n"); r = pthread_create(&td, 0, start, &arg); if (r == 0) t_error("pthread_create succeeded\n"); diff --git a/src/regression/setenv-oom.c b/src/regression/setenv-oom.c index d7e6162..6780310 100644 --- a/src/regression/setenv-oom.c +++ b/src/regression/setenv-oom.c @@ -1,6 +1,7 @@ // commit 543787039098c121917cb5f3e129d84b61afa61b 2013-10-04 // setenv should not crash on oom #include +#include #include #include #include "test.h" @@ -9,8 +10,8 @@ int main(void) { char buf[10000]; - if (t_vmfill(0,0,0) < 0) - t_error("vmfill failed: %s\n", strerror(errno)); + if (t_memfill() < 0) + t_error("memfill failed\n"); memset(buf, 'x', sizeof buf); buf[sizeof buf - 1] = 0;