]> git.ipfire.org Git - thirdparty/libbsd.git/commitdiff
test: Add new overlay unit test
authorGuillem Jover <guillem@hadrons.org>
Sat, 24 Mar 2012 19:37:55 +0000 (20:37 +0100)
committerGuillem Jover <guillem@hadrons.org>
Tue, 29 May 2012 02:51:04 +0000 (04:51 +0200)
test/.gitignore
test/Makefile.am
test/overlay.c [new file with mode: 0644]

index 4237ec7c1e1efeac051e5bbdc30f245c078f5115..ecfa21858d820ffba783bef2cf46dc1441c3cb64 100644 (file)
@@ -1 +1,2 @@
 headers
+overlay
index 30749c21bdfb5c955233dd20703e2d9ddfa1f8a1..03ecb58acff02d507d79f182406059caad6a18d6 100644 (file)
@@ -12,6 +12,7 @@ AM_CPPFLAGS = \
 
 check_PROGRAMS = \
        headers \
+       overlay \
        $(nil)
 
 TESTS = $(check_PROGRAMS)
diff --git a/test/overlay.c b/test/overlay.c
new file mode 100644 (file)
index 0000000..f748f1b
--- /dev/null
@@ -0,0 +1,23 @@
+/* Include system headers that are “known” to pull bits selectively from
+ * other headers through magic macros, to check that the overlay is working
+ * properly. */
+#include <errno.h>
+#include <grp.h>
+#include <stdint.h>
+
+/* Include libbsd overlayed headers that might get partially included. */
+#include <sys/cdefs.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+int
+main()
+{
+       /* Test that we do not get partial definitions. */
+       fflush(stdout);
+
+       return 0;
+}