From: Bruno Haible Date: Sun, 5 Oct 2008 14:52:15 +0000 (+0200) Subject: Tests for module 'getdtablesize'. X-Git-Tag: v0.1~6899 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=6db18f0c2c7334cc03a498296f4cd6ea67430efb;p=gnulib.git Tests for module 'getdtablesize'. --- diff --git a/ChangeLog b/ChangeLog index 2388852b1..f21c6fb69 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2008-10-05 Bruno Haible + * modules/getdtablesize-tests: New file. + * tests/test-getdtablesize.c: New file. + New module 'getdtablesize'. * lib/unistd.in.h (getdtablesize): New declaration. * lib/getdtablesize.c: New file. diff --git a/modules/getdtablesize-tests b/modules/getdtablesize-tests new file mode 100644 index 000000000..d4c4af447 --- /dev/null +++ b/modules/getdtablesize-tests @@ -0,0 +1,10 @@ +Files: +tests/test-getdtablesize.c + +Depends-on: + +configure.ac: + +Makefile.am: +TESTS += test-getdtablesize +check_PROGRAMS += test-getdtablesize diff --git a/tests/test-getdtablesize.c b/tests/test-getdtablesize.c new file mode 100644 index 000000000..db77534c5 --- /dev/null +++ b/tests/test-getdtablesize.c @@ -0,0 +1,44 @@ +/* Test of getdtablesize() function. + Copyright (C) 2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Written by Bruno Haible , 2008. */ + +#include + +#include + +#include +#include + +#define ASSERT(expr) \ + do \ + { \ + if (!(expr)) \ + { \ + fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \ + fflush (stderr); \ + abort (); \ + } \ + } \ + while (0) + +int +main (int argc, char *argv[]) +{ + ASSERT (getdtablesize () >= 3); + + return 0; +}