Author: metze
Date: 2006-09-13 06:11:53 +0000 (Wed, 13 Sep 2006)
New Revision: 18442

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=18442

Log:
run the os2_delete test in the testsuite too

that shows that Tru64 is broken...

It doesn't have getdirent() and the the replacement
code doesn't work there.

tridge: do you have any idea how to fix this?

metze
Modified:
   branches/SAMBA_4_0/source/lib/replace/Makefile.in
   branches/SAMBA_4_0/source/lib/replace/repdir/config.m4
   branches/SAMBA_4_0/source/lib/replace/test/os2_delete.c
   branches/SAMBA_4_0/source/lib/replace/test/testsuite.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/replace/Makefile.in
===================================================================
--- branches/SAMBA_4_0/source/lib/replace/Makefile.in   2006-09-13 04:03:58 UTC 
(rev 18441)
+++ branches/SAMBA_4_0/source/lib/replace/Makefile.in   2006-09-13 06:11:53 UTC 
(rev 18442)
@@ -36,7 +36,7 @@
 
 installcheck: install test
 
-TEST_OBJS = test/testsuite.o
+TEST_OBJS = test/testsuite.o test/os2_delete.o
 
 testsuite: libreplace.a $(TEST_OBJS)
        $(CC) -o testsuite $(TEST_OBJS) -L. -lreplace

Modified: branches/SAMBA_4_0/source/lib/replace/repdir/config.m4
===================================================================
--- branches/SAMBA_4_0/source/lib/replace/repdir/config.m4      2006-09-13 
04:03:58 UTC (rev 18441)
+++ branches/SAMBA_4_0/source/lib/replace/repdir/config.m4      2006-09-13 
06:11:53 UTC (rev 18442)
@@ -1,15 +1,21 @@
 AC_CACHE_CHECK([for broken readdir],samba_cv_HAVE_BROKEN_READDIR,[
-       AC_TRY_RUN([#include "$libreplacedir/test/os2_delete.c"],
-                  [samba_cv_HAVE_BROKEN_READDIR=no],
-                          [samba_cv_HAVE_BROKEN_READDIR=yes],
-                          [samba_cv_HAVE_BROKEN_READDIR="assuming not"])])
+       AC_TRY_RUN([
+#define test_readdir_os2_delete main
+#include "$libreplacedir/test/os2_delete.c"],
+       [samba_cv_HAVE_BROKEN_READDIR=no],
+       [samba_cv_HAVE_BROKEN_READDIR=yes],
+       [samba_cv_HAVE_BROKEN_READDIR="assuming not"])
+])
 
 if test x"$samba_cv_HAVE_BROKEN_READDIR" = x"yes"; then
 AC_CACHE_CHECK([for replacing readdir],samba_cv_REPLACE_READDIR,[
        AC_TRY_RUN([
 #include "$libreplacedir/repdir/repdir.c"
+#define test_readdir_os2_delete main
 #include "$libreplacedir/test/os2_delete.c"],
-                  samba_cv_REPLACE_READDIR=yes,samba_cv_REPLACE_READDIR=no)])
+       [samba_cv_REPLACE_READDIR=yes],
+       [samba_cv_REPLACE_READDIR=no])
+])
 fi
 
 SMB_ENABLE(REPLACE_READDIR, NO)

Modified: branches/SAMBA_4_0/source/lib/replace/test/os2_delete.c
===================================================================
--- branches/SAMBA_4_0/source/lib/replace/test/os2_delete.c     2006-09-13 
04:03:58 UTC (rev 18441)
+++ branches/SAMBA_4_0/source/lib/replace/test/os2_delete.c     2006-09-13 
06:11:53 UTC (rev 18442)
@@ -12,9 +12,6 @@
 #include <errno.h>
 #include <string.h>
 #include <fcntl.h>
-#ifdef REPLACE_READDIR
-#include "lib/replace/repdir/repdir.h"
-#endif
 
 #define NUM_FILES 700
 #define READDIR_SIZE 100
@@ -22,8 +19,11 @@
 
 #define TESTDIR "test.dir"
 
-#define FAILED(d) (fprintf(stderr, "Failed for %s - %s\n", d, 
strerror(errno)), exit(1), 1)
+static int test_readdir_os2_delete_ret;
 
+#define FAILED(d) (fprintf(stderr, "Failed for %s - %s\n", d, 
strerror(errno)), test_readdir_os2_delete_ret = 1, 1)
+#define CHECK do { if (test_readdir_os2_delete_ret != 0) return 
test_readdir_os2_delete_ret; } while (0)
+
 #ifndef MIN
 #define MIN(a,b) ((a)<(b)?(a):(b))
 #endif
@@ -78,7 +78,7 @@
        return j;
 }
 
-int main(void)
+int test_readdir_os2_delete(void)
 {
        int total_deleted = 0;
        DIR *d;

Modified: branches/SAMBA_4_0/source/lib/replace/test/testsuite.c
===================================================================
--- branches/SAMBA_4_0/source/lib/replace/test/testsuite.c      2006-09-13 
04:03:58 UTC (rev 18441)
+++ branches/SAMBA_4_0/source/lib/replace/test/testsuite.c      2006-09-13 
06:11:53 UTC (rev 18442)
@@ -229,8 +229,15 @@
        return true;
 }
 
-static int test_readdir(void)
+extern int test_readdir_os2_delete(void);
+
+static bool test_readdir(void)
 {
+       printf("testing readdir\n");
+       if (test_readdir_os2_delete() != 0) {
+               return false;
+       }
+
        /* FIXME */
        return true;
 }

Reply via email to