diff options
author | Jennifer Averett <Jennifer.Averett@OARcorp.com> | 2010-06-22 18:20:47 +0000 |
---|---|---|
committer | Jennifer Averett <Jennifer.Averett@OARcorp.com> | 2010-06-22 18:20:47 +0000 |
commit | 91e446f3ab34f391738015fee889c3c54046bf51 (patch) | |
tree | e36953f6e6fa1aae8573e0afa45ab4ba9f897188 /testsuites/libtests | |
parent | 2010-06-22 Jennifer Averett <Jennifer.Averett@OARcorp.com> (diff) | |
download | rtems-91e446f3ab34f391738015fee889c3c54046bf51.tar.bz2 |
2010-06-22 Jennifer Averett <Jennifer.Averett@OARcorp.com>
* malloctest/init.c: Added error case with malloc of size 0.
Diffstat (limited to 'testsuites/libtests')
-rw-r--r-- | testsuites/libtests/ChangeLog | 4 | ||||
-rw-r--r-- | testsuites/libtests/malloctest/init.c | 14 |
2 files changed, 18 insertions, 0 deletions
diff --git a/testsuites/libtests/ChangeLog b/testsuites/libtests/ChangeLog index 7d7a36786b..41686e9fdc 100644 --- a/testsuites/libtests/ChangeLog +++ b/testsuites/libtests/ChangeLog @@ -1,5 +1,9 @@ 2010-06-22 Jennifer Averett <Jennifer.Averett@OARcorp.com> + * malloctest/init.c: Added error case with malloc of size 0. + +2010-06-22 Jennifer Averett <Jennifer.Averett@OARcorp.com> + * malloctest/init.c: Added test to check failure branch on calloc. 2010-06-21 Joel Sherrill <joel.sherrill@oarcorp.com> diff --git a/testsuites/libtests/malloctest/init.c b/testsuites/libtests/malloctest/init.c index cdb4791060..a2054f6d77 100644 --- a/testsuites/libtests/malloctest/init.c +++ b/testsuites/libtests/malloctest/init.c @@ -1086,12 +1086,26 @@ rtems_task Init( status = rtems_clock_set( &time ); directive_failed( status, "rtems_clock_set" ); + /* + * Verify case where block is too large to calloc. + */ p1 = calloc( 1, SIZE_MAX ); if (p1) { printf("ERROR on attempt to calloc SIZE_MAX block expected failure."); free( p1 ); } + /* + * Verify error case where malloc of size 0. + */ + p1 = malloc( 0 ); + if (p1) { + printf("ERROR on attempt to malloc size 0 block expected failure."); + free( p1 ); + } + + + test_heap_initialize(); test_heap_block_allocate(); test_heap_allocate(); |