summaryrefslogtreecommitdiff
path: root/gl/tests/test-sys_stat.c
diff options
context:
space:
mode:
Diffstat (limited to 'gl/tests/test-sys_stat.c')
-rw-r--r--gl/tests/test-sys_stat.c45
1 files changed, 41 insertions, 4 deletions
diff --git a/gl/tests/test-sys_stat.c b/gl/tests/test-sys_stat.c
index cd07d86e87..3303badcce 100644
--- a/gl/tests/test-sys_stat.c
+++ b/gl/tests/test-sys_stat.c
@@ -26,11 +26,14 @@
int a[] =
{
S_IFMT,
- S_IFBLK, S_IFCHR, S_IFDIR, S_IFIFO, S_IFREG,
-#ifdef S_IFLNK /* missing on mingw and djgpp */
+#ifdef S_IFBLK /* missing on MSVC */
+ S_IFBLK,
+#endif
+ S_IFCHR, S_IFDIR, S_IFIFO, S_IFREG,
+#ifdef S_IFLNK /* missing on native Windows and DJGPP */
S_IFLNK,
#endif
-#ifdef S_IFSOCK /* missing on mingw and djgpp */
+#ifdef S_IFSOCK /* missing on native Windows and DJGPP */
S_IFSOCK,
#endif
S_IRWXU, S_IRUSR, S_IWUSR, S_IXUSR,
@@ -61,7 +64,9 @@ verify (S_IRWXU == (S_IRUSR | S_IWUSR | S_IXUSR));
verify (S_IRWXG == (S_IRGRP | S_IWGRP | S_IXGRP));
verify (S_IRWXO == (S_IROTH | S_IWOTH | S_IXOTH));
+#ifdef S_IFBLK
verify (S_ISBLK (S_IFBLK));
+#endif
verify (!S_ISBLK (S_IFCHR));
verify (!S_ISBLK (S_IFDIR));
verify (!S_ISBLK (S_IFIFO));
@@ -73,7 +78,9 @@ verify (!S_ISBLK (S_IFLNK));
verify (!S_ISBLK (S_IFSOCK));
#endif
+#ifdef S_IFBLK
verify (!S_ISCHR (S_IFBLK));
+#endif
verify (S_ISCHR (S_IFCHR));
verify (!S_ISCHR (S_IFDIR));
verify (!S_ISCHR (S_IFIFO));
@@ -85,7 +92,9 @@ verify (!S_ISCHR (S_IFLNK));
verify (!S_ISCHR (S_IFSOCK));
#endif
+#ifdef S_IFBLK
verify (!S_ISDIR (S_IFBLK));
+#endif
verify (!S_ISDIR (S_IFCHR));
verify (S_ISDIR (S_IFDIR));
verify (!S_ISDIR (S_IFIFO));
@@ -97,7 +106,9 @@ verify (!S_ISDIR (S_IFLNK));
verify (!S_ISDIR (S_IFSOCK));
#endif
+#ifdef S_IFBLK
verify (!S_ISFIFO (S_IFBLK));
+#endif
verify (!S_ISFIFO (S_IFCHR));
verify (!S_ISFIFO (S_IFDIR));
verify (S_ISFIFO (S_IFIFO));
@@ -109,7 +120,9 @@ verify (!S_ISFIFO (S_IFLNK));
verify (!S_ISFIFO (S_IFSOCK));
#endif
+#ifdef S_IFBLK
verify (!S_ISREG (S_IFBLK));
+#endif
verify (!S_ISREG (S_IFCHR));
verify (!S_ISREG (S_IFDIR));
verify (!S_ISREG (S_IFIFO));
@@ -121,7 +134,9 @@ verify (!S_ISREG (S_IFLNK));
verify (!S_ISREG (S_IFSOCK));
#endif
+#ifdef S_IFBLK
verify (!S_ISLNK (S_IFBLK));
+#endif
verify (!S_ISLNK (S_IFCHR));
verify (!S_ISLNK (S_IFDIR));
verify (!S_ISLNK (S_IFIFO));
@@ -133,7 +148,9 @@ verify (S_ISLNK (S_IFLNK));
verify (!S_ISLNK (S_IFSOCK));
#endif
+#ifdef S_IFBLK
verify (!S_ISSOCK (S_IFBLK));
+#endif
verify (!S_ISSOCK (S_IFCHR));
verify (!S_ISSOCK (S_IFDIR));
verify (!S_ISSOCK (S_IFIFO));
@@ -145,7 +162,9 @@ verify (!S_ISSOCK (S_IFLNK));
verify (S_ISSOCK (S_IFSOCK));
#endif
+#ifdef S_IFBLK
verify (!S_ISDOOR (S_IFBLK));
+#endif
verify (!S_ISDOOR (S_IFCHR));
verify (!S_ISDOOR (S_IFDIR));
verify (!S_ISDOOR (S_IFIFO));
@@ -157,7 +176,9 @@ verify (!S_ISDOOR (S_IFLNK));
verify (!S_ISDOOR (S_IFSOCK));
#endif
+#ifdef S_IFBLK
verify (!S_ISMPB (S_IFBLK));
+#endif
verify (!S_ISMPB (S_IFCHR));
verify (!S_ISMPB (S_IFDIR));
verify (!S_ISMPB (S_IFIFO));
@@ -169,7 +190,9 @@ verify (!S_ISMPB (S_IFLNK));
verify (!S_ISMPB (S_IFSOCK));
#endif
+#ifdef S_IFBLK
verify (!S_ISNAM (S_IFBLK));
+#endif
verify (!S_ISNAM (S_IFCHR));
verify (!S_ISNAM (S_IFDIR));
verify (!S_ISNAM (S_IFIFO));
@@ -181,7 +204,9 @@ verify (!S_ISNAM (S_IFLNK));
verify (!S_ISNAM (S_IFSOCK));
#endif
+#ifdef S_IFBLK
verify (!S_ISNWK (S_IFBLK));
+#endif
verify (!S_ISNWK (S_IFCHR));
verify (!S_ISNWK (S_IFDIR));
verify (!S_ISNWK (S_IFIFO));
@@ -193,7 +218,9 @@ verify (!S_ISNWK (S_IFLNK));
verify (!S_ISNWK (S_IFSOCK));
#endif
+#ifdef S_IFBLK
verify (!S_ISPORT (S_IFBLK));
+#endif
verify (!S_ISPORT (S_IFCHR));
verify (!S_ISPORT (S_IFDIR));
verify (!S_ISPORT (S_IFIFO));
@@ -205,7 +232,9 @@ verify (!S_ISPORT (S_IFLNK));
verify (!S_ISPORT (S_IFSOCK));
#endif
+#ifdef S_IFBLK
verify (!S_ISCTG (S_IFBLK));
+#endif
verify (!S_ISCTG (S_IFCHR));
verify (!S_ISCTG (S_IFDIR));
verify (!S_ISCTG (S_IFIFO));
@@ -217,7 +246,9 @@ verify (!S_ISCTG (S_IFLNK));
verify (!S_ISCTG (S_IFSOCK));
#endif
+#ifdef S_IFBLK
verify (!S_ISOFD (S_IFBLK));
+#endif
verify (!S_ISOFD (S_IFCHR));
verify (!S_ISOFD (S_IFDIR));
verify (!S_ISOFD (S_IFIFO));
@@ -229,7 +260,9 @@ verify (!S_ISOFD (S_IFLNK));
verify (!S_ISOFD (S_IFSOCK));
#endif
+#ifdef S_IFBLK
verify (!S_ISOFL (S_IFBLK));
+#endif
verify (!S_ISOFL (S_IFCHR));
verify (!S_ISOFL (S_IFDIR));
verify (!S_ISOFL (S_IFIFO));
@@ -241,7 +274,9 @@ verify (!S_ISOFL (S_IFLNK));
verify (!S_ISOFL (S_IFSOCK));
#endif
+#ifdef S_IFBLK
verify (!S_ISWHT (S_IFBLK));
+#endif
verify (!S_ISWHT (S_IFCHR));
verify (!S_ISWHT (S_IFDIR));
verify (!S_ISWHT (S_IFIFO));
@@ -278,8 +313,10 @@ invalid UTIME macros
/* Check the existence of some types. */
nlink_t t1;
+off_t t2;
+mode_t t3;
-struct timespec t2;
+struct timespec st;
int
main (void)