summaryrefslogtreecommitdiff
path: root/lib/ccan/build_assert/test
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2011-06-20 16:54:15 +0930
committerRusty Russell <rusty@rustcorp.com.au>2011-06-20 11:18:34 +0200
commit754c677b0bbf3ea6c7d2a73c93848f1b0d68c91e (patch)
tree54d99c9f66d5a57bf7f70d53e744a31df18f9e0e /lib/ccan/build_assert/test
parenta8c3d38bc806c6972d10b6a371de8941da25a9ae (diff)
downloadsamba-754c677b0bbf3ea6c7d2a73c93848f1b0d68c91e.tar.gz
samba-754c677b0bbf3ea6c7d2a73c93848f1b0d68c91e.tar.bz2
samba-754c677b0bbf3ea6c7d2a73c93848f1b0d68c91e.zip
lib: import ccan modules for tdb2
Imported from git://git.ozlabs.org/~ccan/ccan init-1161-g661d41f Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'lib/ccan/build_assert/test')
-rw-r--r--lib/ccan/build_assert/test/compile_fail-expr.c10
-rw-r--r--lib/ccan/build_assert/test/compile_fail.c9
-rw-r--r--lib/ccan/build_assert/test/compile_ok.c7
-rw-r--r--lib/ccan/build_assert/test/run-BUILD_ASSERT_OR_ZERO.c9
-rw-r--r--lib/ccan/build_assert/test/run-EXPR_BUILD_ASSERT.c9
5 files changed, 44 insertions, 0 deletions
diff --git a/lib/ccan/build_assert/test/compile_fail-expr.c b/lib/ccan/build_assert/test/compile_fail-expr.c
new file mode 100644
index 0000000000..109215b8aa
--- /dev/null
+++ b/lib/ccan/build_assert/test/compile_fail-expr.c
@@ -0,0 +1,10 @@
+#include <ccan/build_assert/build_assert.h>
+
+int main(int argc, char *argv[])
+{
+#ifdef FAIL
+ return BUILD_ASSERT_OR_ZERO(1 == 0);
+#else
+ return 0;
+#endif
+}
diff --git a/lib/ccan/build_assert/test/compile_fail.c b/lib/ccan/build_assert/test/compile_fail.c
new file mode 100644
index 0000000000..37d95eddc9
--- /dev/null
+++ b/lib/ccan/build_assert/test/compile_fail.c
@@ -0,0 +1,9 @@
+#include <ccan/build_assert/build_assert.h>
+
+int main(int argc, char *argv[])
+{
+#ifdef FAIL
+ BUILD_ASSERT(1 == 0);
+#endif
+ return 0;
+}
diff --git a/lib/ccan/build_assert/test/compile_ok.c b/lib/ccan/build_assert/test/compile_ok.c
new file mode 100644
index 0000000000..4105484d1f
--- /dev/null
+++ b/lib/ccan/build_assert/test/compile_ok.c
@@ -0,0 +1,7 @@
+#include <ccan/build_assert/build_assert.h>
+
+int main(int argc, char *argv[])
+{
+ BUILD_ASSERT(1 == 1);
+ return 0;
+}
diff --git a/lib/ccan/build_assert/test/run-BUILD_ASSERT_OR_ZERO.c b/lib/ccan/build_assert/test/run-BUILD_ASSERT_OR_ZERO.c
new file mode 100644
index 0000000000..4185821331
--- /dev/null
+++ b/lib/ccan/build_assert/test/run-BUILD_ASSERT_OR_ZERO.c
@@ -0,0 +1,9 @@
+#include <ccan/build_assert/build_assert.h>
+#include <ccan/tap/tap.h>
+
+int main(int argc, char *argv[])
+{
+ plan_tests(1);
+ ok1(BUILD_ASSERT_OR_ZERO(1 == 1) == 0);
+ return exit_status();
+}
diff --git a/lib/ccan/build_assert/test/run-EXPR_BUILD_ASSERT.c b/lib/ccan/build_assert/test/run-EXPR_BUILD_ASSERT.c
new file mode 100644
index 0000000000..91bbbbbf75
--- /dev/null
+++ b/lib/ccan/build_assert/test/run-EXPR_BUILD_ASSERT.c
@@ -0,0 +1,9 @@
+#include <ccan/build_assert/build_assert.h>
+#include <ccan/tap/tap.h>
+
+int main(int argc, char *argv[])
+{
+ plan_tests(1);
+ ok1(EXPR_BUILD_ASSERT(1 == 1) == 0);
+ return exit_status();
+}