From 754c677b0bbf3ea6c7d2a73c93848f1b0d68c91e Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 20 Jun 2011 16:54:15 +0930 Subject: lib: import ccan modules for tdb2 Imported from git://git.ozlabs.org/~ccan/ccan init-1161-g661d41f Signed-off-by: Rusty Russell --- lib/ccan/build_assert/test/compile_fail-expr.c | 10 ++++++++++ lib/ccan/build_assert/test/compile_fail.c | 9 +++++++++ lib/ccan/build_assert/test/compile_ok.c | 7 +++++++ lib/ccan/build_assert/test/run-BUILD_ASSERT_OR_ZERO.c | 9 +++++++++ lib/ccan/build_assert/test/run-EXPR_BUILD_ASSERT.c | 9 +++++++++ 5 files changed, 44 insertions(+) create mode 100644 lib/ccan/build_assert/test/compile_fail-expr.c create mode 100644 lib/ccan/build_assert/test/compile_fail.c create mode 100644 lib/ccan/build_assert/test/compile_ok.c create mode 100644 lib/ccan/build_assert/test/run-BUILD_ASSERT_OR_ZERO.c create mode 100644 lib/ccan/build_assert/test/run-EXPR_BUILD_ASSERT.c (limited to 'lib/ccan/build_assert/test') 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 + +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 + +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 + +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 +#include + +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 +#include + +int main(int argc, char *argv[]) +{ + plan_tests(1); + ok1(EXPR_BUILD_ASSERT(1 == 1) == 0); + return exit_status(); +} -- cgit