summaryrefslogtreecommitdiffstats
path: root/test/tconfig.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2003-11-08 15:33:13 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2003-11-08 15:33:13 (GMT)
commita89dda8cb1260f05f3e283ca80310b3090940341 (patch)
treef795625c9dd894d518b75a810c4d73a39f089f87 /test/tconfig.c
parent677f6cc3d8d7000c19869f7c09e9a015606369b8 (diff)
downloadhdf5-a89dda8cb1260f05f3e283ca80310b3090940341.zip
hdf5-a89dda8cb1260f05f3e283ca80310b3090940341.tar.gz
hdf5-a89dda8cb1260f05f3e283ca80310b3090940341.tar.bz2
[svn-r7830] Purpose:
Bug fix & code cleanup Description: Allowing the library to call malloc with a size of 0 bytes causes problems for some users, so we check for allocations of 0 bytes and disallow them now. Cleaned up some code which could call malloc with 0 size. Changed some code calling HDmalloc directly to call H5MM_malloc(), which allows us to check for 0 sized allocations. Platforms tested: FreeBSD 4.9 (sleipnir) too minor to require h5committest
Diffstat (limited to 'test/tconfig.c')
-rw-r--r--test/tconfig.c42
1 files changed, 0 insertions, 42 deletions
diff --git a/test/tconfig.c b/test/tconfig.c
index 73197653..4cb3976 100644
--- a/test/tconfig.c
+++ b/test/tconfig.c
@@ -36,7 +36,6 @@
/* local routine prototypes */
void test_config_ctypes(void);
-void test_config_malloc(void);
/*-------------------------------------------------------------------------
@@ -59,7 +58,6 @@ test_configure(void)
/* Output message about test being performed */
MESSAGE(5, ("Testing configure definitions\n"));
test_config_ctypes();
- test_config_malloc();
}
@@ -184,43 +182,3 @@ test_config_ctypes(void)
#endif
}
-
-
-/*-------------------------------------------------------------------------
- * Function: test_config_malloc
- *
- * Purpose: test C language malloc function
- *
- * Return: none (error is fed back via global variable num_errs)
- *
- * Programmer: Albert Cheng
- * April 13, 2002
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-void
-test_config_malloc(void)
-{
- char *pt;
-
- /* verify H5_MALLOC_WORKS (malloc zero byte) macros */
- pt = malloc(0);
-
-#ifdef H5_MALLOC_WORKS
- if (pt==NULL){
- print_func("Error verifying H5_MALLOC_WORKS: "
- "expected non-NULL, got NULL\n");
- num_errs++;
- }
-
- free(pt);
-#else
- if (pt!=NULL){
- print_func("Error verifying H5_MALLOC_WORKS: "
- "expected NULL, got non-NULL\n");
- num_errs++;
- }
-#endif
-}