diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2010-12-12 23:30:25 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2010-12-12 23:30:25 -0500 |
commit | e177e3758fd45a12824761f1f76a6cacf64605a4 (patch) | |
tree | 5fa86b6cc6ccbb229618b69ebb33cc1c8e02d45a | |
parent | f5f9ccc06e38be45a868d05bc542fab5167326f7 (diff) | |
download | deheader-e177e3758fd45a12824761f1f76a6cacf64605a4.tar.gz deheader-e177e3758fd45a12824761f1f76a6cacf64605a4.tar.bz2 deheader-e177e3758fd45a12824761f1f76a6cacf64605a4.tar.xz deheader-e177e3758fd45a12824761f1f76a6cacf64605a4.zip |
Tests for close() and closedir(), and new header dependencies.
-rwxr-xr-x | deheader | 7 | ||||
-rw-r--r-- | test/README | 10 | ||||
-rw-r--r-- | test/close.c | 12 | ||||
-rw-r--r-- | test/closedir.c | 13 | ||||
-rw-r--r-- | test/regress.chk | 8 |
5 files changed, 46 insertions, 4 deletions
@@ -74,7 +74,14 @@ requirements = map(lambda (r, h): (re.compile(r), h), ( (r"\Wchown\s*\(", ["<sys/types.h>", "<unistd.h>"]), (r"\Wchroot\s*\(", ["<unistd.h>"]), (r"\Wclock\s*\(", ["<time.h>"]), + (r"\Wclose\s*\(", ["<unistd.h>"]), + (r"\Wconfstr\s*\(", ["<unistd.h>"]), + (r"\Wcos\s*\(", ["<math.h>"]), + (r"\Wcosh\s*\(", ["<math.h>"]), (r"\Wumask\s*\(", ["<sys/stat.h>", "<sys/types.h>"]), + # Header dependencies implies by SuS + (r"<dirent.h>", ["<sys/types.h>"]), + (r"<fcntl.h>", ["<sys/stat.h>", "<sys/types.h>"]), # Dependencies observed on systems other than the Linux this was # developed under. (r"<sys/socket.h>", ["<sys/stat.h>", "<sys/types.h>"]), diff --git a/test/README b/test/README index e3c9ee4..7a73e20 100644 --- a/test/README +++ b/test/README @@ -10,6 +10,10 @@ also ignore any header that declares only macros. SuS things excluded by these criteria: -aio.h - aio_* entry points for asynchronous input and output -time.h - asctime() and asctime_r() -assert.h - assert() macro +aio.h - aio_* entry points for asynchronous input and output +time.h - asctime() and asctime_r() +assert.h - assert() macro +syslog.h - closelog(), openlog(), setlogmask(), syslog() +rexgexp.h - advance() is tested, compile() is not. +unistd.h - confstr() is not tested. +math.h - cos(), cosh(): these will need <math.h>. diff --git a/test/close.c b/test/close.c new file mode 100644 index 0000000..207b8ba --- /dev/null +++ b/test/close.c @@ -0,0 +1,12 @@ +/* + * Items: close( + * Standardized-By: SuS + * Not-Detected-by: gcc-4.4.3 + Linux + */ + +#include <unistd.h> + +main(int arg, char **argv) +{ + (void)close(0); +} diff --git a/test/closedir.c b/test/closedir.c new file mode 100644 index 0000000..868df8b --- /dev/null +++ b/test/closedir.c @@ -0,0 +1,13 @@ +/* + * Items: closedir( + * Standardized-By: SuS + * Detected-by: gcc-4.4.3 + Linux + */ + +#include <sys/types.h> +#include <dirent.h> + +main(int arg, char **argv) +{ + (void)closedir(NULL); +} diff --git a/test/regress.chk b/test/regress.chk index ff0646c..2e743c5 100644 --- a/test/regress.chk +++ b/test/regress.chk @@ -10,6 +10,9 @@ deheader: ./duplicate.c includes <stdio.h> deheader: ./duplicate.c has more than one inclusion of <stdio.h> deheader: ./brk.c has requires <unistd.h> from \Wbrk\s*\( deheader: ./brk.c includes <unistd.h> +deheader: ./closedir.c includes <sys/types.h> +deheader: ./closedir.c includes <dirent.h> +deheader: ./closedir.c has requires <sys/types.h> from <dirent.h> deheader: ./asinh.c includes <math.h> deheader: ./atol.c has requires <stdlib.h> from \Wl64a\s*\( deheader: ./atol.c includes <stdlib.h> @@ -87,6 +90,8 @@ deheader: ./advance.c has requires <regexp.h> from \Wadvance\s*\( deheader: ./advance.c includes <regexp.h> deheader: ./catopen.c has requires <nl_types.h> from \Wcatopen\s*\( deheader: ./catopen.c includes <nl_types.h> +deheader: ./close.c has requires <unistd.h> from \Wclose\s*\( +deheader: ./close.c includes <unistd.h> deheader: ./atan2.c has requires <math.h> from \Watan2\s*\( deheader: ./atan2.c includes <math.h> deheader: ./catclose.c has requires <nl_types.h> from \Wcatclose\s*\( @@ -122,6 +127,7 @@ deheader: remove <stdio.h> from ./duplicate.c deheader: in ./chdir.c, retaining required '#include <unistd.h>\n' deheader: in ./chroot.c, retaining required '#include <unistd.h>\n' deheader: in ./atanh.c, retaining required '#include <math.h>\n' +deheader: in ./close.c, retaining required '#include <unistd.h>\n' deheader: ./bcopy.c without <string.h> failed (512). deheader: in ./cfsetispeed.c, retaining required '#include <termios.h>\n' deheader: in ./atol.c, retaining required '#include <stdlib.h>\n' @@ -152,4 +158,4 @@ deheader: in ./chown.c, retaining required '#include <unistd.h>\n' deheader: in ./chown.c, retaining required '#include <sys/types.h>\n' deheader: in ./advance.c, retaining required '#include <regexp.h>\n' deheader: ./clearerr.c without <stdio.h> failed (512). -deheader: saw 49 files, 53 includes, 8 removed +deheader: saw 51 files, 56 includes, 8 removed |