summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2010-12-10 08:34:07 -0500
committerEric S. Raymond <esr@thyrsus.com>2010-12-10 08:34:07 -0500
commit0d7637fcf8c841de0d2837cbf5de3078c5ff02c1 (patch)
tree07ba924ce7cdbb7ae59b4225a6d1af790a24f7e8
parent935879b3002c31d18933f4cad15f93bae5a948ea (diff)
downloaddeheader-0d7637fcf8c841de0d2837cbf5de3078c5ff02c1.tar.gz
deheader-0d7637fcf8c841de0d2837cbf5de3078c5ff02c1.tar.bz2
deheader-0d7637fcf8c841de0d2837cbf5de3078c5ff02c1.tar.xz
deheader-0d7637fcf8c841de0d2837cbf5de3078c5ff02c1.zip
Tests for alarm(), asin(), asinh().
-rw-r--r--test/README11
-rw-r--r--test/alarm.c15
-rw-r--r--test/asin.c15
-rw-r--r--test/asinh.c15
-rw-r--r--test/regress.chk19
5 files changed, 70 insertions, 5 deletions
diff --git a/test/README b/test/README
index 5eb212e..989d61c 100644
--- a/test/README
+++ b/test/README
@@ -1,2 +1,13 @@
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
+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.
+
+SuS things excluded by this criterion:
+
+aio.h - aio_* entry points for asynchronous input and output
+time.h - asctime() and asctime_r()
diff --git a/test/alarm.c b/test/alarm.c
new file mode 100644
index 0000000..4452b58
--- /dev/null
+++ b/test/alarm.c
@@ -0,0 +1,15 @@
+/* alarm() requires <unistd.h> */
+
+/*
+ * Items: alarm(
+ * Requires: <unistd.h>
+ * Standardized-By: SuS
+ * Detected-by: gcc-4.4.3 + Linux
+ */
+
+#include <unistd.h>
+
+main(int arg, char **argv)
+{
+ alarm(23);
+}
diff --git a/test/asin.c b/test/asin.c
new file mode 100644
index 0000000..f102999
--- /dev/null
+++ b/test/asin.c
@@ -0,0 +1,15 @@
+/* asin() requires <stdlib.h> */
+
+/*
+ * Items: asin(
+ * Requires: <stdlib.h>
+ * Standardized-By: SuS
+ * Not-Detected-by: gcc-4.4.3 + Linux
+ */
+
+#include <math.h>
+
+main(int arg, char **argv)
+{
+ asin(-23.0);
+}
diff --git a/test/asinh.c b/test/asinh.c
new file mode 100644
index 0000000..8b9151e
--- /dev/null
+++ b/test/asinh.c
@@ -0,0 +1,15 @@
+/* asinh() requires <stdlib.h> */
+
+/*
+ * Items: asinh(
+ * Requires: <stdlib.h>
+ * Standardized-By: SuS
+ * Not-Detected-by: gcc-4.4.3 + Linux
+ */
+
+#include <math.h>
+
+main(int arg, char **argv)
+{
+ asinh(-23.0);
+}
diff --git a/test/regress.chk b/test/regress.chk
index ef6a689..5c12e5d 100644
--- a/test/regress.chk
+++ b/test/regress.chk
@@ -2,6 +2,7 @@ deheader: test/string.c includes <string.h>
deheader: test/duplicate.c includes <stdio.h>
deheader: test/duplicate.c includes <stdio.h>
deheader: test/duplicate.c has more than one inclusion of <stdio.h>
+deheader: test/asinh.c includes <math.h>
deheader: test/umask.c includes <sys/stat.h>
deheader: test/umask.c includes <sys/types.h>
deheader: test/umask.c has requires <sys/stat.h>|<sys/types.h> from umask\s*\(
@@ -10,28 +11,36 @@ deheader: test/a64l.c includes <stdlib.h>
deheader: test/abs.c includes <stdlib.h>
deheader: test/access.c has requires <unistd.h> from access\s*\(
deheader: test/access.c includes <unistd.h>
+deheader: test/alarm.c includes <unistd.h>
deheader: test/acos.c has requires <math.h> from acos\s*\(
deheader: test/acos.c includes <math.h>
deheader: test/abort.c includes <stdlib.h>
deheader: test/acosh.c has requires <math.h> from acosh\s*\(
deheader: test/acosh.c includes <math.h>
+deheader: test/asin.c includes <math.h>
deheader: test/advance.c has requires <regexp.h> from advance\s*\(
deheader: test/advance.c includes <regexp.h>
deheader: in test/advance.c, retaining required '#include <regexp.h>\n'
+deheader: test/asin.c without <math.h> succeeded.
+deheader: remove <math.h> from test/asin.c
deheader: test/string.c without <string.h> succeeded.
deheader: remove <string.h> from test/string.c
deheader: test/abs.c without <stdlib.h> succeeded.
deheader: remove <stdlib.h> from test/abs.c
+deheader: test/duplicate.c without <stdio.h> succeeded.
+deheader: test/duplicate.c without <stdio.h> succeeded.
+deheader: remove <stdio.h> from test/duplicate.c
+deheader: remove <stdio.h> from test/duplicate.c
deheader: in test/access.c, retaining required '#include <unistd.h>\n'
deheader: in test/acosh.c, retaining required '#include <math.h>\n'
deheader: in test/a64l.c, retaining required '#include <stdlib.h>\n'
deheader: test/abort.c without <stdlib.h> succeeded.
deheader: remove <stdlib.h> from test/abort.c
-deheader: test/duplicate.c without <stdio.h> succeeded.
-deheader: test/duplicate.c without <stdio.h> succeeded.
-deheader: remove <stdio.h> from test/duplicate.c
-deheader: remove <stdio.h> from test/duplicate.c
+deheader: test/asinh.c without <math.h> succeeded.
+deheader: remove <math.h> from test/asinh.c
deheader: in test/umask.c, retaining required '#include <sys/types.h>\n'
deheader: in test/umask.c, retaining required '#include <sys/stat.h>\n'
deheader: in test/acos.c, retaining required '#include <math.h>\n'
-deheader: saw 11 files, 12 includes, 5 removed
+deheader: test/alarm.c without <unistd.h> succeeded.
+deheader: remove <unistd.h> from test/alarm.c
+deheader: saw 14 files, 15 includes, 8 removed