Mercurial > hg > octave-lojdl > gnulib-hg
comparison tests/test-ptsname_r.c @ 17367:639f60219717
tests: make it easier to bypass alarm time in debugger
While auditing alarm usage, I noticed that test-regex had a nice
idiom that made it easier to disable an alarm under glibc. Use
it elsewhere, so future copy-and-paste will preserve the idiom.
* tests/test-file-has-acl.c (main): Allow gdb to override alarm.
* tests/test-memmem.c (main): Likewise.
* tests/test-passfd.c (main): Likewise.
* tests/test-ptsname.c (main): Likewise.
* tests/test-ptsname_r.c (main): Likewise.
* tests/test-strcasestr.c (main): Likewise.
* tests/test-strstr.c (main): Likewise.
Signed-off-by: Eric Blake <eblake@redhat.com>
author | Eric Blake <eblake@redhat.com> |
---|---|
date | Mon, 11 Mar 2013 15:40:32 -0600 |
parents | e542fd46ad6f |
children |
comparison
equal
deleted
inserted
replaced
17366:9855b352e525 | 17367:639f60219717 |
---|---|
102 main (void) | 102 main (void) |
103 { | 103 { |
104 #if HAVE_DECL_ALARM | 104 #if HAVE_DECL_ALARM |
105 /* Declare failure if test takes too long, by using default abort | 105 /* Declare failure if test takes too long, by using default abort |
106 caused by SIGALRM. */ | 106 caused by SIGALRM. */ |
107 int alarm_value = 5; | |
107 signal (SIGALRM, SIG_DFL); | 108 signal (SIGALRM, SIG_DFL); |
108 alarm (5); | 109 alarm (alarm_value); |
109 #endif | 110 #endif |
110 | 111 |
111 { | 112 { |
112 char buffer[256]; | 113 char buffer[256]; |
113 int result; | 114 int result; |