diff options
Diffstat (limited to 'hl/test/test_ds.c')
-rw-r--r-- | hl/test/test_ds.c | 488 |
1 files changed, 244 insertions, 244 deletions
diff --git a/hl/test/test_ds.c b/hl/test/test_ds.c index 32622ed..8576b2a 100644 --- a/hl/test/test_ds.c +++ b/hl/test/test_ds.c @@ -32,9 +32,9 @@ static int create_test_file(const char *fileext); static int open_test_file(const char *fileext); herr_t create_char_dataset(hid_t fid, const char *dsidx, int fulldims); herr_t create_short_dataset(hid_t fid, const char *dsidx, int fulldims); -herr_t create_int_dataset(hid_t fid, const char *dsidx, int fulldims); -herr_t create_long_dataset(hid_t fid, const char *dsname, const char *dsidx, int fulldims); -herr_t create_float_dataset(hid_t fid, const char *dsidx, int fulldims); +herr_t create_int_dataset(hid_t fid, const char *dsidx, int fulldims); +herr_t create_long_dataset(hid_t fid, const char *dsname, const char *dsidx, int fulldims); +herr_t create_float_dataset(hid_t fid, const char *dsidx, int fulldims); herr_t create_DS1_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, char *s_wbuf, char *s1_wbuf); herr_t create_DS2_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, char *s_wbuf, char *s1_wbuf, char *s2_wbuf); herr_t create_DS3_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, char *s_wbuf, char *s1_wbuf, char *s2_wbuf, char *s3_wbuf); @@ -168,8 +168,8 @@ int main(void) nerrors += test_samelong_scalenames("2") < 0 ? 1 : 0; nerrors += test_foreign_scaleattached(FOREIGN_FILE1) < 0 ? 1 : 0; nerrors += test_foreign_scaleattached(FOREIGN_FILE2) < 0 ? 1 : 0; - -/* the following tests have not been rewritten to match those above */ + +/* the following tests have not been rewritten to match those above */ nerrors += test_simple() < 0 ?1:0; nerrors += test_errors() < 0 ?1:0; nerrors += test_errors2() < 0 ?1:0; @@ -177,7 +177,7 @@ int main(void) nerrors += test_iterators() < 0 ?1:0; nerrors += test_types() < 0 ?1:0; nerrors += test_data() < 0 ?1:0; - + if(nerrors) goto error; printf("All dimension scales tests passed.\n"); @@ -224,7 +224,7 @@ static hid_t open_test_file(const char *fileext) strcpy(filename, FILENAME); strcat(filename, fileext); strcat(filename, FILEEXT); - + return H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT); } @@ -232,7 +232,7 @@ static hid_t open_test_file(const char *fileext) * create "data" dataset *------------------------------------------------------------------------- */ -herr_t create_char_dataset(hid_t fid, const char *dsidx, int fulldims) +herr_t create_char_dataset(hid_t fid, const char *dsidx, int fulldims) { int rank = 3; int rankds = 1; @@ -261,11 +261,11 @@ herr_t create_char_dataset(hid_t fid, const char *dsidx, int fulldims) /* make a DS dataset for the first dimension */ if(create_DS1_char_datasets(fid, dsidx, rankds, s1_dim, s1_wbuf, NULL) < 0) return FAIL; - + /* make a DS dataset for the second dimension */ if(create_DS2_char_datasets(fid, dsidx, rankds, s2_dim, s2_wbuf, NULL, NULL) < 0) return FAIL; - + /* make a DS dataset for the third dimension */ if(create_DS3_char_datasets(fid, dsidx, rankds, s3_dim, s3_wbuf, NULL, NULL, NULL) < 0) return FAIL; @@ -273,10 +273,10 @@ herr_t create_char_dataset(hid_t fid, const char *dsidx, int fulldims) else { if(create_DS1_char_datasets(fid, dsidx, rankds, s1_dim, s1_wbuf, s11_wbuf) < 0) return FAIL; - + if(create_DS2_char_datasets(fid, dsidx, rankds, s2_dim, s2_wbuf, s21_wbuf, s22_wbuf) < 0) return FAIL; - + if(create_DS3_char_datasets(fid, dsidx, rankds, s3_dim, s3_wbuf, s31_wbuf, s32_wbuf, s33_wbuf) < 0) return FAIL; } @@ -286,7 +286,7 @@ herr_t create_char_dataset(hid_t fid, const char *dsidx, int fulldims) return SUCCEED; } -herr_t create_short_dataset(hid_t fid, const char *dsidx, int fulldims) +herr_t create_short_dataset(hid_t fid, const char *dsidx, int fulldims) { int rank = 3; int rankds = 1; @@ -316,11 +316,11 @@ herr_t create_short_dataset(hid_t fid, const char *dsidx, int fulldims) /* make a DS dataset for the first dimension */ if(create_DS1_short_datasets(fid, dsidx, rankds, s1_dim, s1_wbuf, NULL) < 0) return FAIL; - + /* make a DS dataset for the second dimension */ if(create_DS2_short_datasets(fid, dsidx, rankds, s2_dim, s2_wbuf, NULL, NULL) < 0) return FAIL; - + /* make a DS dataset for the third dimension */ if(create_DS3_short_datasets(fid, dsidx, rankds, s3_dim, s3_wbuf, NULL, NULL, NULL) < 0) return FAIL; @@ -328,10 +328,10 @@ herr_t create_short_dataset(hid_t fid, const char *dsidx, int fulldims) else { if(create_DS1_short_datasets(fid, dsidx, rankds, s1_dim, s1_wbuf, s11_wbuf) < 0) return FAIL; - + if(create_DS2_short_datasets(fid, dsidx, rankds, s2_dim, s2_wbuf, s21_wbuf, s22_wbuf) < 0) return FAIL; - + if(create_DS3_short_datasets(fid, dsidx, rankds, s3_dim, s3_wbuf, s31_wbuf, s32_wbuf, s33_wbuf) < 0) return FAIL; } @@ -341,7 +341,7 @@ herr_t create_short_dataset(hid_t fid, const char *dsidx, int fulldims) return SUCCEED; } -herr_t create_int_dataset(hid_t fid, const char *dsidx, int fulldims) +herr_t create_int_dataset(hid_t fid, const char *dsidx, int fulldims) { int rank = RANK; int rankds = 1; @@ -365,7 +365,7 @@ herr_t create_int_dataset(hid_t fid, const char *dsidx, int fulldims) /* make a DS dataset for the first dimension */ if(create_DS1_int_datasets(fid, dsidx, rankds, s1_dim, s1_wbuf, NULL) < 0) return FAIL; - + /* make a DS dataset for the second dimension */ if(create_DS2_int_datasets(fid, dsidx, rankds, s2_dim, s2_wbuf, NULL, NULL) < 0) return FAIL; @@ -373,7 +373,7 @@ herr_t create_int_dataset(hid_t fid, const char *dsidx, int fulldims) else { if(create_DS1_int_datasets(fid, dsidx, rankds, s1_dim, s1_wbuf, s11_wbuf) < 0) return FAIL; - + if(create_DS2_int_datasets(fid, dsidx, rankds, s2_dim, s2_wbuf, s21_wbuf, s22_wbuf) < 0) return FAIL; } @@ -383,7 +383,7 @@ herr_t create_int_dataset(hid_t fid, const char *dsidx, int fulldims) return SUCCEED; } -herr_t create_long_dataset(hid_t fid, const char *dsname, const char *dsidx, int fulldims) +herr_t create_long_dataset(hid_t fid, const char *dsname, const char *dsidx, int fulldims) { int rank = 4; int rankds = 1; @@ -420,15 +420,15 @@ herr_t create_long_dataset(hid_t fid, const char *dsname, const char *dsidx, int /* make a DS dataset for the first dimension */ if(create_DS1_long_datasets(fid, dsidx, rankds, s1_dim, s1_wbuf, NULL) < 0) return FAIL; - + /* make a DS dataset for the second dimension */ if(create_DS2_long_datasets(fid, dsidx, rankds, s2_dim, s2_wbuf, NULL, NULL) < 0) return FAIL; - + /* make a DS dataset for the third dimension */ if(create_DS3_long_datasets(fid, dsidx, rankds, s3_dim, s3_wbuf, NULL, NULL, NULL) < 0) return FAIL; - + /* make a DS dataset for the fourth dimension */ if(create_DS4_long_datasets(fid, dsidx, rankds, s4_dim, s4_wbuf, NULL, NULL, NULL, NULL) < 0) return FAIL; @@ -436,13 +436,13 @@ herr_t create_long_dataset(hid_t fid, const char *dsname, const char *dsidx, int else { if(create_DS1_long_datasets(fid, dsidx, rankds, s1_dim, s1_wbuf, s11_wbuf) < 0) return FAIL; - + if(create_DS2_long_datasets(fid, dsidx, rankds, s2_dim, s2_wbuf, s21_wbuf, s22_wbuf) < 0) return FAIL; - + if(create_DS3_long_datasets(fid, dsidx, rankds, s3_dim, s3_wbuf, s31_wbuf, s32_wbuf, s33_wbuf) < 0) return FAIL; - + if(create_DS4_long_datasets(fid, dsidx, rankds, s4_dim, s4_wbuf, s41_wbuf, s42_wbuf, s43_wbuf, s44_wbuf) < 0) return FAIL; } @@ -452,7 +452,7 @@ herr_t create_long_dataset(hid_t fid, const char *dsname, const char *dsidx, int return SUCCEED; } -herr_t create_float_dataset(hid_t fid, const char *dsidx, int fulldims) +herr_t create_float_dataset(hid_t fid, const char *dsidx, int fulldims) { int rank = RANK; int rankds = 1; @@ -476,7 +476,7 @@ herr_t create_float_dataset(hid_t fid, const char *dsidx, int fulldims) /* make a DS dataset for the first dimension */ if(create_DS1_float_datasets(fid, dsidx, rankds, s1_dim, s1_wbuf, NULL) < 0) return FAIL; - + /* make a DS dataset for the second dimension */ if(create_DS2_float_datasets(fid, dsidx, rankds, s2_dim, s2_wbuf, NULL, NULL) < 0) return FAIL; @@ -484,7 +484,7 @@ herr_t create_float_dataset(hid_t fid, const char *dsidx, int fulldims) else { if(create_DS1_float_datasets(fid, dsidx, rankds, s1_dim, s1_wbuf, s11_wbuf) < 0) return FAIL; - + if(create_DS2_float_datasets(fid, dsidx, rankds, s2_dim, s2_wbuf, s21_wbuf, s22_wbuf) < 0) return FAIL; } @@ -498,7 +498,7 @@ herr_t create_float_dataset(hid_t fid, const char *dsidx, int fulldims) * create 2 dimension scales datasets for first dimension *------------------------------------------------------------------------- */ -herr_t create_DS1_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, char *s_wbuf, char *s1_wbuf) +herr_t create_DS1_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, char *s_wbuf, char *s1_wbuf) { char name[32]; @@ -523,10 +523,10 @@ herr_t create_DS1_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_ * create 3 dimension scales datasets for second dimension *------------------------------------------------------------------------- */ -herr_t create_DS2_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, char *s_wbuf, char *s1_wbuf, char *s2_wbuf) +herr_t create_DS2_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, char *s_wbuf, char *s1_wbuf, char *s2_wbuf) { char name[32]; - + strcpy(name, DS_2_NAME); strcat(name, dsidx); /* make a DS dataset for the second dimension */ @@ -556,7 +556,7 @@ herr_t create_DS2_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_ * create 1 dimension scales datasets for third dimension of dataset *------------------------------------------------------------------------- */ -herr_t create_DS3_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, char *s_wbuf, char *s1_wbuf, char *s2_wbuf, char *s3_wbuf) +herr_t create_DS3_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, char *s_wbuf, char *s1_wbuf, char *s2_wbuf, char *s3_wbuf) { char name[32]; @@ -597,7 +597,7 @@ herr_t create_DS3_char_datasets(hid_t fid, const char *dsidx, int rankds, hsize_ * create 2 dimension scales datasets for first dimension *------------------------------------------------------------------------- */ -herr_t create_DS1_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, short *s_wbuf, short *s1_wbuf) +herr_t create_DS1_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, short *s_wbuf, short *s1_wbuf) { char name[32]; @@ -622,10 +622,10 @@ herr_t create_DS1_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize * create 3 dimension scales datasets for second dimension *------------------------------------------------------------------------- */ -herr_t create_DS2_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, short *s_wbuf, short *s1_wbuf, short *s2_wbuf) +herr_t create_DS2_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, short *s_wbuf, short *s1_wbuf, short *s2_wbuf) { char name[32]; - + strcpy(name, DS_2_NAME); strcat(name, dsidx); @@ -656,7 +656,7 @@ herr_t create_DS2_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize * create 1 dimension scales datasets for third dimension of dataset *------------------------------------------------------------------------- */ -herr_t create_DS3_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, short *s_wbuf, short *s1_wbuf, short *s2_wbuf, short *s3_wbuf) +herr_t create_DS3_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, short *s_wbuf, short *s1_wbuf, short *s2_wbuf, short *s3_wbuf) { char name[32]; @@ -698,7 +698,7 @@ herr_t create_DS3_short_datasets(hid_t fid, const char *dsidx, int rankds, hsize * create 2 dimension scales datasets for first dimension *------------------------------------------------------------------------- */ -herr_t create_DS1_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, int *s_wbuf, int *s1_wbuf) +herr_t create_DS1_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, int *s_wbuf, int *s1_wbuf) { char name[32]; @@ -724,10 +724,10 @@ herr_t create_DS1_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t * create 3 dimension scales datasets for second dimension *------------------------------------------------------------------------- */ -herr_t create_DS2_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, int *s_wbuf, int *s1_wbuf, int *s2_wbuf) +herr_t create_DS2_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, int *s_wbuf, int *s1_wbuf, int *s2_wbuf) { char name[32]; - + strcpy(name, DS_2_NAME); strcat(name, dsidx); @@ -758,7 +758,7 @@ herr_t create_DS2_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t * create 1 dimension scales datasets for third dimension of dataset *------------------------------------------------------------------------- */ -herr_t create_DS3_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, int *s_wbuf, int *s1_wbuf, int *s2_wbuf, int *s3_wbuf) +herr_t create_DS3_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, int *s_wbuf, int *s1_wbuf, int *s2_wbuf, int *s3_wbuf) { char name[32]; @@ -800,7 +800,7 @@ herr_t create_DS3_int_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t * create 2 dimension scales datasets for first dimension *------------------------------------------------------------------------- */ -herr_t create_DS1_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, long *s_wbuf, long *s1_wbuf) +herr_t create_DS1_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, long *s_wbuf, long *s1_wbuf) { char name[32]; @@ -826,10 +826,10 @@ herr_t create_DS1_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_ * create 3 dimension scales datasets for second dimension *------------------------------------------------------------------------- */ -herr_t create_DS2_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, long *s_wbuf, long *s1_wbuf, long *s2_wbuf) +herr_t create_DS2_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, long *s_wbuf, long *s1_wbuf, long *s2_wbuf) { char name[32]; - + strcpy(name, DS_2_NAME); strcat(name, dsidx); @@ -860,7 +860,7 @@ herr_t create_DS2_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_ * create 3 dimension scales datasets for third dimension of dataset *------------------------------------------------------------------------- */ -herr_t create_DS3_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, long *s_wbuf, long *s1_wbuf, long *s2_wbuf, long *s3_wbuf) +herr_t create_DS3_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, long *s_wbuf, long *s1_wbuf, long *s2_wbuf, long *s3_wbuf) { char name[32]; @@ -902,7 +902,7 @@ herr_t create_DS3_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_ * create 4 dimension scales datasets for third dimension of dataset *------------------------------------------------------------------------- */ -herr_t create_DS4_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, long *s_wbuf, long *s1_wbuf, long *s2_wbuf, long *s3_wbuf, long *s4_wbuf) +herr_t create_DS4_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, long *s_wbuf, long *s1_wbuf, long *s2_wbuf, long *s3_wbuf, long *s4_wbuf) { char name[32]; @@ -952,7 +952,7 @@ herr_t create_DS4_long_datasets(hid_t fid, const char *dsidx, int rankds, hsize_ * create 2 dimension scales datasets for first dimension *------------------------------------------------------------------------- */ -herr_t create_DS1_float_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, float *s_wbuf, float *s1_wbuf) +herr_t create_DS1_float_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, float *s_wbuf, float *s1_wbuf) { char name[32]; @@ -978,10 +978,10 @@ herr_t create_DS1_float_datasets(hid_t fid, const char *dsidx, int rankds, hsize * create 3 dimension scales datasets for second dimension *------------------------------------------------------------------------- */ -herr_t create_DS2_float_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, float *s_wbuf, float *s1_wbuf, float *s2_wbuf) +herr_t create_DS2_float_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, float *s_wbuf, float *s1_wbuf, float *s2_wbuf) { char name[32]; - + strcpy(name, DS_2_NAME); strcat(name, dsidx); @@ -1012,7 +1012,7 @@ herr_t create_DS2_float_datasets(hid_t fid, const char *dsidx, int rankds, hsize * create 3 dimension scales datasets for third dimension of dataset *------------------------------------------------------------------------- */ -herr_t create_DS3_float_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, float *s_wbuf, float *s1_wbuf, float *s2_wbuf, float *s3_wbuf) +herr_t create_DS3_float_datasets(hid_t fid, const char *dsidx, int rankds, hsize_t *s_dim, float *s_wbuf, float *s1_wbuf, float *s2_wbuf, float *s3_wbuf) { char name[32]; @@ -1050,11 +1050,11 @@ herr_t create_DS3_float_datasets(hid_t fid, const char *dsidx, int rankds, hsize return SUCCEED; } -herr_t test_attach_scale(hid_t fid, hid_t did, const char *name, unsigned int idx) +herr_t test_attach_scale(hid_t fid, hid_t did, const char *name, unsigned int idx) { herr_t ret_value = FAIL; hid_t dsid = -1; - + if((dsid = H5Dopen2(fid, name, H5P_DEFAULT)) >= 0) { if(H5DSis_attached(did, dsid, idx) == 0) { if(H5DSattach_scale(did, dsid, idx) >= 0) { @@ -1074,7 +1074,7 @@ herr_t test_attach_scale(hid_t fid, hid_t did, const char *name, unsigned int id return ret_value; } -herr_t test_detach_scale(hid_t fid, hid_t did, const char *name, unsigned int idx) +herr_t test_detach_scale(hid_t fid, hid_t did, const char *name, unsigned int idx) { herr_t ret_value = FAIL; hid_t dsid = -1; @@ -1094,11 +1094,11 @@ herr_t test_detach_scale(hid_t fid, hid_t did, const char *name, unsigned int id return ret_value; } -herr_t test_set_scalename(hid_t fid, hid_t did, const char *name, const char *scalename, unsigned int idx) +herr_t test_set_scalename(hid_t fid, hid_t did, const char *name, const char *scalename, unsigned int idx) { herr_t ret_value = FAIL; hid_t dsid = -1; - + if((dsid = H5Dopen2(fid, name, H5P_DEFAULT)) >= 0) { if(H5DSis_attached(did, dsid, idx) == 1) { if(H5DSset_scale(dsid, scalename) >= 0) { @@ -1114,7 +1114,7 @@ herr_t test_set_scalename(hid_t fid, hid_t did, const char *name, const char *sc return ret_value; } -herr_t test_cmp_scalename(hid_t fid, hid_t did, const char *name, const char *scalename, unsigned int idx) +herr_t test_cmp_scalename(hid_t fid, hid_t did, const char *name, const char *scalename, unsigned int idx) { herr_t ret_value = FAIL; hid_t dsid = -1; @@ -1151,12 +1151,12 @@ static int test_char_attachscales(const char *fileext) char scalename[32]; strcpy(dsname, DATASET_NAME); strcat(dsname, "ac"); - + TESTING2("test_char_attachscales"); - + if((fid = open_test_file(fileext)) < 0) goto out; - + /* make a dataset */ if(create_char_dataset(fid, "ac", 0) < 0) goto out; @@ -1166,17 +1166,17 @@ static int test_char_attachscales(const char *fileext) strcat(scalename, "ac"); if(test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - + strcpy(scalename, DS_2_NAME); strcat(scalename, "ac"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - + strcpy(scalename, DS_3_NAME); strcat(scalename, "ac"); if(test_attach_scale(fid, did, scalename, DIM2) < 0) goto out; - + if(H5Dclose(did) < 0) goto out; } @@ -1184,18 +1184,18 @@ static int test_char_attachscales(const char *fileext) goto out; PASSED(); - + H5Fclose(fid); return SUCCEED; - + out: H5E_BEGIN_TRY { H5Dclose(did); H5Fclose(fid); } H5E_END_TRY; - + H5_FAILED(); - + return FAIL; } @@ -1207,12 +1207,12 @@ static int test_short_attachscales(const char *fileext) char scalename[32]; strcpy(dsname, DATASET_NAME); strcat(dsname, "as"); - + TESTING2("test_short_attachscales"); - + if((fid = open_test_file(fileext)) < 0) goto out; - + /* make a dataset */ if(create_short_dataset(fid, "as", 1) < 0) goto out; @@ -1222,47 +1222,47 @@ static int test_short_attachscales(const char *fileext) strcat(scalename, "as"); if(test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - + strcpy(scalename, DS_11_NAME); strcat(scalename, "as"); if(test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - + strcpy(scalename, DS_2_NAME); strcat(scalename, "as"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - + strcpy(scalename, DS_21_NAME); strcat(scalename, "as"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - + strcpy(scalename, DS_22_NAME); strcat(scalename, "as"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - + strcpy(scalename, DS_3_NAME); strcat(scalename, "as"); if(test_attach_scale(fid, did, scalename, DIM2) < 0) goto out; - + strcpy(scalename, DS_31_NAME); strcat(scalename, "as"); if(test_attach_scale(fid, did, scalename, DIM2) < 0) goto out; - + strcpy(scalename, DS_32_NAME); strcat(scalename, "as"); if(test_attach_scale(fid, did, scalename, DIM2) < 0) goto out; - + strcpy(scalename, DS_33_NAME); strcat(scalename, "as"); if(test_attach_scale(fid, did, scalename, DIM2) < 0) goto out; - + if(H5Dclose(did) < 0) goto out; } @@ -1270,18 +1270,18 @@ static int test_short_attachscales(const char *fileext) goto out; PASSED(); - + H5Fclose(fid); return SUCCEED; - + out: H5E_BEGIN_TRY { H5Dclose(did); H5Fclose(fid); } H5E_END_TRY; - + H5_FAILED(); - + return FAIL; } @@ -1293,12 +1293,12 @@ static int test_int_attachscales(const char *fileext) char scalename[32]; strcpy(dsname, DATASET_NAME); strcat(dsname, "a"); - + TESTING2("test_int_attachscales"); - + if((fid = open_test_file(fileext)) < 0) goto out; - + /* make a dataset */ if(create_int_dataset(fid, "a", 1) < 0) goto out; @@ -1308,27 +1308,27 @@ static int test_int_attachscales(const char *fileext) strcat(scalename, "a"); if(test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - + strcpy(scalename, DS_11_NAME); strcat(scalename, "a"); if(test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - + strcpy(scalename, DS_2_NAME); strcat(scalename, "a"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - + strcpy(scalename, DS_21_NAME); strcat(scalename, "a"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - + strcpy(scalename, DS_22_NAME); strcat(scalename, "a"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - + if(H5Dclose(did) < 0) goto out; } @@ -1336,18 +1336,18 @@ static int test_int_attachscales(const char *fileext) goto out; PASSED(); - + H5Fclose(fid); return SUCCEED; - + out: H5E_BEGIN_TRY { H5Dclose(did); H5Fclose(fid); } H5E_END_TRY; - + H5_FAILED(); - + return FAIL; } @@ -1359,12 +1359,12 @@ static int test_long_attachscales(const char *fileext) char scalename[32]; strcpy(dsname, DATASET_NAME); strcat(dsname, "al"); - + TESTING2("test_long_attachscales"); - + if((fid = open_test_file(fileext)) < 0) goto out; - + /* make a dataset */ if(create_long_dataset(fid, dsname, "al", 0) < 0) goto out; @@ -1374,22 +1374,22 @@ static int test_long_attachscales(const char *fileext) strcat(scalename, "al"); if(test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - + strcpy(scalename, DS_2_NAME); strcat(scalename, "al"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - + strcpy(scalename, DS_3_NAME); strcat(scalename, "al"); if(test_attach_scale(fid, did, scalename, DIM2) < 0) goto out; - + strcpy(scalename, DS_4_NAME); strcat(scalename, "al"); if(test_attach_scale(fid, did, scalename, DIM3) < 0) goto out; - + if(H5Dclose(did) < 0) goto out; } @@ -1397,18 +1397,18 @@ static int test_long_attachscales(const char *fileext) goto out; PASSED(); - + H5Fclose(fid); return SUCCEED; - + out: H5E_BEGIN_TRY { H5Dclose(did); H5Fclose(fid); } H5E_END_TRY; - + H5_FAILED(); - + return FAIL; } @@ -1420,12 +1420,12 @@ static int test_duplicatelong_attachscales(const char *fileext) char scalename[32]; strcpy(dsname, DATASET_NAME); strcat(dsname, "al2"); - + TESTING2("test_duplicatelong_attachscales"); - + if((fid = open_test_file(fileext)) < 0) goto out; - + /* make a dataset 2 */ if(create_long_dataset(fid, dsname, "al2", 0) < 0) goto out; @@ -1435,22 +1435,22 @@ static int test_duplicatelong_attachscales(const char *fileext) strcat(scalename, "al"); if(test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - + strcpy(scalename, DS_2_NAME); strcat(scalename, "al"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - + strcpy(scalename, DS_3_NAME); strcat(scalename, "al"); if(test_attach_scale(fid, did, scalename, DIM2) < 0) goto out; - + strcpy(scalename, DS_4_NAME); strcat(scalename, "al"); if(test_attach_scale(fid, did, scalename, DIM3) < 0) goto out; - + if(H5Dclose(did) < 0) goto out; } @@ -1458,18 +1458,18 @@ static int test_duplicatelong_attachscales(const char *fileext) goto out; PASSED(); - + H5Fclose(fid); return SUCCEED; - + out: H5E_BEGIN_TRY { H5Dclose(did); H5Fclose(fid); } H5E_END_TRY; - + H5_FAILED(); - + return FAIL; } @@ -1481,12 +1481,12 @@ static int test_float_attachscales(const char *fileext) char scalename[32]; strcpy(dsname, DATASET_NAME); strcat(dsname, "af"); - + TESTING2("test_float_attachscales"); - + if((fid = open_test_file(fileext)) < 0) goto out; - + /* make a dataset */ if(create_float_dataset(fid, "af", 1) < 0) goto out; @@ -1496,27 +1496,27 @@ static int test_float_attachscales(const char *fileext) strcat(scalename, "af"); if(test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - + strcpy(scalename, DS_11_NAME); strcat(scalename, "af"); if(test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - + strcpy(scalename, DS_2_NAME); strcat(scalename, "af"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - + strcpy(scalename, DS_21_NAME); strcat(scalename, "af"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - + strcpy(scalename, DS_22_NAME); strcat(scalename, "af"); if(test_attach_scale(fid, did, scalename, DIM1) < 0) goto out; - + if(H5Dclose(did) < 0) goto out; } @@ -1524,18 +1524,18 @@ static int test_float_attachscales(const char *fileext) goto out; PASSED(); - + H5Fclose(fid); return SUCCEED; - + out: H5E_BEGIN_TRY { H5Dclose(did); H5Fclose(fid); } H5E_END_TRY; - + H5_FAILED(); - + return FAIL; } @@ -1548,25 +1548,25 @@ static int test_numberofscales(const char *fileext) char scalename[32]; strcpy(dsname, DATASET_NAME); strcat(dsname, "a"); - + TESTING2("test_numberofscales"); - + if((fid = open_test_file(fileext)) < 0) goto out; if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { if((nscales = H5DSget_num_scales(did, 0)) < 0) goto out; - + if(nscales != 2) goto out; - + if((nscales = H5DSget_num_scales(did, 1)) < 0) goto out; - + if(nscales != 3) goto out; - + if(H5Dclose(did) < 0) goto out; } @@ -1586,19 +1586,19 @@ static int test_numberofscales(const char *fileext) strcat(scalename, "b"); if(test_attach_scale(fid, did, scalename, DIM0) < 0) goto out; - + if((nscales = H5DSget_num_scales(did, 0)) < 0) goto out; - + if(nscales != 1) goto out; - + if((nscales = H5DSget_num_scales(did, 1)) < 0) goto out; - + if(nscales != 0) goto out; - + if(H5Dclose(did) < 0) goto out; } @@ -1606,18 +1606,18 @@ static int test_numberofscales(const char *fileext) goto out; PASSED(); - + H5Fclose(fid); return SUCCEED; - + out: H5E_BEGIN_TRY { H5Dclose(did); H5Fclose(fid); } H5E_END_TRY; - + H5_FAILED(); - + return FAIL; } @@ -1629,10 +1629,10 @@ static int test_char_scalenames(const char *fileext) { char name[32]; strcpy(dsname, DATASET_NAME); strcat(dsname, "ac"); - + if((fid = open_test_file(fileext)) < 0) goto out; - + TESTING2("set char scale/cmp scale name"); if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { strcpy(scalename, DS_1_NAME); @@ -1644,7 +1644,7 @@ static int test_char_scalenames(const char *fileext) { if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - + strcpy(scalename, DS_2_NAME); strcat(scalename, "ac"); strcpy(name, SCALE_2_NAME); @@ -1654,7 +1654,7 @@ static int test_char_scalenames(const char *fileext) { if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - + strcpy(scalename, DS_3_NAME); strcat(scalename, "ac"); strcpy(name, SCALE_3_NAME); @@ -1664,7 +1664,7 @@ static int test_char_scalenames(const char *fileext) { if(test_cmp_scalename(fid, did, scalename, name, DIM2) < 0) goto out; - + if(H5Dclose(did) < 0) goto out; } @@ -1672,18 +1672,18 @@ static int test_char_scalenames(const char *fileext) { goto out; PASSED(); - + H5Fclose(fid); return SUCCEED; - + out: H5E_BEGIN_TRY { H5Dclose(did); H5Fclose(fid); } H5E_END_TRY; - + H5_FAILED(); - + return FAIL; } @@ -1695,10 +1695,10 @@ static int test_short_scalenames(const char *fileext) { char name[32]; strcpy(dsname, DATASET_NAME); strcat(dsname, "as"); - + if((fid = open_test_file(fileext)) < 0) goto out; - + TESTING2("set short scale/cmp scale name"); if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { strcpy(scalename, DS_1_NAME); @@ -1710,7 +1710,7 @@ static int test_short_scalenames(const char *fileext) { if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - + strcpy(scalename, DS_11_NAME); strcat(scalename, "as"); strcpy(name, SCALE_11_NAME); @@ -1720,7 +1720,7 @@ static int test_short_scalenames(const char *fileext) { if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - + strcpy(scalename, DS_2_NAME); strcat(scalename, "as"); strcpy(name, SCALE_2_NAME); @@ -1730,7 +1730,7 @@ static int test_short_scalenames(const char *fileext) { if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - + strcpy(scalename, DS_21_NAME); strcat(scalename, "as"); strcpy(name, SCALE_21_NAME); @@ -1740,7 +1740,7 @@ static int test_short_scalenames(const char *fileext) { if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - + strcpy(scalename, DS_22_NAME); strcat(scalename, "as"); strcpy(name, SCALE_22_NAME); @@ -1750,7 +1750,7 @@ static int test_short_scalenames(const char *fileext) { if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - + strcpy(scalename, DS_3_NAME); strcat(scalename, "as"); strcpy(name, SCALE_3_NAME); @@ -1760,7 +1760,7 @@ static int test_short_scalenames(const char *fileext) { if(test_cmp_scalename(fid, did, scalename, name, DIM2) < 0) goto out; - + strcpy(scalename, DS_31_NAME); strcat(scalename, "as"); strcpy(name, SCALE_31_NAME); @@ -1770,7 +1770,7 @@ static int test_short_scalenames(const char *fileext) { if(test_cmp_scalename(fid, did, scalename, name, DIM2) < 0) goto out; - + strcpy(scalename, DS_32_NAME); strcat(scalename, "as"); strcpy(name, SCALE_32_NAME); @@ -1780,7 +1780,7 @@ static int test_short_scalenames(const char *fileext) { if(test_cmp_scalename(fid, did, scalename, name, DIM2) < 0) goto out; - + strcpy(scalename, DS_33_NAME); strcat(scalename, "as"); strcpy(name, SCALE_33_NAME); @@ -1790,7 +1790,7 @@ static int test_short_scalenames(const char *fileext) { if(test_cmp_scalename(fid, did, scalename, name, DIM2) < 0) goto out; - + if(H5Dclose(did) < 0) goto out; } @@ -1798,18 +1798,18 @@ static int test_short_scalenames(const char *fileext) { goto out; PASSED(); - + H5Fclose(fid); return SUCCEED; - + out: H5E_BEGIN_TRY { H5Dclose(did); H5Fclose(fid); } H5E_END_TRY; - + H5_FAILED(); - + return FAIL; } @@ -1821,10 +1821,10 @@ static int test_int_scalenames(const char *fileext) { char name[32]; strcpy(dsname, DATASET_NAME); strcat(dsname, "a"); - + if((fid = open_test_file(fileext)) < 0) goto out; - + TESTING2("set int scale/cmp scale name"); if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { strcpy(scalename, DS_1_NAME); @@ -1836,7 +1836,7 @@ static int test_int_scalenames(const char *fileext) { if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - + strcpy(scalename, DS_11_NAME); strcat(scalename, "a"); strcpy(name, SCALE_11_NAME); @@ -1846,7 +1846,7 @@ static int test_int_scalenames(const char *fileext) { if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - + strcpy(scalename, DS_2_NAME); strcat(scalename, "a"); strcpy(name, SCALE_2_NAME); @@ -1856,7 +1856,7 @@ static int test_int_scalenames(const char *fileext) { if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - + strcpy(scalename, DS_21_NAME); strcat(scalename, "a"); strcpy(name, SCALE_21_NAME); @@ -1866,7 +1866,7 @@ static int test_int_scalenames(const char *fileext) { if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - + strcpy(scalename, DS_22_NAME); strcat(scalename, "a"); strcpy(name, SCALE_22_NAME); @@ -1884,18 +1884,18 @@ static int test_int_scalenames(const char *fileext) { goto out; PASSED(); - + H5Fclose(fid); return 0; - + out: H5E_BEGIN_TRY { H5Dclose(did); H5Fclose(fid); } H5E_END_TRY; - + H5_FAILED(); - + return FAIL; } @@ -1907,10 +1907,10 @@ static int test_long_scalenames(const char *fileext) { char name[32]; strcpy(dsname, DATASET_NAME); strcat(dsname, "al"); - + if((fid = open_test_file(fileext)) < 0) goto out; - + TESTING2("set long scale/cmp scale name"); if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { strcpy(scalename, DS_1_NAME); @@ -1922,7 +1922,7 @@ static int test_long_scalenames(const char *fileext) { if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - + strcpy(scalename, DS_2_NAME); strcat(scalename, "al"); strcpy(name, SCALE_2_NAME); @@ -1932,7 +1932,7 @@ static int test_long_scalenames(const char *fileext) { if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - + strcpy(scalename, DS_3_NAME); strcat(scalename, "al"); strcpy(name, SCALE_3_NAME); @@ -1942,7 +1942,7 @@ static int test_long_scalenames(const char *fileext) { if(test_cmp_scalename(fid, did, scalename, name, DIM2) < 0) goto out; - + strcpy(scalename, DS_4_NAME); strcat(scalename, "al"); strcpy(name, SCALE_4_NAME); @@ -1952,7 +1952,7 @@ static int test_long_scalenames(const char *fileext) { if(test_cmp_scalename(fid, did, scalename, name, DIM3) < 0) goto out; - + if(H5Dclose(did) < 0) goto out; } @@ -1960,18 +1960,18 @@ static int test_long_scalenames(const char *fileext) { goto out; PASSED(); - + H5Fclose(fid); return SUCCEED; - + out: H5E_BEGIN_TRY { H5Dclose(did); H5Fclose(fid); } H5E_END_TRY; - + H5_FAILED(); - + return FAIL; } @@ -1983,10 +1983,10 @@ static int test_samelong_scalenames(const char *fileext) { char name[32]; strcpy(dsname, DATASET_NAME); strcat(dsname, "al2"); - + if((fid = open_test_file(fileext)) < 0) goto out; - + TESTING2("set same long scale/cmp scale name"); if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { strcpy(scalename, DS_1_NAME); @@ -1998,7 +1998,7 @@ static int test_samelong_scalenames(const char *fileext) { if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - + strcpy(scalename, DS_2_NAME); strcat(scalename, "al"); strcpy(name, DS_2_NAME); @@ -2008,7 +2008,7 @@ static int test_samelong_scalenames(const char *fileext) { if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - + strcpy(scalename, DS_3_NAME); strcat(scalename, "al"); strcpy(name, DS_3_NAME); @@ -2018,7 +2018,7 @@ static int test_samelong_scalenames(const char *fileext) { if(test_cmp_scalename(fid, did, scalename, name, DIM2) < 0) goto out; - + strcpy(scalename, DS_4_NAME); strcat(scalename, "al"); strcpy(name, DS_4_NAME); @@ -2028,7 +2028,7 @@ static int test_samelong_scalenames(const char *fileext) { if(test_cmp_scalename(fid, did, scalename, name, DIM3) < 0) goto out; - + if(H5Dclose(did) < 0) goto out; } @@ -2036,18 +2036,18 @@ static int test_samelong_scalenames(const char *fileext) { goto out; PASSED(); - + H5Fclose(fid); return SUCCEED; - + out: H5E_BEGIN_TRY { H5Dclose(did); H5Fclose(fid); } H5E_END_TRY; - + H5_FAILED(); - + return FAIL; } @@ -2059,10 +2059,10 @@ static int test_float_scalenames(const char *fileext) { char name[32]; strcpy(dsname, DATASET_NAME); strcat(dsname, "af"); - + if((fid = open_test_file(fileext)) < 0) goto out; - + TESTING2("set float scale/cmp scale name"); if((did = H5Dopen2(fid, dsname, H5P_DEFAULT)) >= 0) { strcpy(scalename, DS_1_NAME); @@ -2074,7 +2074,7 @@ static int test_float_scalenames(const char *fileext) { if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - + strcpy(scalename, DS_11_NAME); strcat(scalename, "af"); strcpy(name, SCALE_11_NAME); @@ -2084,7 +2084,7 @@ static int test_float_scalenames(const char *fileext) { if(test_cmp_scalename(fid, did, scalename, name, DIM0) < 0) goto out; - + strcpy(scalename, DS_2_NAME); strcat(scalename, "af"); strcpy(name, SCALE_2_NAME); @@ -2094,7 +2094,7 @@ static int test_float_scalenames(const char *fileext) { if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - + strcpy(scalename, DS_21_NAME); strcat(scalename, "af"); strcpy(name, SCALE_21_NAME); @@ -2104,7 +2104,7 @@ static int test_float_scalenames(const char *fileext) { if(test_cmp_scalename(fid, did, scalename, name, DIM1) < 0) goto out; - + strcpy(scalename, DS_22_NAME); strcat(scalename, "af"); strcpy(name, SCALE_22_NAME); @@ -2122,18 +2122,18 @@ static int test_float_scalenames(const char *fileext) { goto out; PASSED(); - + H5Fclose(fid); return 0; - + out: H5E_BEGIN_TRY { H5Dclose(did); H5Fclose(fid); } H5E_END_TRY; - + H5_FAILED(); - + return FAIL; } @@ -2152,7 +2152,7 @@ static int test_foreign_scaleattached(const char *fileforeign) strcat(filename,"/"); } strcat(filename, fileforeign); - + TESTING2("test_foreign_scaleattached"); if((fid = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) @@ -2162,7 +2162,7 @@ static int test_foreign_scaleattached(const char *fileforeign) if((dsid = H5Dopen2(fid, "/ds_4_al", H5P_DEFAULT)) >= 0) { if(H5DSis_attached(did, dsid, 3) == 1) { ret_value = SUCCEED; - } + } if(H5Dclose(dsid) < 0) goto out; } @@ -2171,23 +2171,23 @@ static int test_foreign_scaleattached(const char *fileforeign) } else goto out; - + if(ret_value == FAIL) goto out; - + PASSED(); - + H5Fclose(fid); return 0; - + out: H5E_BEGIN_TRY { H5Dclose(did); H5Fclose(fid); } H5E_END_TRY; - + H5_FAILED(); - + return FAIL; } @@ -2226,7 +2226,7 @@ static int test_simple(void) char *name_out=NULL; char snames[3]; int i, j; - + printf("Testing API functions\n"); /*------------------------------------------------------------------------- @@ -2391,7 +2391,7 @@ static int test_simple(void) if(H5Dclose(did) < 0) goto out; - + /*------------------------------------------------------------------------- * H5DSdetach_scale @@ -2984,7 +2984,7 @@ static int test_simple(void) PASSED(); - + /*------------------------------------------------------------------------- * H5DSset_label, H5DSget_label *------------------------------------------------------------------------- @@ -3406,7 +3406,7 @@ static int test_simple(void) /* error zone */ out: - H5E_BEGIN_TRY + H5E_BEGIN_TRY { H5Dclose(did); H5Dclose(dsid); @@ -3544,7 +3544,7 @@ static herr_t read_scale(hid_t dset, unsigned dim, hid_t scale_id, void *visitor /* error zone */ out: - H5E_BEGIN_TRY + H5E_BEGIN_TRY { H5Sclose(sid); H5Tclose(tid); @@ -3634,7 +3634,7 @@ static herr_t match_dim_scale(hid_t did, unsigned dim, hid_t dsid, void *visitor return ret; out: - H5E_BEGIN_TRY + H5E_BEGIN_TRY { H5Sclose(sid); } H5E_END_TRY; @@ -3645,7 +3645,7 @@ out: /*------------------------------------------------------------------------- * Function: op_continue * - * Purpose: example operator function used by H5DSiterate_scales that continues + * Purpose: example operator function used by H5DSiterate_scales that continues * iteration and increments visitor_data (Note: int*) * * Return: @@ -3678,7 +3678,7 @@ static herr_t op_continue(hid_t dset, unsigned dim, hid_t scale_id, void *visito /*------------------------------------------------------------------------- * Function: op_stop * - * Purpose: example operator function used by H5DSiterate_scales that stops + * Purpose: example operator function used by H5DSiterate_scales that stops * iteration and increments visitor_data (Note: int*) * * Return: @@ -3698,7 +3698,7 @@ static herr_t op_stop(hid_t dset, unsigned dim, hid_t scale_id, void *visitor_da dset = dset; dim = dim; scale_id = scale_id; - + if ( visitor_data != NULL ) { (*(int *)visitor_data)++; @@ -4073,7 +4073,7 @@ static int test_errors(void) /* error zone */ out: - H5E_BEGIN_TRY + H5E_BEGIN_TRY { H5Sclose(sid); H5Sclose(sidds); @@ -4265,7 +4265,7 @@ static int test_iterators(void) /* error zone */ out: - H5E_BEGIN_TRY + H5E_BEGIN_TRY { H5Gclose(gid); H5Dclose(did); @@ -4474,7 +4474,7 @@ static int test_rank(void) /* error zone */ out: - H5E_BEGIN_TRY + H5E_BEGIN_TRY { H5Dclose(did); H5Dclose(dsid); @@ -4654,7 +4654,7 @@ static int test_types(void) /* error zone */ out: - H5E_BEGIN_TRY + H5E_BEGIN_TRY { H5Dclose(did); H5Dclose(dsid); @@ -4734,7 +4734,7 @@ static int test_data(void) goto out; if(H5Pset_fill_value(dcpl, H5T_NATIVE_FLOAT, &fill) < 0) goto out; - + /* read ASCII bathymetry data and dimensions to create dataset */ if(read_data("dsdata.txt",2,dims,&vals) < 0) goto out; @@ -4813,7 +4813,7 @@ static int test_data(void) /* error zone */ out: - H5E_BEGIN_TRY + H5E_BEGIN_TRY { H5Dclose(did); H5Dclose(dsid); @@ -4845,9 +4845,9 @@ out: *------------------------------------------------------------------------- */ -static int read_data( const char* fname, - int ndims, - hsize_t *dims, +static int read_data( const char* fname, + int ndims, + hsize_t *dims, float **buf ) { int i, n; @@ -4922,7 +4922,7 @@ static int test_errors2(void) int scale_idx; /* scale index */ int nscales; /* number of scales in DIM */ int count; /* visitor data */ - + printf("Testing parameter errors\n"); /*------------------------------------------------------------------------- @@ -4987,7 +4987,7 @@ static int test_errors2(void) if (H5Dclose(dsid) < 0) goto out; if (H5Dclose(did) < 0) - goto out; + goto out; PASSED(); @@ -5004,15 +5004,15 @@ static int test_errors2(void) if (H5DSset_label(did,0,"label") < 0) goto out; if (H5DSget_label(did,2,lbuf,sizeof(lbuf)) == SUCCEED) - goto out; + goto out; if ((label_len=H5DSget_label(did,0,NULL,0)) < 0) - goto out; + goto out; if ( label_len != strlen("label") ) goto out; if (H5DSget_label(did,0,lbuf,sizeof(lbuf)) < 0) goto out; if (H5Dclose(did) < 0) - goto out; + goto out; PASSED(); @@ -5049,10 +5049,10 @@ static int test_errors2(void) if (H5DSiterate_scales(did,2,NULL,op_continue,NULL)== SUCCEED) goto out; /* invalid DS_IDX */ - scale_idx = 2; + scale_idx = 2; if (H5DSiterate_scales(did,0,&scale_idx,op_continue,NULL)== SUCCEED) goto out; - + /* continue iteration */ scale_idx = 0; count = 0; @@ -5075,9 +5075,9 @@ static int test_errors2(void) goto out; } - + if (H5Dclose(did) < 0) - goto out; + goto out; /*------------------------------------------------------------------------- * close @@ -5092,7 +5092,7 @@ static int test_errors2(void) /* error zone */ out: - H5E_BEGIN_TRY + H5E_BEGIN_TRY { H5Dclose(did); H5Dclose(dsid); |