Author: ngie
Date: Fri Oct 10 21:22:25 2014
New Revision: 272915
URL: https://svnweb.freebsd.org/changeset/base/272915

Log:
  Port the testcase to FreeBSD
  
  - Make #include path to h_macros.h a non-relative path
  - __gl_stat_t is synonymous with struct stat on FreeBSD
  - FreeBSD doesn't have _DIRENT_RECLEN
  - Skip over glob_star on FreeBSD (testcase doesn't pass)
  
  In collaboration with: pho
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/contrib/netbsd-tests/lib/libc/gen/t_glob.c

Modified: head/contrib/netbsd-tests/lib/libc/gen/t_glob.c
==============================================================================
--- head/contrib/netbsd-tests/lib/libc/gen/t_glob.c     Fri Oct 10 21:19:17 
2014        (r272914)
+++ head/contrib/netbsd-tests/lib/libc/gen/t_glob.c     Fri Oct 10 21:22:25 
2014        (r272915)
@@ -46,7 +46,13 @@ __RCSID("$NetBSD: t_glob.c,v 1.3 2013/01
 #include <string.h>
 #include <errno.h>
 
+#if defined(__FreeBSD__)
+#include "h_macros.h"
+#define        __gl_stat_t struct stat
+#define        _S_IFDIR S_IFDIR
+#else
 #include "../../../h_macros.h"
+#endif
 
 
 #ifdef DEBUG
@@ -132,7 +138,11 @@ gl_readdir(void *v)
                dir.d_ino = dd->pos;
                dir.d_type = f->dir ? DT_DIR : DT_REG;
                DPRINTF(("readdir %s %d\n", dir.d_name, dir.d_type));
+#if defined(__FreeBSD__)
+               dir.d_reclen = -1; /* Does not have _DIRENT_RECLEN */
+#else
                dir.d_reclen = _DIRENT_RECLEN(&dir, dir.d_namlen);
+#endif
                return &dir;
        }
        return NULL;
@@ -213,6 +223,7 @@ run(const char *p, int flags, const char
 }
 
 
+#if !defined(__FreeBSD__)
 ATF_TC(glob_star);
 ATF_TC_HEAD(glob_star, tc)
 {
@@ -224,6 +235,7 @@ ATF_TC_BODY(glob_star, tc)
 {
        run("a/**", GLOB_STAR, glob_star, __arraycount(glob_star));
 }
+#endif
 
 ATF_TC(glob_star_not);
 ATF_TC_HEAD(glob_star_not, tc)
@@ -260,7 +272,9 @@ ATF_TC_BODY(glob_nocheck, tc)
 
 ATF_TP_ADD_TCS(tp)
 {
+#if !defined(__FreeBSD__)
        ATF_TP_ADD_TC(tp, glob_star);
+#endif
        ATF_TP_ADD_TC(tp, glob_star_not);
 /*
  * Remove this test for now - the GLOB_NOCHECK return value has been
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to