summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2012-04-19 12:37:40 -0400
committerKristian Høgsberg <krh@bitplanet.net>2012-04-19 12:37:40 -0400
commitd44074900d214e1d992c03152f9f43269bea7eba (patch)
tree77945048de586ea63a1aa21bea050990f4b38cd9 /tests
parent41570a5ed979f8e277b124caa7023abcb726b5f3 (diff)
tests: Add more sanity test to make sure we catch different failure modes
Diffstat (limited to 'tests')
-rw-r--r--tests/sanity-test.c33
1 files changed, 33 insertions, 0 deletions
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 <stdlib.h>
#include <assert.h>
+#include <sys/types.h>
+#include <signal.h>
+#include <unistd.h>
+
#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 */