diff options
Diffstat (limited to 'testsuites/psxtests/psxfatal02/init.c')
-rw-r--r-- | testsuites/psxtests/psxfatal02/init.c | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/testsuites/psxtests/psxfatal02/init.c b/testsuites/psxtests/psxfatal02/init.c new file mode 100644 index 0000000000..260c0aea0d --- /dev/null +++ b/testsuites/psxtests/psxfatal02/init.c @@ -0,0 +1,49 @@ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "../psxfatal_support/psxfatal.h" + +/* + * Classic API Init task create failure + */ + +#include <errno.h> +#include <limits.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[] = { + { POSIX_Init, +#if INT_MAX < (12 * 1024 * 1024) + INT_MAX +#else + 12 * 1024 * 1024 /* too much stack */ +#endif + } +}; + +#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 "2" +#define FATAL_ERROR_DESCRIPTION \ + "POSIX API Init thread create failure -- no memory for stack" +#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" |