diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2016-04-23 22:25:35 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2016-04-23 22:26:35 +0200 |
commit | 7d643a56e9aa6365c5fd1e18e4d9b8b8633fb430 (patch) | |
tree | 6902687e231a966c29721b1f73e68fc9b9f9c1c9 /tests/slow | |
parent | fd958c233a228e63eaa2d33d5aea3319c6a81643 (diff) | |
download | gnutls-7d643a56e9aa6365c5fd1e18e4d9b8b8633fb430.tar.gz |
tests: on out of memory conditions do not fail the hash-large test
This test may require a large amount of memory which some CI systems
cannot provide. When an out-of-memory-error is detected skip the test
instead of failing.
Diffstat (limited to 'tests/slow')
-rw-r--r-- | tests/slow/hash-large.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/slow/hash-large.c b/tests/slow/hash-large.c index 3a563b781a..baca0baa76 100644 --- a/tests/slow/hash-large.c +++ b/tests/slow/hash-large.c @@ -28,6 +28,14 @@ #include <gnutls/crypto.h> #include <limits.h> #include "utils.h" +#if !defined(_WIN32) +# include <signal.h> + +static void exit_77(int signo) +{ + exit(77); +} +#endif #define MIN(x,y) ((x)<(y))?(x):(y) @@ -67,6 +75,11 @@ void doit(void) if (sizeof(size) <= 4) exit(77); +#if !defined(_WIN32) + signal(SIGSEGV, exit_77); + signal(SIGBUS, exit_77); +#endif + global_init(); size = (ssize_t)UINT_MAX + (ssize_t)64*1024; |