OSDN Git Service

test: add utmpx test
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Sun, 22 Mar 2015 13:47:29 +0000 (14:47 +0100)
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Sun, 22 Mar 2015 13:49:27 +0000 (14:49 +0100)
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
test/.gitignore
test/misc/Makefile.in
test/misc/tst-utmp.c
test/misc/tst-utmpx.c [new file with mode: 0644]

index 5944f0a..beb5095 100644 (file)
@@ -163,6 +163,7 @@ misc/tst-seekdir
 misc/tst-statfs
 misc/tst-statvfs
 misc/tst-utmp
+misc/tst-utmpx
 mmap/mmap
 mmap/mmap2
 mmap/mmap64
index 1e0da6f..2fb9652 100644 (file)
@@ -16,6 +16,10 @@ ifeq ($(UCLIBC_HAS_GLOB),)
 TESTS_DISABLED += bug-glob2
 endif
 
+ifeq ($(UCLIBC_HAS_UTMPX),)
+TESTS_DISABLED += tst-utmpx
+endif
+
 DODIFF_dirent    := 1
 DODIFF_dirent64  := 1
 DODIFF_tst-statfs := 1
index 08a6f8e..1b0333a 100644 (file)
 # include <utmp.h>
 #endif
 
+#ifndef _HAVE_UT_TYPE
+# define _HAVE_UT_TYPE 0
+#endif
+#ifndef _HAVE_UT_PID
+# define _HAVE_UT_PID 0
+#endif
+#ifndef _HAVE_UT_ID
+# define _HAVE_UT_ID 0
+#endif
+#ifndef _HAVE_UT_TV
+# define _HAVE_UT_TV 0
+#endif
+#ifndef _HAVE_UT_HOST
+# define _HAVE_UT_HOST 0
+#endif
 
 #if _HAVE_UT_TYPE || defined UTMPX
 
diff --git a/test/misc/tst-utmpx.c b/test/misc/tst-utmpx.c
new file mode 100644 (file)
index 0000000..edb5551
--- /dev/null
@@ -0,0 +1,2 @@
+#define UTMPX
+#include "tst-utmp.c"