From 96fe434470f6d967f30d6cb1c7a6431d9f51066c Mon Sep 17 00:00:00 2001
From: "Eric S. Raymond" <esr@thyrsus.com>
Date: Fri, 10 Dec 2010 06:14:43 -0500
Subject: Yet more tests ans some belated checkins.

---
 deheader         |  3 +++
 test/acos.c      | 15 +++++++++++++++
 test/acosh.c     | 15 +++++++++++++++
 test/advance.c   | 22 ++++++++++++++++++++++
 test/regress.chk | 17 ++++++++++++++++-
 5 files changed, 71 insertions(+), 1 deletion(-)
 create mode 100644 test/acos.c
 create mode 100644 test/acosh.c
 create mode 100644 test/advance.c

diff --git a/deheader b/deheader
index b669dbf..4ec85a9 100755
--- a/deheader
+++ b/deheader
@@ -43,6 +43,9 @@ requirements = map(lambda (r, h): (re.compile(r), h), (
     (r"a64l\s*\(",      "<stdlib.h>"),
     (r"l64a\s*\(",      "<stdlib.h>"),
     (r"access\s*\(",    "<unistd.h>"),
+    (r"acos\s*\(",      "<math.h>"),
+    (r"acosh\s*\(",     "<math.h>"),
+    (r"advance\s*\(",   "<regexp.h>"),
     (r"umask\s*\(",     "<sys/stat.h>|<sys/types.h>"),
     (r"<sys/socket.h>", "<sys/stat.h>|<sys/types.h>"),
     ))
diff --git a/test/acos.c b/test/acos.c
new file mode 100644
index 0000000..4360c72
--- /dev/null
+++ b/test/acos.c
@@ -0,0 +1,15 @@
+/* acos() requires <stdlib.h> */
+
+/*
+ * Items: acos(
+ * Requires: <stdlib.h>
+ * Standardized-By: SuS
+ * Not-Detected-by: gcc-4.4.3 + Linux
+ */
+
+#include <math.h>
+
+main(int arg, char **argv)
+{
+    acos(-23.0);
+}
diff --git a/test/acosh.c b/test/acosh.c
new file mode 100644
index 0000000..1e39d91
--- /dev/null
+++ b/test/acosh.c
@@ -0,0 +1,15 @@
+/* acosh() requires <stdlib.h> */
+
+/*
+ * Items: acosh(
+ * Requires: <stdlib.h>
+ * Standardized-By: SuS
+ * Not-Detected-by: gcc-4.4.3 + Linux
+ */
+
+#include <math.h>
+
+main(int arg, char **argv)
+{
+    acosh(-23.0);
+}
diff --git a/test/advance.c b/test/advance.c
new file mode 100644
index 0000000..681428d
--- /dev/null
+++ b/test/advance.c
@@ -0,0 +1,22 @@
+/* advance() requires <stdlib.h> */
+
+/*
+ * Items: advance(
+ * Requires: <stdlib.h>
+ * Standardized-By: SuS
+ * Not-Detected-by: gcc-4.4.3 + Linux
+ */
+
+#define INIT 
+#define GETC() getc()
+#define PEEKC() peek()
+#define UNGETC(c) ungetc(c)
+#define RETURN(ptr) return ptr
+#define ERROR(val) return val
+
+#include <regexp.h>
+
+main(int arg, char **argv)
+{
+    advance("foobar", 0);
+}
diff --git a/test/regress.chk b/test/regress.chk
index 8135ba7..5b70f47 100644
--- a/test/regress.chk
+++ b/test/regress.chk
@@ -16,12 +16,26 @@ deheader: test/access.c has requires <unistd.h> from access\s*\(
 deheader: test/access.c has requires <unistd.h> from access\s*\(
 deheader: test/access.c includes <unistd.h>
 deheader: test/access.c has requires <unistd.h> from access\s*\(
+deheader: test/acos.c has requires <math.h> from acos\s*\(
+deheader: test/acos.c has requires <math.h> from acos\s*\(
+deheader: test/acos.c includes <math.h>
+deheader: test/acos.c has requires <math.h> from acos\s*\(
 deheader: test/abort.c includes <stdlib.h>
+deheader: test/acosh.c has requires <math.h> from acosh\s*\(
+deheader: test/acosh.c has requires <math.h> from acosh\s*\(
+deheader: test/acosh.c includes <math.h>
+deheader: test/acosh.c has requires <math.h> from acosh\s*\(
+deheader: test/advance.c has requires <regexp.h> from advance\s*\(
+deheader: test/advance.c has requires <regexp.h> from advance\s*\(
+deheader: test/advance.c includes <regexp.h>
+deheader: test/advance.c has requires <regexp.h> from advance\s*\(
+deheader: in test/advance.c, retaining required '#include <regexp.h>\n'
 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: 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
@@ -31,4 +45,5 @@ deheader: remove <stdio.h> from test/duplicate.c
 deheader: remove <stdio.h> from test/duplicate.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: saw 8 files, 9 includes, 5 removed
+deheader: in test/acos.c, retaining required '#include <math.h>\n'
+deheader: saw 11 files, 12 includes, 5 removed
-- 
cgit v1.2.3-70-g09d2