From ae1e58baeab79e06a94d23b57231beb604762738 Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Thu, 12 Dec 2002 17:44:56 -0500 Subject: [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 --- test/dsets.c | 12 ++++++------ 1 file 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) -- cgit v0.12