summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2002-12-12 22:44:56 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2002-12-12 22:44:56 (GMT)
commitae1e58baeab79e06a94d23b57231beb604762738 (patch)
tree647b886cef8596a4a37be3b8c98a6886d95a37af /test
parent0e1f75306a6ff50f7dafc235a94f2c0b5081b8c0 (diff)
downloadhdf5-ae1e58baeab79e06a94d23b57231beb604762738.zip
hdf5-ae1e58baeab79e06a94d23b57231beb604762738.tar.gz
hdf5-ae1e58baeab79e06a94d23b57231beb604762738.tar.bz2
[svn-r6201]
Purpose: Bug fix(kinda) Description: Windows handle "fopen, fseek, fread, fclose" C functions slightly different. Solution: change to HDopen, HDlseek, HDread, HDclose to cover both Unix and Windows. Platforms tested: arabica
Diffstat (limited to 'test')
-rw-r--r--test/dsets.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/dsets.c b/test/dsets.c
index a4f4a76..0402f46 100644
--- a/test/dsets.c
+++ b/test/dsets.c
@@ -221,8 +221,8 @@ test_simple_io(hid_t file, char *fname)
int i, j, n;
hsize_t dims[2];
void *tconv_buf = NULL;
- FILE *f;
- haddr_t offset;
+ int f;
+ haddr_t offset;
int rdata[100][200];
TESTING("simple I/O");
@@ -261,9 +261,9 @@ test_simple_io(hid_t file, char *fname)
* compare it with the data written in.*/
if((offset=H5Dget_offset(dataset))==HADDR_UNDEF) goto error;
- f = fopen(fname, "r");
- fseek(f, (long int)offset, SEEK_SET);
- fread(rdata, sizeof(int), 100*200, f);
+ f = HDopen(fname, O_RDONLY, 0);
+ HDlseek(f, (off_t)offset, SEEK_SET);
+ HDread(f, rdata, sizeof(int)*100*200);
/* Check that the values read are the same as the values written */
for (i = 0; i < 100; i++) {
@@ -277,7 +277,7 @@ test_simple_io(hid_t file, char *fname)
}
}
- fclose(f);
+ HDclose(f);
/* Read the dataset back */
if (H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, xfer, check)<0)