[rtems commit] libtests/malloc04: Fixes for RTEMS_DEBUG 2nd try

Sebastian Huber sebh at rtems.org
Fri Jul 26 11:54:37 UTC 2013


Module:    rtems
Branch:    master
Commit:    ede5a2a4d5b00d2c8e07c174daa1d087adebbeb3
Changeset: http://git.rtems.org/rtems/commit/?id=ede5a2a4d5b00d2c8e07c174daa1d087adebbeb3

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Jul 26 14:00:00 2013 +0200

libtests/malloc04: Fixes for RTEMS_DEBUG 2nd try

---

 testsuites/libtests/malloc04/init.c       |   24 ++++++++++++------------
 testsuites/libtests/malloc04/malloc04.scn |   10 +++++-----
 2 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/testsuites/libtests/malloc04/init.c b/testsuites/libtests/malloc04/init.c
index bf4b2ea..ff55efa 100644
--- a/testsuites/libtests/malloc04/init.c
+++ b/testsuites/libtests/malloc04/init.c
@@ -40,7 +40,7 @@ void *rtems_heap_null_extend(
 }
 #endif
 
-char Malloc_Heap[ 512 ] CPU_STRUCTURE_ALIGNMENT;
+char Malloc_Heap[ 1024 ] CPU_STRUCTURE_ALIGNMENT;
 
 /*
  * Use volatile to prevent compiler optimizations due to the malloc() builtin.
@@ -88,23 +88,23 @@ rtems_task Init(
   puts( "No sbrk() amount" );
 
   sbrk_count = 0;
-  offset     = 128;
+  offset     = 256;
   area.begin = &Malloc_Heap [0];
   area.size  = offset;
   RTEMS_Malloc_Initialize( &area, 1, NULL );
 
   errno = 0;
-  p = malloc( 128 );
+  p = malloc( 256 );
   rtems_test_assert( p == NULL );
   rtems_test_assert( errno == ENOMEM );
   rtems_test_assert( sbrk_count == 0 );
 
-  rtems_heap_set_sbrk_amount( 128 );
+  rtems_heap_set_sbrk_amount( 256 );
 
   puts( "Misaligned extend" );
 
   sbrk_count = 0;
-  offset     = 128;
+  offset     = 256;
   area.begin = &Malloc_Heap [0];
   area.size  = offset;
   RTEMS_Malloc_Initialize( &area, 1, NULL );
@@ -113,14 +113,14 @@ rtems_task Init(
   rtems_test_assert( p != NULL );
   rtems_test_assert( sbrk_count == 0 );
 
-  p = malloc(129);
+  p = malloc(257);
   rtems_test_assert( p != NULL );
   rtems_test_assert( sbrk_count == 1 );
 
   puts( "Not enough sbrk() space" );
 
   sbrk_count = 0;
-  offset     = 128;
+  offset     = 256;
   area.begin = &Malloc_Heap [0];
   area.size  = offset;
   RTEMS_Malloc_Initialize( &area, 1, NULL );
@@ -134,29 +134,29 @@ rtems_task Init(
   puts( "Valid heap extend" );
 
   sbrk_count = 0;
-  offset     = 128;
+  offset     = 256;
   area.begin = &Malloc_Heap [0];
   area.size  = offset;
   RTEMS_Malloc_Initialize( &area, 1, NULL );
 
-  p = malloc( 64 );
+  p = malloc( 128 );
   rtems_test_assert( p != NULL );
   rtems_test_assert( sbrk_count == 0 );
 
-  p = malloc( 64 );
+  p = malloc( 128 );
   rtems_test_assert( p != NULL );
   rtems_test_assert( sbrk_count == 1 );
 
   puts( "Invalid heap extend" );
 
   sbrk_count = -1;
-  offset     = 128;
+  offset     = 256;
   area.begin = &Malloc_Heap [0];
   area.size  = offset;
   RTEMS_Malloc_Initialize( &area, 1, NULL );
 
   errno = 0;
-  p = malloc( 128 );
+  p = malloc( 256 );
   rtems_test_assert( p == NULL );
   rtems_test_assert( errno == ENOMEM );
   rtems_test_assert( sbrk_count == 2 );
diff --git a/testsuites/libtests/malloc04/malloc04.scn b/testsuites/libtests/malloc04/malloc04.scn
index 1984d74..0792868 100644
--- a/testsuites/libtests/malloc04/malloc04.scn
+++ b/testsuites/libtests/malloc04/malloc04.scn
@@ -1,12 +1,12 @@
 *** TEST MALLOC 04 ***
 No sbrk() amount
 Misaligned extend
-sbrk(256)
-Not enough sbrk() space
 sbrk(512)
+Not enough sbrk() space
+sbrk(1024)
 Valid heap extend
-sbrk(128)
+sbrk(256)
 Invalid heap extend
-sbrk(128)
-sbrk(-128)
+sbrk(256)
+sbrk(-256)
 *** END OF TEST MALLOC 04 ***




More information about the vc mailing list