summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2010-12-12 23:00:14 -0500
committerEric S. Raymond <esr@thyrsus.com>2010-12-12 23:00:14 -0500
commitf5f9ccc06e38be45a868d05bc542fab5167326f7 (patch)
treeb7f57d8409d4b9c43fe411094d9dda4e23892110
parent3f8d67f87e47be809abc3d51550388aa1cdd8a8e (diff)
downloaddeheader-f5f9ccc06e38be45a868d05bc542fab5167326f7.tar.gz
deheader-f5f9ccc06e38be45a868d05bc542fab5167326f7.tar.bz2
deheader-f5f9ccc06e38be45a868d05bc542fab5167326f7.tar.xz
deheader-f5f9ccc06e38be45a868d05bc542fab5167326f7.zip
Tests for the clock_gettime(), clock_settime(), and clock_getres() functions.
-rwxr-xr-xdeheader2
-rw-r--r--test/README4
-rw-r--r--test/clock_getres.c13
-rw-r--r--test/clock_gettime.c13
-rw-r--r--test/clock_settime.c13
-rw-r--r--test/regress.chk8
6 files changed, 49 insertions, 4 deletions
diff --git a/deheader b/deheader
index 1e63e29..7b7843e 100755
--- a/deheader
+++ b/deheader
@@ -77,7 +77,7 @@ requirements = map(lambda (r, h): (re.compile(r), h), (
(r"\Wumask\s*\(", ["<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>"]),
+ (r"<sys/socket.h>", ["<sys/stat.h>", "<sys/types.h>"]),
))
class Baton:
diff --git a/test/README b/test/README
index 1c0d9cb..e3c9ee4 100644
--- a/test/README
+++ b/test/README
@@ -2,10 +2,10 @@ This directory contains C sourcfiles intended to test deheader, and
a check against which to compare the output.
Many of these examples are takem from the Single Unix Standard's list
-of section 2 and 3 entry points. I don't explicitly test anything in
+of section 2 and 3 entry points. I don't necessarily test anything in
SuS with a structure- or pointer-to-structure type argument; that will
fail as it should on any modern compiler because the struct is neither
-defined nor the derived pointer type forward-declared with a stup. I
+defined nor the derived pointer type forward-declared with a stub. I
also ignore any header that declares only macros.
SuS things excluded by these criteria:
diff --git a/test/clock_getres.c b/test/clock_getres.c
new file mode 100644
index 0000000..e18fc4b
--- /dev/null
+++ b/test/clock_getres.c
@@ -0,0 +1,13 @@
+/*
+ * Items: clock_getres(
+ * Standardized-By: SuS
+ * Detected-by: gcc-4.4.3 + Linux
+ */
+
+#include <time.h>
+
+main(int arg, char **argv)
+{
+ struct timespec ts;
+ (void)clock_getres(0, &ts);
+}
diff --git a/test/clock_gettime.c b/test/clock_gettime.c
new file mode 100644
index 0000000..8de7e81
--- /dev/null
+++ b/test/clock_gettime.c
@@ -0,0 +1,13 @@
+/*
+ * Items: clock_gettime(
+ * Standardized-By: SuS
+ * Detected-by: gcc-4.4.3 + Linux
+ */
+
+#include <time.h>
+
+main(int arg, char **argv)
+{
+ struct timespec ts;
+ (void)clock_gettime(0, &ts);
+}
diff --git a/test/clock_settime.c b/test/clock_settime.c
new file mode 100644
index 0000000..af4d153
--- /dev/null
+++ b/test/clock_settime.c
@@ -0,0 +1,13 @@
+/*
+ * Items: clock_settime(
+ * Standardized-By: SuS
+ * Detected-by: gcc-4.4.3 + Linux
+ */
+
+#include <time.h>
+
+main(int arg, char **argv)
+{
+ struct timespec ts;
+ (void)clock_settime(0, &ts);
+}
diff --git a/test/regress.chk b/test/regress.chk
index 3b3b943..ff0646c 100644
--- a/test/regress.chk
+++ b/test/regress.chk
@@ -46,6 +46,7 @@ deheader: ./cfgetospeed.c has requires <termios.h> from \Wcfgetospeed\s*\(
deheader: ./cfgetospeed.c includes <termios.h>
deheader: ./acos.c has requires <math.h> from \Wacos\s*\(
deheader: ./acos.c includes <math.h>
+deheader: ./clock_gettime.c includes <time.h>
deheader: ./abort.c has requires <stdlib.h> from \Wabort\s*\(
deheader: ./abort.c includes <stdlib.h>
deheader: ./atanh.c has requires <math.h> from \Watanh\s*\(
@@ -80,6 +81,8 @@ deheader: ./cbrt.c includes <math.h>
deheader: ./chown.c has requires <sys/types.h>,<unistd.h> from \Wchown\s*\(
deheader: ./chown.c includes <sys/types.h>
deheader: ./chown.c includes <unistd.h>
+deheader: ./clock_settime.c includes <time.h>
+deheader: ./clock_getres.c includes <time.h>
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*\(
@@ -93,6 +96,7 @@ deheader: ./asin.c without <math.h> succeeded.
deheader: remove <math.h> from ./asin.c
deheader: in ./cbrt.c, retaining required '#include <math.h>\n'
deheader: in ./acos.c, retaining required '#include <math.h>\n'
+deheader: ./clock_gettime.c without <time.h> failed (512).
deheader: in ./catopen.c, retaining required '#include <nl_types.h>\n'
deheader: in ./brk.c, retaining required '#include <unistd.h>\n'
deheader: ./string.c without <string.h> succeeded.
@@ -106,9 +110,11 @@ deheader: in ./bsd_signal.c, retaining required '#include <signal.h>\n'
deheader: ./abs.c without <stdlib.h> succeeded.
deheader: remove <stdlib.h> from ./abs.c
deheader: in ./basename.c, retaining required '#include <libgen.h>\n'
+deheader: ./clock_getres.c without <time.h> failed (512).
deheader: in ./cfsetospeed.c, retaining required '#include <termios.h>\n'
deheader: in ./abort.c, retaining required '#include <stdlib.h>\n'
deheader: in ./atan.c, retaining required '#include <math.h>\n'
+deheader: ./clock_settime.c without <time.h> failed (512).
deheader: ./duplicate.c without <stdio.h> succeeded.
deheader: ./duplicate.c without <stdio.h> succeeded.
deheader: remove <stdio.h> from ./duplicate.c
@@ -146,4 +152,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 46 files, 50 includes, 8 removed
+deheader: saw 49 files, 53 includes, 8 removed