libreplace: move main() out of testsuite.c
authorStefan Metzmacher <metze@samba.org>
Sun, 21 Sep 2008 21:59:58 +0000 (23:59 +0200)
committerStefan Metzmacher <metze@samba.org>
Sun, 21 Sep 2008 22:09:12 +0000 (00:09 +0200)
metze

replace/Makefile.in
replace/test/main.c [new file with mode: 0644]
replace/test/testsuite.c

index c889a0e45793c3198ceeef024706c339d6afb8d5..65f8125efdeb07c3f8fed6d918457cbf9f42fb8d 100644 (file)
@@ -47,7 +47,7 @@ test: all
 
 installcheck: install test
 
-TEST_OBJS = test/testsuite.o test/os2_delete.o test/strptime.o test/getifaddrs.o
+TEST_OBJS = test/main.o test/testsuite.o test/os2_delete.o test/strptime.o test/getifaddrs.o
 
 testsuite: libreplace.a $(TEST_OBJS)
        $(CC) -o testsuite $(TEST_OBJS) -L. -lreplace $(LDFLAGS) $(LIBS)
diff --git a/replace/test/main.c b/replace/test/main.c
new file mode 100644 (file)
index 0000000..9bd1284
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+   Unix SMB/CIFS implementation.
+
+   libreplace tests
+
+   Copyright (C) Jelmer Vernooij 2006
+
+     ** NOTE! The following LGPL license applies to the talloc
+     ** library. This does NOT imply that all of Samba is released
+     ** under the LGPL
+
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "replace.h"
+
+struct torture_context;
+bool torture_local_replace(struct torture_context *ctx);
+
+int main(void)
+{
+       bool ret = torture_local_replace(NULL);
+       if (ret)
+               return 0;
+       return -1;
+}
index dcb05fbbf4ead2d522e1b44550548f04a5237e7e..7929f11addf0a660ba9ca6e19ca4d02f420339eb 100644 (file)
@@ -1068,14 +1068,3 @@ bool torture_local_replace(struct torture_context *ctx)
 
        return ret;
 }
-
-#if _SAMBA_BUILD_>3
-#else
-int main(void)
-{
-       bool ret = torture_local_replace(NULL);
-       if (ret) 
-               return 0;
-       return -1;
-}
-#endif