summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2001-06-28 21:23:13 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2001-06-28 21:23:13 (GMT)
commitbcb587dcc2305763546acd8e3303240530cd20cf (patch)
tree5a9e89047989e529f38005725b671bd62fa1e9d7 /test
parent3a925f72d08e3e61602c9e3344c1f67b340057fb (diff)
downloadhdf5-bcb587dcc2305763546acd8e3303240530cd20cf.zip
hdf5-bcb587dcc2305763546acd8e3303240530cd20cf.tar.gz
hdf5-bcb587dcc2305763546acd8e3303240530cd20cf.tar.bz2
[svn-r4081]
Purpose: [is this a bug fix? feature? ...] Description: [describe the bug, or describe the new feature, etc] Solution: [details about the changes, algorithm, etc...] [Please as detail as you can since your own explanation is better than others guessing it from the code.] Platforms tested: [machines you have tested the changed version. This is absolute important. Test it out on at least two or three different platforms such as Big-endian-32bit (SUN/IRIX), little-endian-32(LINUX) and 64-bit (IRIX64/UNICOS/DEC-ALPHA) would be good.]
Diffstat (limited to 'test')
-rw-r--r--test/enum.c6
-rw-r--r--test/flush1.c13
-rw-r--r--test/iopipe.c11
-rw-r--r--test/overhead.c23
-rw-r--r--test/testhdf5.c4
-rw-r--r--test/titerate.c18
6 files changed, 56 insertions, 19 deletions
diff --git a/test/enum.c b/test/enum.c
index a0a2e6f..4be6139 100644
--- a/test/enum.c
+++ b/test/enum.c
@@ -207,7 +207,13 @@ test_tr1(hid_t file)
if (H5Tenum_insert(m_type, "WHITE", CPTR(eval, E1_WHITE))<0) goto error;
if (H5Tenum_insert(m_type, "BLACK", CPTR(eval, E1_BLACK))<0) goto error;
+
+#ifndef __MWERKS__
assert(sizeof(c_e1)==sizeof(int));
+#else
+ printf( "\n sizeof(c_e1)=%d ,sizeof(int) %d ", sizeof(c_e1),sizeof(int) );
+#endif
+
if ((f_type = H5Tcreate(H5T_ENUM, sizeof(c_e1)))<0) goto error;
if (H5Tenum_insert(f_type, "RED", CPTR(ival, 105))<0) goto error;
if (H5Tenum_insert(f_type, "GREEN", CPTR(ival, 104))<0) goto error;
diff --git a/test/flush1.c b/test/flush1.c
index c1017c5..c543bcf 100644
--- a/test/flush1.c
+++ b/test/flush1.c
@@ -13,6 +13,15 @@
*/
#include "h5test.h"
+
+#if defined __MWERKS__
+#include <abort_exit.h>
+# define EXIT(a) __exit(a)
+#else
+# define EXIT(a) _exit(a)
+#endif
+
+
const char *FILENAME[] = {
"flush",
NULL
@@ -88,10 +97,10 @@ main(void)
PASSED();
fflush(stdout);
fflush(stderr);
- _exit(0);
+ EXIT(0);
return 0;
error:
- _exit(1);
+ EXIT(1);
return 1;
}
diff --git a/test/iopipe.c b/test/iopipe.c
index fc50012..d8f6247 100644
--- a/test/iopipe.c
+++ b/test/iopipe.c
@@ -41,6 +41,17 @@
# include <Winsock.h>
#endif
+
+#if defined (__MWERKS__)
+#ifdef H5_HAVE_SYS_TIMEB
+#undef H5_HAVE_SYS_TIMEB
+#endif
+#ifdef H5_HAVE_SYSTEM
+#undef H5_HAVE_SYSTEM
+#endif
+#endif
+
+
#ifdef H5_HAVE_SYS_TIMEB
# include <sys/timeb.h>
#endif
diff --git a/test/overhead.c b/test/overhead.c
index 3e2d5fc..721c686 100644
--- a/test/overhead.c
+++ b/test/overhead.c
@@ -207,7 +207,10 @@ test(fill_t fill_style, const double splits[],
if ((mspace=H5Screate_simple(1, ch_size, ch_size))<0) goto error;
if ((dset=H5Dcreate(file, "chunked", H5T_NATIVE_INT,
fspace, dcpl))<0) goto error;
+
+#if !defined( __MWERKS__)
if ((fd=open(FILE_NAME_1, O_RDONLY))<0) goto error;
+#endif
for (i=1; i<=cur_size[0]; i++) {
@@ -243,6 +246,7 @@ test(fill_t fill_style, const double splits[],
}
/* Determine overhead */
+#if !defined( __MWERKS__)
if (verbose) {
if (H5Fflush(file, H5F_SCOPE_LOCAL)<0) goto error;
if (fstat(fd, &sb)<0) goto error;
@@ -255,6 +259,7 @@ test(fill_t fill_style, const double splits[],
(unsigned long)i,
(double)(hssize_t)(sb.st_size-i*sizeof(int))/(hssize_t)i);
}
+#endif
}
H5Dclose(dset);
@@ -283,17 +288,21 @@ test(fill_t fill_style, const double splits[],
case FILL_ALL:
abort();
}
+
+#if !defined( __MWERKS__)
if (fstat(fd, &sb)<0) goto error;
- /*
- * The extra cast in the following statement is a bug workaround
- * for the Win32 version 5.0 compiler.
- * 1998-11-06 ptl
- */
+
printf("%-7s %8.3f\n", sname,
(double)(hssize_t)(sb.st_size-cur_size[0]*sizeof(int))/
(hssize_t)cur_size[0]);
+#endif
+
}
+
+#if !defined( __MWERKS__)
close(fd);
+#endif
+
return 0;
error:
@@ -303,7 +312,11 @@ test(fill_t fill_style, const double splits[],
H5Pclose(dcpl);
H5Fclose(file);
free(had);
+
+#if !defined( __MWERKS__)
close(fd);
+#endif
+
return 1;
}
diff --git a/test/testhdf5.c b/test/testhdf5.c
index 2ab6f51..8c1d4e7 100644
--- a/test/testhdf5.c
+++ b/test/testhdf5.c
@@ -140,9 +140,7 @@ main(int argc, char *argv[])
int Cache = 1;
uintn major, minor, release;
-#if defined __MWERKS__
- argc = ccommand(&argv);
-#endif
+
#if !(defined MAC || defined __MWERKS__ || defined SYMANTEC_C)
/* Un-buffer the stdout and stderr */
diff --git a/test/titerate.c b/test/titerate.c
index 9fd70f3..b7aa25c 100644
--- a/test/titerate.c
+++ b/test/titerate.c
@@ -24,7 +24,7 @@
#include "hdf5.h"
-#define FILE "titerate.h5"
+#define FILE_NAME "titerate.h5"
/* Number of datasets for group iteration test */
#define NDATASETS 50
@@ -118,7 +118,7 @@ static void test_iter_group(void)
MESSAGE(5, ("Testing Group Iteration Functionality\n"));
/* Create the test file with the datasets */
- file = H5Fcreate(FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ file = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
CHECK(file, FAIL, "H5Fcreate");
datatype = H5Tcopy(H5T_NATIVE_INT);
@@ -133,7 +133,7 @@ static void test_iter_group(void)
CHECK(dataset, FAIL, "H5Dcreate");
/* Keep a copy of the dataset names around for later */
- dnames[i]=strdup(name);
+ dnames[i]=HDstrdup(name);
CHECK(dnames[i], NULL, "strdup");
ret=H5Dclose(dataset);
@@ -154,7 +154,7 @@ static void test_iter_group(void)
qsort(dnames,NDATASETS,sizeof(char *),iter_strcmp);
/* Iterate through the datasets in the root group in various ways */
- file=H5Fopen(FILE, H5F_ACC_RDONLY, H5P_DEFAULT);
+ file=H5Fopen(FILE_NAME, H5F_ACC_RDONLY, H5P_DEFAULT);
CHECK(file, FAIL, "H5Fopen");
/* Test all objects in group, when callback always returns 0 */
@@ -262,7 +262,7 @@ static void test_iter_attr(void)
MESSAGE(5, ("Testing Attribute Iteration Functionality\n"));
/* Create the test file with the datasets */
- file = H5Fcreate(FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ file = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
CHECK(file, FAIL, "H5Fcreate");
datatype = H5Tcopy(H5T_NATIVE_INT);
@@ -280,7 +280,7 @@ static void test_iter_attr(void)
CHECK(attribute, FAIL, "H5Acreate");
/* Keep a copy of the attribute names around for later */
- anames[i]=strdup(name);
+ anames[i]=HDstrdup(name);
CHECK(anames[i], NULL, "strdup");
ret=H5Aclose(attribute);
@@ -301,7 +301,7 @@ static void test_iter_attr(void)
CHECK(ret, FAIL, "H5Fclose");
/* Iterate through the attributes on the dataset in various ways */
- file=H5Fopen(FILE, H5F_ACC_RDONLY, H5P_DEFAULT);
+ file=H5Fopen(FILE_NAME, H5F_ACC_RDONLY, H5P_DEFAULT);
CHECK(file, FAIL, "H5Fopen");
dataset=H5Dopen(file, "Dataset");
@@ -438,7 +438,7 @@ static void test_iter_group_large(void)
MESSAGE(5, ("Testing Large Group Iteration Functionality\n"));
/* Create file */
- file = H5Fcreate(FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ file = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
CHECK(file, FAIL, "H5Fcreate");
/* Create dataspace for datasets */
@@ -555,6 +555,6 @@ test_iterate(void)
void
cleanup_iterate(void)
{
- remove(FILE);
+ remove(FILE_NAME);
}