Bladeren bron

test: add utmpx test

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Bernhard Reutner-Fischer 9 jaren geleden
bovenliggende
commit
6372941899
4 gewijzigde bestanden met toevoegingen van 22 en 0 verwijderingen
  1. 1 0
      test/.gitignore
  2. 4 0
      test/misc/Makefile.in
  3. 15 0
      test/misc/tst-utmp.c
  4. 2 0
      test/misc/tst-utmpx.c

+ 1 - 0
test/.gitignore

@@ -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

+ 4 - 0
test/misc/Makefile.in

@@ -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

+ 15 - 0
test/misc/tst-utmp.c

@@ -37,6 +37,21 @@
 # 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
 

+ 2 - 0
test/misc/tst-utmpx.c

@@ -0,0 +1,2 @@
+#define UTMPX
+#include "tst-utmp.c"