mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-02 09:01:39 -05:00
tests: Add more sanity test to make sure we catch different failure modes
This commit is contained in:
parent
41570a5ed9
commit
d44074900d
1 changed files with 33 additions and 0 deletions
|
|
@ -22,9 +22,42 @@
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <signal.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
#include "test-runner.h"
|
#include "test-runner.h"
|
||||||
#include "../src/wayland-util.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)
|
FAIL_TEST(sanity_assert)
|
||||||
{
|
{
|
||||||
/* must fail */
|
/* must fail */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue