summaryrefslogtreecommitdiffstats
path: root/test/stream_test.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-10-08 19:59:36 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-10-08 19:59:36 (GMT)
commit16683943c6edb42f9129cc5d6c8f340c74014dad (patch)
treed1ed13b0b7677e56d4253b4fe5e0640f851e27ca /test/stream_test.c
parentd3ee3988b68292524b3a893b9db55c074f4b9e87 (diff)
downloadhdf5-16683943c6edb42f9129cc5d6c8f340c74014dad.zip
hdf5-16683943c6edb42f9129cc5d6c8f340c74014dad.tar.gz
hdf5-16683943c6edb42f9129cc5d6c8f340c74014dad.tar.bz2
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2 Add simple regression test for H5Dopen1 Tested on: FreeBSD/32 6.2 (duty) in debug mode FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Mac OS X/32 10.4.10 (amazon) in debug mode
Diffstat (limited to 'test/stream_test.c')
-rw-r--r--test/stream_test.c53
1 files changed, 24 insertions, 29 deletions
diff --git a/test/stream_test.c b/test/stream_test.c
index 3051d3b..7cd8267 100644
--- a/test/stream_test.c
+++ b/test/stream_test.c
@@ -321,25 +321,23 @@ static int receiver (void)
* the sender should have created.
*/
tempfile = fopen (TEMPFILENAME, "r");
- if (tempfile == NULL)
- {
- fprintf (stderr, "receiver: couldn't open temporary file to read "
+ if(tempfile == NULL) {
+ fprintf(stderr, "receiver: couldn't open temporary file to read "
"\"hostname:port\" information\n");
- H5Pclose (fapl);
- return (-3);
+ H5Pclose(fapl);
+ return(-3);
}
- fgets (filename, sizeof (filename) - 1, tempfile);
- fclose (tempfile);
- unlink (TEMPFILENAME);
+ fgets(filename, sizeof (filename) - 1, tempfile);
+ fclose(tempfile);
+ unlink(TEMPFILENAME);
/*
* Open the streamed HDF5 file for reading.
*/
- printf (" receiver: opening file '%s' for reading...\n", filename);
- file = H5Fopen (filename, H5F_ACC_RDONLY, fapl);
- H5Pclose (fapl);
- if (file < 0)
- {
+ printf(" receiver: opening file '%s' for reading...\n", filename);
+ file = H5Fopen(filename, H5F_ACC_RDONLY, fapl);
+ H5Pclose(fapl);
+ if(file < 0) {
fprintf (stderr, "receiver: couldn't open file from '%s'\n", filename);
return (-4);
}
@@ -348,9 +346,8 @@ static int receiver (void)
* Open the file and the dataset.
*/
printf (" receiver: reading dataset '%s'...\n", DATASETNAME);
- dataset = H5Dopen (file, DATASETNAME);
- if (dataset < 0)
- {
+ dataset = H5Dopen2(file, DATASETNAME, H5P_DEFAULT);
+ if(dataset < 0) {
fprintf (stderr, "receiver: couldn't open dataset '%s'\n", DATASETNAME);
return (-5);
}
@@ -358,27 +355,25 @@ static int receiver (void)
/*
* Get dataset class, order, and size information
*/
- datatype = H5Dget_type (dataset);
- if (H5Tget_class (datatype) == H5T_INTEGER)
- {
- printf (" receiver: dataset is of type INTEGER\n");
- }
- printf (" receiver: datatype size is %d bytes\n",
+ datatype = H5Dget_type(dataset);
+ if(H5Tget_class(datatype) == H5T_INTEGER)
+ printf(" receiver: dataset is of type INTEGER\n");
+ printf(" receiver: datatype size is %d bytes\n",
(int) H5Tget_size (datatype));
- printf (" receiver: byte ordering is %s endian\n",
+ printf(" receiver: byte ordering is %s endian\n",
H5Tget_order (datatype) == H5T_ORDER_LE ? "little" : "big");
H5Tclose(datatype);
/*
* Get dataset dimensions
*/
- dataspace = H5Dget_space (dataset);
- rank = H5Sget_simple_extent_ndims (dataspace);
- dims = (hsize_t *) malloc (rank * sizeof (hsize_t));
- H5Sget_simple_extent_dims (dataspace, dims, NULL);
- H5Sclose (dataspace);
+ dataspace = H5Dget_space(dataset);
+ rank = H5Sget_simple_extent_ndims(dataspace);
+ dims = (hsize_t *)malloc(rank * sizeof (hsize_t));
+ H5Sget_simple_extent_dims(dataspace, dims, NULL);
+ H5Sclose(dataspace);
- printf (" receiver: rank %d, dimensions %u", rank, (unsigned int) dims[0]);
+ printf(" receiver: rank %d, dimensions %u", rank, (unsigned int)dims[0]);
nelems = dims[0];
for (i = 1; i < rank; i++)
{