diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2010-07-27 20:16:23 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2010-07-27 20:16:23 +0000 |
commit | c0d577848e18b5cb23326a07531ee607d3ea90b9 (patch) | |
tree | 5a8622c3afdf47da46e6c2850b7c5b9a8859e559 /testsuites/psxtests/psxobj01 | |
parent | cb0997e3d97226aa0b14d38b8fd8d25fc6205f5b (diff) |
2010-07-27 Joel Sherrill <joel.sherrill@oarcorp.com>
* psxobj01/Makefile.am, psxobj01/init.c, psxobj01/psxobj01.scn: Add
test for runnign out of workspace when setting object name as string.
Diffstat (limited to 'testsuites/psxtests/psxobj01')
-rw-r--r-- | testsuites/psxtests/psxobj01/Makefile.am | 2 | ||||
-rw-r--r-- | testsuites/psxtests/psxobj01/init.c | 9 | ||||
-rw-r--r-- | testsuites/psxtests/psxobj01/psxobj01.scn | 2 |
3 files changed, 12 insertions, 1 deletions
diff --git a/testsuites/psxtests/psxobj01/Makefile.am b/testsuites/psxtests/psxobj01/Makefile.am index d6f8c741c3..5f3a966956 100644 --- a/testsuites/psxtests/psxobj01/Makefile.am +++ b/testsuites/psxtests/psxobj01/Makefile.am @@ -5,7 +5,7 @@ MANAGERS = all rtems_tests_PROGRAMS = psxobj01 -psxobj01_SOURCES = init.c +psxobj01_SOURCES = init.c ../../support/src/test_support.c dist_rtems_tests_DATA = psxobj01.scn dist_rtems_tests_DATA += psxobj01.doc diff --git a/testsuites/psxtests/psxobj01/init.c b/testsuites/psxtests/psxobj01/init.c index 05c6862e10..25cf7214c3 100644 --- a/testsuites/psxtests/psxobj01/init.c +++ b/testsuites/psxtests/psxobj01/init.c @@ -12,6 +12,7 @@ #define __RTEMS_VIOLATE_KERNEL_VISIBILITY__ #include <tmacros.h> +#include "test_support.h" rtems_task Init( rtems_task_argument ignored @@ -21,6 +22,7 @@ rtems_task Init( Objects_Information TestClass; Objects_Id id; char name[64]; + bool bc; puts( "\n\n*** POSIX OBJECT TEST 1 ***" ); @@ -62,6 +64,13 @@ rtems_task Init( rtems_test_exit(0); } + /* out of memory error ONLY when POSIX is enabled */ + puts( "INIT - _Objects_Set_name fails - out of memory" ); + Allocate_majority_of_workspace( 1 ); + + bc = _Objects_Set_name( &TestClass, &_Thread_Executing->Object, name ); + rtems_test_assert( bc == false ); + puts( "*** END OF POSIX OBJECT TEST 1 ***" ); rtems_test_exit(0); } diff --git a/testsuites/psxtests/psxobj01/psxobj01.scn b/testsuites/psxtests/psxobj01/psxobj01.scn index e0ffd7b5f8..809d028eea 100644 --- a/testsuites/psxtests/psxobj01/psxobj01.scn +++ b/testsuites/psxtests/psxobj01/psxobj01.scn @@ -2,4 +2,6 @@ INIT - _Objects_Name_to_id_string - NULL name INIT - _Objects_Name_to_id_string - NULL ID INIT - _Objects_Name_to_id_string - name of non-existent object +INIT - _Objects_Set_name fails - out of memory +Allocate_majority_of_workspace: *** END OF POSIX OBJECT TEST 1 *** |