lib/replace: Try to fix build on HP-UX for os2_delete test
authorAndrew Bartlett <abartlet@samba.org>
Sun, 23 Sep 2012 03:39:01 +0000 (13:39 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Sun, 23 Sep 2012 04:31:01 +0000 (14:31 +1000)
The issue is that this file is both used in an autoconf test, and
later in a smbtorture test.  Because os2_delete.c does not include
replace.h, bool may not be defined.

So, instead we shift the need for bool to a different header.

(The readdir tests in repdir.m4 are not yet in the waf configure).

Andrew Bartlett

lib/replace/replace-test.h
lib/replace/replace-testsuite.h
lib/replace/test/main.c
lib/replace/test/testsuite.c
source4/torture/local/local.c

index a522853351ceb9a32cf0a0c7574a3ff64efc70f1..ed8e75e3b113026ae8dc40a2e5b5fcf52d5fa850 100644 (file)
@@ -1,10 +1,6 @@
 #ifndef __LIB_REPLACE_REPLACE_TEST_H__
 #define __LIB_REPLACE_REPLACE_TEST_H__
 
-#include <stdbool.h>
-struct torture_context;
-
-bool torture_local_replace(struct torture_context *ctx);
 int libreplace_test_strptime(void);
 int test_readdir_os2_delete(void);
 int getifaddrs_test(void);
index a522853351ceb9a32cf0a0c7574a3ff64efc70f1..b28dbec067166913e5a7dd8bb536ce86931e9471 100644 (file)
@@ -1,13 +1,10 @@
-#ifndef __LIB_REPLACE_REPLACE_TEST_H__
-#define __LIB_REPLACE_REPLACE_TEST_H__
+#ifndef __LIB_REPLACE_REPLACE_TESTSUITE_H__
+#define __LIB_REPLACE_REPLACE_TESTSUITE_H__
 
 #include <stdbool.h>
 struct torture_context;
 
 bool torture_local_replace(struct torture_context *ctx);
-int libreplace_test_strptime(void);
-int test_readdir_os2_delete(void);
-int getifaddrs_test(void);
 
-#endif /* __LIB_REPLACE_REPLACE_TEST_H__ */
+#endif /* __LIB_REPLACE_REPLACE_TESTSUITE_H__ */
 
index 9bd12840a5b4ad5e52c14585a06b0f8e24ea7bde..94264d73672a38a68fc5d74f98f0a2da78be921e 100644 (file)
@@ -24,9 +24,7 @@
 */
 
 #include "replace.h"
-
-struct torture_context;
-bool torture_local_replace(struct torture_context *ctx);
+#include "replace-testsuite.h"
 
 int main(void)
 {
index 0c1fac67a0e54b3ab726f5c0cb43708d2af03cac..04658bea05975b7d1d9f394bac923ffbea6e0b36 100644 (file)
@@ -24,6 +24,8 @@
 */
 
 #include "replace.h"
+#include "replace-test.h"
+#include "replace-testsuite.h"
 
 /*
   we include all the system/ include files here so that libreplace tests
@@ -48,8 +50,6 @@
 
 #define TESTFILE "testfile.dat"
 
-struct torture_context;
-bool torture_local_replace(struct torture_context *ctx);
 
 /*
   test ftruncate() function
@@ -379,8 +379,6 @@ static int test_opendir(void)
        return true;
 }
 
-extern int test_readdir_os2_delete(void);
-
 static int test_readdir(void)
 {
        printf("test: readdir\n");
index c0b3305462a80b4d58c596ee509969ac7c895fc0..d4e891116f2a94af758908ef009275bda932a139 100644 (file)
@@ -24,7 +24,7 @@
 #include "torture/auth/proto.h"
 #include "../lib/crypto/test_proto.h"
 #include "lib/registry/tests/proto.h"
-#include "lib/replace/replace-test.h"
+#include "lib/replace/replace-testsuite.h"
 
 /* ignore me */ static struct torture_suite *
        (*suite_generators[]) (TALLOC_CTX *mem_ctx) =