mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-02-23 16:20:57 +08:00
[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
This commit is contained in:
parent
0e1f75306a
commit
ae1e58baea
12
test/dsets.c
12
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)
|
||||
|
Loading…
Reference in New Issue
Block a user