diff packages/language/c/libc/current/tests/stdlib/malloc3.c @ 2:443894e2e912 ecos-v1_2_1-release

Block commit of eCos version 1.2.1
author jlarmour
date Tue, 11 May 1999 12:24:34 +0000
parents 3111d98ba7b3
children c38311975d4f
line wrap: on
line diff
--- a/packages/language/c/libc/current/tests/stdlib/malloc3.c
+++ b/packages/language/c/libc/current/tests/stdlib/malloc3.c
@@ -22,15 +22,15 @@
 // September 30, 1998.
 // 
 // The Initial Developer of the Original Code is Cygnus.  Portions created
-// by Cygnus are Copyright (C) 1998 Cygnus Solutions.  All Rights Reserved.
+// by Cygnus are Copyright (C) 1998,1999 Cygnus Solutions.  All Rights Reserved.
 // -------------------------------------------
 //
 //####COPYRIGHTEND####
 //=================================================================
 //#####DESCRIPTIONBEGIN####
 //
-// Author(s):     jlarmour@cygnus.co.uk
-// Contributors:    jlarmour@cygnus.co.uk
+// Author(s):     jlarmour
+// Contributors:  jlarmour
 // Date:          1998/6/3
 // Description:   Contains testcode for C library malloc(), calloc() and
 //                free() functions
@@ -45,8 +45,12 @@
 
 // INCLUDES
 
-#include <pkgconf/libc.h> // config header for C library so we can know size
-                          // of malloc pool
+#include <pkgconf/system.h> // Overall system configuration
+#include <pkgconf/libc.h>   // config header for C library so we can know
+                            // size of malloc pool
+#ifdef CYGPKG_KERNEL
+# include <pkgconf/kernel.h> // CYGSEM_KERNEL_MEMORY_COALESCE
+#endif
 #include <stdlib.h>
 #include <cyg/infra/testcase.h>
 #include <sys/cstartup.h>          // C library initialisation
@@ -65,7 +69,8 @@ cyg_package_start( void )
 } // cyg_package_start()
 
 
-#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_MALLOC)
+#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_MALLOC) && \
+    defined(CYGSEM_KERNEL_MEMORY_COALESCE)
 static int
 fill_with_data( char *buf, int size )
 {
@@ -95,12 +100,16 @@ fill_with_data( char *buf, int size )
     return 1;
 } // fill_with_data()
 
-#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_MALLOC)
+#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_MALLOC) &&
+       //    defined(CYGSEM_KERNEL_MEMORY_COALESCE)
+
 
 int
 main( int argc, char *argv[] )
 {
-#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_MALLOC)
+#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_MALLOC) && \
+    defined(CYGSEM_KERNEL_MEMORY_COALESCE)
+
     char *str;
     int size = CYGNUM_LIBC_MALLOC_MEMPOOL_SIZE/2;
 #endif
@@ -111,7 +120,8 @@ main( int argc, char *argv[] )
                   "malloc() and free() functions");
     CYG_TEST_INFO("This checks allocation and freeing of large regions");
 
-#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_MALLOC)
+#if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_MALLOC) && \
+    defined(CYGSEM_KERNEL_MEMORY_COALESCE)
 
     // Don't allocate all the memory at once - leave room for any structures
     // used to manage the memory
@@ -168,8 +178,10 @@ main( int argc, char *argv[] )
 
 
 #else
-    CYG_TEST_PASS("Testing is not applicable to this configuration");
-#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_MALLOC)
+    CYG_TEST_NA("Testing is not applicable to this configuration");
+#endif // if defined(CYGPKG_LIBC) && defined(CYGPKG_LIBC_MALLOC) &&
+       //    defined(CYGSEM_KERNEL_MEMORY_COALESCE)
+
 
     CYG_TEST_FINISH("Finished tests from testcase " __FILE__ " for C library "
                     "malloc() and free() functions");