From d44074900d214e1d992c03152f9f43269bea7eba Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kristian=20H=C3=B8gsberg?= Date: Thu, 19 Apr 2012 12:37:40 -0400 Subject: [PATCH] tests: Add more sanity test to make sure we catch different failure modes --- tests/sanity-test.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/tests/sanity-test.c b/tests/sanity-test.c index 90e55ff..f2abe42 100644 --- a/tests/sanity-test.c +++ b/tests/sanity-test.c @@ -22,9 +22,42 @@ #include #include +#include +#include +#include + #include "test-runner.h" #include "../src/wayland-util.h" +TEST(empty) +{ +} + +TEST(exit_success) +{ + exit(EXIT_SUCCESS); +} + +FAIL_TEST(exit_failure) +{ + exit(EXIT_FAILURE); +} + +FAIL_TEST(fail_abort) +{ + abort(); +} + +FAIL_TEST(fail_kill) +{ + kill(getpid(), SIGTERM); +} + +FAIL_TEST(fail_segv) +{ + * (char **) 0 = "Goodbye, world"; +} + FAIL_TEST(sanity_assert) { /* must fail */ -- 2.7.4