diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2019-11-11 20:08:46 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2019-11-12 09:47:20 +0100 |
commit | 1a48cbfa16bf54a442f9394e4c4d9c2211e82865 (patch) | |
tree | 929eba7ba5e91ae9ae31f77547353dbb04ea5da4 /testsuites/psxtests/psxfatal01/init.c | |
parent | tests: Simplify fatal error test support (diff) | |
download | rtems-1a48cbfa16bf54a442f9394e4c4d9c2211e82865.tar.bz2 |
sptests: Avoid include path magic
Update #3818.
Diffstat (limited to 'testsuites/psxtests/psxfatal01/init.c')
-rw-r--r-- | testsuites/psxtests/psxfatal01/init.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/testsuites/psxtests/psxfatal01/init.c b/testsuites/psxtests/psxfatal01/init.c new file mode 100644 index 0000000000..fb0e2b24ed --- /dev/null +++ b/testsuites/psxtests/psxfatal01/init.c @@ -0,0 +1,45 @@ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "../psxfatal_support/psxfatal.h" + +/* + * Classic API Init task create failure + */ + +#include <errno.h> + +#include <rtems/posix/posixapi.h> + +/* + * Way too much stack space. Should generate a fatal error + * on the init task create. + */ +#define CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE +#define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE 0 +posix_initialization_threads_table POSIX_Initialization_threads[] = { + { NULL, /* bad thread entry */ + 0 + } +}; + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME POSIX_Initialization_threads + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE \ + sizeof(CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME) / \ + sizeof(posix_initialization_threads_table) + +#define FATAL_ERROR_TEST_NAME "1" +#define FATAL_ERROR_DESCRIPTION \ + "POSIX API Init thread create failure - NULL entry" +#define FATAL_ERROR_EXPECTED_SOURCE INTERNAL_ERROR_CORE +#define FATAL_ERROR_EXPECTED_ERROR \ + INTERNAL_ERROR_POSIX_INIT_THREAD_CREATE_FAILED + +static void force_error(void) +{ + /* we will not run this far */ +} + +#include "../psxfatal_support/psxfatalimpl.h" |