diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2010-08-09 14:29:33 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2010-08-09 14:29:33 +0000 |
commit | 38cc1e1b214a5daf599ef4fd61908b40cdf1d84a (patch) | |
tree | 874320d7ea74ebbd8890e02ef8d6f560c88d79e5 /testsuites | |
parent | 2010-08-09 Sebastian Huber <sebastian.huber@embedded-brains.de> (diff) | |
download | rtems-38cc1e1b214a5daf599ef4fd61908b40cdf1d84a.tar.bz2 |
2010-08-09 Joel Sherrill <joel.sherrill@oarcorp.com>
PR 1661/testing
* psxchroot01/test.c, psximfs01/init.c, psximfs02/init.c,
psxpipe01/init.c: Eliminate most references to RTEMS_Malloc_Heap.
Diffstat (limited to 'testsuites')
-rw-r--r-- | testsuites/psxtests/ChangeLog | 6 | ||||
-rw-r--r-- | testsuites/psxtests/psxchroot01/test.c | 8 | ||||
-rw-r--r-- | testsuites/psxtests/psximfs01/init.c | 7 | ||||
-rw-r--r-- | testsuites/psxtests/psximfs02/init.c | 8 | ||||
-rw-r--r-- | testsuites/psxtests/psxpipe01/init.c | 9 |
5 files changed, 15 insertions, 23 deletions
diff --git a/testsuites/psxtests/ChangeLog b/testsuites/psxtests/ChangeLog index ec5588e6d9..fe595a5925 100644 --- a/testsuites/psxtests/ChangeLog +++ b/testsuites/psxtests/ChangeLog @@ -1,3 +1,9 @@ +2010-08-09 Joel Sherrill <joel.sherrill@oarcorp.com> + + PR 1661/testing + * psxchroot01/test.c, psximfs01/init.c, psximfs02/init.c, + psxpipe01/init.c: Eliminate most references to RTEMS_Malloc_Heap. + 2010-08-09 Ralf Corsépius <ralf.corsepius@rtems.org> * psxpasswd02/init.c: Remove unused variable. diff --git a/testsuites/psxtests/psxchroot01/test.c b/testsuites/psxtests/psxchroot01/test.c index 25105567fa..ff872bb1e3 100644 --- a/testsuites/psxtests/psxchroot01/test.c +++ b/testsuites/psxtests/psxchroot01/test.c @@ -34,7 +34,7 @@ #include <rtems/libio.h> #include <rtems/userenv.h> #include <pmacros.h> -#include <rtems/score/heap.h> +#include <rtems/libcsupport.h> void touch( char *file ) { @@ -64,8 +64,6 @@ int fileexists( char *file ) } #if defined(__rtems__) -extern Heap_Control *RTEMS_Malloc_Heap; - int test_main(void) #else int main( @@ -76,7 +74,6 @@ int main( { int status; void *alloc_ptr = (void *)0; - Heap_Information_block Info; /* * This test is the C equivalent of this sequence. #mkdir /one @@ -108,8 +105,7 @@ int main( touch( "/one/two/two.test" ); puts( "allocate most of memory - attempt to fail chroot - expect ENOTSUP" ); - _Heap_Get_information(RTEMS_Malloc_Heap, &Info); - alloc_ptr = malloc( Info.Free.largest - 4 ); + alloc_ptr = malloc( malloc_free_space() - 4 ); rtems_test_assert( alloc_ptr != NULL ); status = chroot( "/one" ); diff --git a/testsuites/psxtests/psximfs01/init.c b/testsuites/psxtests/psximfs01/init.c index 8ca65bb0c7..cafac02701 100644 --- a/testsuites/psxtests/psximfs01/init.c +++ b/testsuites/psxtests/psximfs01/init.c @@ -17,6 +17,7 @@ #include <sys/stat.h> #include <fcntl.h> #include <errno.h> +#include <rtems/libcsupport.h> int TestFd; uint8_t Buffer[256]; @@ -207,15 +208,12 @@ void unlink_it(void) rtems_test_assert( rc == 0 ); } -extern Heap_Control *RTEMS_Malloc_Heap; - rtems_task Init( rtems_task_argument argument ) { int i; void *alloc_ptr = (void *)0; - Heap_Information_block Info; int position = 0; int status = 0; @@ -240,8 +238,7 @@ rtems_task Init( /* * Allocate the heap, so that extend cannot be successful */ - _Heap_Get_information( RTEMS_Malloc_Heap, &Info ); - alloc_ptr = malloc( Info.Free.largest-4 ); + alloc_ptr = malloc( malloc_free_space() - 4 ); extend_helper(); diff --git a/testsuites/psxtests/psximfs02/init.c b/testsuites/psxtests/psximfs02/init.c index 7482fbc528..cafe232e17 100644 --- a/testsuites/psxtests/psximfs02/init.c +++ b/testsuites/psxtests/psximfs02/init.c @@ -18,8 +18,8 @@ #include <fcntl.h> #include <errno.h> #include <rtems/libio.h> +#include <rtems/libcsupport.h> -extern Heap_Control *RTEMS_Malloc_Heap; void IMFS_dump( void ); rtems_task Init( rtems_task_argument argument @@ -85,8 +85,7 @@ rtems_task Init( rtems_test_assert( errno == EACCES ); puts( "Allocate most of heap" ); - _Heap_Get_information( RTEMS_Malloc_Heap, &Info ); - alloc_ptr = malloc( Info.Free.largest - 150 ); + alloc_ptr = malloc( malloc_free_space() - 150 ); puts( "Attempt to mount a fs at /dir01 -- expect ENOMEM" ); status = mount( NULL, @@ -101,8 +100,7 @@ rtems_task Init( free( alloc_ptr ); puts( "Allocate most of heap" ); - _Heap_Get_information( RTEMS_Malloc_Heap, &Info ); - alloc_ptr = malloc( Info.Free.largest - 4 ); + alloc_ptr = malloc( malloc_free_space() - 4 ); puts( "Changing directory to /" ); status = chdir( "/" ); diff --git a/testsuites/psxtests/psxpipe01/init.c b/testsuites/psxtests/psxpipe01/init.c index 49d2e00fc2..7ef2e31e32 100644 --- a/testsuites/psxtests/psxpipe01/init.c +++ b/testsuites/psxtests/psxpipe01/init.c @@ -16,10 +16,7 @@ #include <fcntl.h> #include <unistd.h> #include <errno.h> - -#include <rtems/score/heap.h> - -extern Heap_Control *RTEMS_Malloc_Heap; +#include <rtems/libcsupport.h> rtems_task Init( rtems_task_argument not_used @@ -29,7 +26,6 @@ rtems_task Init( int dummy_fd[2] = {0,0}; int status = 0; void *alloc_ptr = (void *)0; - Heap_Information_block Info; puts( "*** TEST POSIX PIPE CREATION - 01 ***" ); @@ -54,8 +50,7 @@ rtems_task Init( status |= close( fd[1] ); rtems_test_assert( status == 0 ); - _Heap_Get_information(RTEMS_Malloc_Heap, &Info); - alloc_ptr = malloc(Info.Free.largest-4); + alloc_ptr = malloc( malloc_free_space() - 4 ); /* case where mkfifo fails */ puts( "Init - attempt to create pipe -- expect ENOMEM" ); |