From: Eric Blake Date: Fri, 4 Jan 2008 22:19:34 +0000 (-0700) Subject: Shorten duration of memmem test. X-Git-Tag: v0.1~7884 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=64181a34277230d9743b679cdc6c18a8b7b0d48c;p=gnulib.git Shorten duration of memmem test. * tests/test-memmem.c (main): Use alarm to declare failure if test is taking too long. Reported by Ralf Wildenhues. Signed-off-by: Eric Blake --- diff --git a/ChangeLog b/ChangeLog index 1bba77470..f4a48b7e0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,10 +1,17 @@ +2008-01-04 Eric Blake + + Shorten duration of memmem test. + * tests/test-memmem.c (main): Use alarm to declare failure if test + is taking too long. + Reported by Ralf Wildenhues. + 2007-12-21 Simon Josefsson * modules/relocatable-prog-wrapper (Depends-on): Add intprops and string, needed by strerror. 2008-01-03 Colin Watson - Bruno Haible + Bruno Haible * doc/gnulib-tool.texi (Localization): New section. @@ -113,7 +120,7 @@ Suggested by Ben Pfaff . 2007-12-25 Paul Eggert - Bruno Haible + Bruno Haible Avoid using the syntax symbol() in formatted documentation. * MODULES.html.sh (func_module): When replacing symbol() with a @@ -37242,6 +37249,6 @@ * m4/uintmax_t.m4: New file. * m4/Makefile.am (EXTRA_DIST): Add inttypes_h.m4 and uintmax_t.m4. -Copyright (C) 1997-2007 Free Software Foundation, Inc. +Copyright (C) 1997-2008 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted provided the copyright notice and this notice are preserved. diff --git a/tests/test-memmem.c b/tests/test-memmem.c index 50fdfb81e..df3baef89 100644 --- a/tests/test-memmem.c +++ b/tests/test-memmem.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004, 2007 Free Software Foundation + * Copyright (C) 2004, 2007, 2008 Free Software Foundation * Written by Bruno Haible and Eric Blake * * This program is free software: you can redistribute it and/or modify @@ -21,6 +21,7 @@ #include #include +#include #define ASSERT(expr) \ do \ @@ -36,6 +37,9 @@ int main (int argc, char *argv[]) { + /* Declare failure if test takes too long, by using default abort + caused by SIGALRM. */ + alarm (10); { const char input[] = "foo"; const char *result = memmem (input, strlen (input), "", 0);