diff options
-rw-r--r-- | test/external.c | 29 | ||||
-rw-r--r-- | test/th5s.c | 4 |
2 files changed, 21 insertions, 12 deletions
diff --git a/test/external.c b/test/external.c index edc05c9..7e07554 100644 --- a/test/external.c +++ b/test/external.c @@ -97,8 +97,9 @@ test_1a(hid_t file) /* Create the dataset */ if ((dcpl=H5Pcreate(H5P_DATASET_CREATE))<0) goto error; - if (H5Pset_external(dcpl, "ext1.data", 0, (hsize_t)400)<0) goto error; cur_size[0] = max_size[0] = 100; + if (H5Pset_external(dcpl, "ext1.data", 0, + (hsize_t)(max_size[0]*sizeof(int)))<0) goto error; if ((space = H5Screate_simple (1, cur_size, max_size))<0) goto error; if ((dset = H5Dcreate (file, "dset1", H5T_NATIVE_INT, space, dcpl))<0) goto error; @@ -125,10 +126,11 @@ test_1a(hid_t file) printf(" got: %lu\n ans: 0\n", (unsigned long)file_offset); goto error; } - if (file_size!=400) { + if (file_size!=(max_size[0]*sizeof(int))) { FAILED(); puts(" Wrong file size."); - printf(" got: %lu\n ans: 400\n", (unsigned long)file_size); + printf(" got: %lu\n ans: %lu\n", (unsigned long)file_size, + (unsigned long)max_size[0]*sizeof(int)); goto error; } if (H5Pclose (dcpl)<0) goto error; @@ -174,8 +176,9 @@ test_1b(hid_t file) TESTING("external storage is too small"); if ((dcpl = H5Pcreate (H5P_DATASET_CREATE))<0) goto error; - if (H5Pset_external (dcpl, "ext1.data", 0, (hsize_t)399)<0) goto error; cur_size[0] = max_size[0] = 100; + if (H5Pset_external(dcpl, "ext1.data", 0, + (hsize_t)(max_size[0]*sizeof(int)-1))<0) goto error; if ((space = H5Screate_simple (1, cur_size, max_size))<0) goto error; H5E_BEGIN_TRY { dset = H5Dcreate (file, "dset2", H5T_NATIVE_INT, space, dcpl); @@ -229,9 +232,10 @@ test_1c(hid_t file) TESTING("extendible dataspace, exact external size"); if ((dcpl=H5Pcreate (H5P_DATASET_CREATE))<0) goto error; - if (H5Pset_external (dcpl, "ext1.data", 0, (hsize_t)800)<0) goto error; cur_size[0] = 100; max_size[0] = 200; + if (H5Pset_external(dcpl, "ext1.data", 0, + (hsize_t)(max_size[0]*sizeof(int)))<0) goto error; if ((space = H5Screate_simple (1, cur_size, max_size))<0) goto error; if ((dset = H5Dcreate (file, "dset3", H5T_NATIVE_INT, space, dcpl))<0) goto error; @@ -279,9 +283,10 @@ test_1d(hid_t file) TESTING("extendible dataspace, external storage is too small"); if ((dcpl=H5Pcreate(H5P_DATASET_CREATE))<0) goto error; - if (H5Pset_external(dcpl, "ext1.data", 0, (hsize_t)799)<0) goto error; cur_size[0] = 100; max_size[0] = 200; + if (H5Pset_external(dcpl, "ext1.data", 0, + (hsize_t)(max_size[0]*sizeof(int)-1))<0) goto error; if ((space=H5Screate_simple(1, cur_size, max_size))<0) goto error; H5E_BEGIN_TRY { dset = H5Dcreate (file, "dset4", H5T_NATIVE_INT, space, dcpl); @@ -417,11 +422,15 @@ test_1f(hid_t file) TESTING("multiple external files"); if ((dcpl=H5Pcreate(H5P_DATASET_CREATE))<0) goto error; - if (H5Pset_external(dcpl, "ext1.data", 0, (hsize_t)100)<0) goto error; - if (H5Pset_external(dcpl, "ext2.data", 0, (hsize_t)100)<0) goto error; - if (H5Pset_external(dcpl, "ext3.data", 0, (hsize_t)100)<0) goto error; - if (H5Pset_external(dcpl, "ext4.data", 0, (hsize_t)100)<0) goto error; cur_size[0] = max_size[0] = 100; + if (H5Pset_external(dcpl, "ext1.data", 0, + (hsize_t)(max_size[0]*sizeof(int)/4))<0) goto error; + if (H5Pset_external(dcpl, "ext2.data", 0, + (hsize_t)(max_size[0]*sizeof(int)/4))<0) goto error; + if (H5Pset_external(dcpl, "ext3.data", 0, + (hsize_t)(max_size[0]*sizeof(int)/4))<0) goto error; + if (H5Pset_external(dcpl, "ext4.data", 0, + (hsize_t)(max_size[0]*sizeof(int)/4))<0) goto error; if ((space=H5Screate_simple(1, cur_size, max_size))<0) goto error; if ((dset=H5Dcreate(file, "dset6", H5T_NATIVE_INT, space, dcpl))<0) goto error; diff --git a/test/th5s.c b/test/th5s.c index 30b1f2e..e26fe9a 100644 --- a/test/th5s.c +++ b/test/th5s.c @@ -164,8 +164,8 @@ test_h5s_basic(void) * Try reading a file that has been prepared that has a dataset with a * higher dimensionality than what the library can handle. */ - fid1 = H5Fopen("th5s.h5", H5F_ACC_RDONLY, H5P_DEFAULT); - CHECK_I(fid1, "H5Fopen(th5s.h5)"); + fid1 = H5Fopen(FILE, H5F_ACC_RDONLY, H5P_DEFAULT); + CHECK_I(fid1, "H5Fopen"); dset1 = H5Dopen(fid1, "dset"); VERIFY(dset1, FAIL, "H5Dopen"); ret = H5Fclose(fid1); |