diff options
author | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2012-10-31 14:40:23 (GMT) |
---|---|---|
committer | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2012-10-31 14:40:23 (GMT) |
commit | efd4ae1f3775e3465b7b3425ed125e3b776b1565 (patch) | |
tree | fbae9db3b259d7c4b4d4fbc0ce1294a3ae49e1a1 /test | |
parent | e73031c90cb33d9d14de73cd2777eb3f99fa2c32 (diff) | |
parent | 51c5bf8aa76cf378ccd59b02247fb7cd0d9b3eaf (diff) | |
download | hdf5-efd4ae1f3775e3465b7b3425ed125e3b776b1565.zip hdf5-efd4ae1f3775e3465b7b3425ed125e3b776b1565.tar.gz hdf5-efd4ae1f3775e3465b7b3425ed125e3b776b1565.tar.bz2 |
[svn-r22995] merge from trunk up to 22994.
Diffstat (limited to 'test')
-rw-r--r-- | test/Makefile.in | 2 | ||||
-rw-r--r-- | test/enum.c | 102 | ||||
-rw-r--r-- | test/links.c | 87 | ||||
-rw-r--r-- | test/mount.c | 75 |
4 files changed, 149 insertions, 117 deletions
diff --git a/test/Makefile.in b/test/Makefile.in index 5314d2e..6632526 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -573,7 +573,6 @@ FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ GPFS = @GPFS@ GREP = @GREP@ -H5BLD_STATIC = @H5BLD_STATIC@ H5_CFLAGS = @H5_CFLAGS@ H5_CPPFLAGS = @H5_CPPFLAGS@ H5_CXXFLAGS = @H5_CXXFLAGS@ @@ -588,7 +587,6 @@ HAVE_DMALLOC = @HAVE_DMALLOC@ HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@ HDF5_HL = @HDF5_HL@ HDF5_INTERFACES = @HDF5_INTERFACES@ -HDF5_USE_SHLIB = @HDF5_USE_SHLIB@ HDF_CXX = @HDF_CXX@ HDF_FORTRAN = @HDF_FORTRAN@ HDF_FORTRAN2003 = @HDF_FORTRAN2003@ diff --git a/test/enum.c b/test/enum.c index 3684102..29b702d 100644 --- a/test/enum.c +++ b/test/enum.c @@ -109,9 +109,9 @@ test_named(hid_t file) /*------------------------------------------------------------------------- - * Function: test_noconv + * Function: test_conv * - * Purpose: Tests creation of datasets when no conversion is present. + * Purpose: Tests writing and read data * * Return: Success: 0 * @@ -119,24 +119,32 @@ test_named(hid_t file) * * Programmer: Robb Matzke * Monday, January 4, 1999 + * + * Raymond Lu + * 12 October 2012 + * I added tests for enum-integer and enum-float conversions *------------------------------------------------------------------------- */ static int -test_noconv(hid_t file) +test_conv(hid_t file) { hid_t cwg=-1, type=-1, space=-1, dset=-1; c_e1 val; + /* Some values are out of range for testing. The library should accept them */ static c_e1 data1[]={E1_RED, E1_GREEN, E1_BLUE, E1_GREEN, E1_WHITE, E1_WHITE, E1_BLACK, E1_GREEN, E1_BLUE, E1_RED, E1_RED, E1_BLUE, E1_GREEN, E1_BLACK, E1_WHITE, - E1_RED, E1_WHITE, E1_GREEN, E1_GREEN, E1_BLUE}; + E1_RED, E1_WHITE, (c_e1)0, (c_e1)-1, (c_e1)-2}; c_e1 data2[NELMTS(data1)]; + short data_short[NELMTS(data1)]; + int data_int[NELMTS(data1)]; + double data_double[NELMTS(data1)]; hsize_t ds_size[1]={NELMTS(data1)}; size_t i; - TESTING("no-conversion datasets"); + TESTING("enumeration conversions"); - if((cwg = H5Gcreate2(file, "test_noconv", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if((cwg = H5Gcreate2(file, "test_conv", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if((type = H5Tcreate(H5T_ENUM, sizeof(c_e1))) < 0) FAIL_STACK_ERROR if(H5Tenum_insert(type, "RED", CPTR(val, E1_RED )) < 0) FAIL_STACK_ERROR @@ -146,20 +154,96 @@ test_noconv(hid_t file) if(H5Tenum_insert(type, "BLACK", CPTR(val, E1_BLACK)) < 0) FAIL_STACK_ERROR if((space = H5Screate_simple(1, ds_size, NULL)) < 0) FAIL_STACK_ERROR - if((dset = H5Dcreate2(cwg, "color_table", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + + /*************************************** + * Dataset of enumeration type + ***************************************/ + /* Create a dataset of enum type and write enum data to it */ + if((dset = H5Dcreate2(cwg, "color_table1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if(H5Dwrite(dset, type, space, space, H5P_DEFAULT, data1) < 0) FAIL_STACK_ERROR + + /* Test reading back the data with no conversion */ if(H5Dread(dset, type, space, space, H5P_DEFAULT, data2) < 0) FAIL_STACK_ERROR for(i = 0; i < (size_t)ds_size[0]; i++) if(data1[i] != data2[i]) { H5_FAILED(); - printf(" data1[%lu]=%d, data2[%lu]=%d (should be same)\n", + printf(" 1. data1[%lu]=%d, data2[%lu]=%d (should be same)\n", (unsigned long)i, (int)(data1[i]), (unsigned long)i, (int)(data2[i])); goto error; } /* end if */ + /* Test converting the data to integer. Read enum data back as integer */ + if(H5Dread(dset, H5T_NATIVE_SHORT, space, space, H5P_DEFAULT, data_short) < 0) FAIL_STACK_ERROR + + for(i = 0; i < (size_t)ds_size[0]; i++) + if((short)data1[i] != data_short[i]) { + H5_FAILED(); + printf(" 2. data1[%lu]=%d, data_short[%lu]=%d (should be same)\n", + (unsigned long)i, (int)(data1[i]), + (unsigned long)i, (int)(data_short[i])); + goto error; + } /* end if */ + + /* Test converting the data to floating number. Read enum data back as floating number */ + if(H5Dread(dset, H5T_NATIVE_DOUBLE, space, space, H5P_DEFAULT, data_double) < 0) FAIL_STACK_ERROR + + for(i = 0; i < (size_t)ds_size[0]; i++) + if((int)data1[i] != (int)data_double[i]) { + H5_FAILED(); + printf(" 3. data1[%lu]=%d, data_double[%lu]=%d (should be same)\n", + (unsigned long)i, (int)(data1[i]), + (unsigned long)i, (int)(data_double[i])); + goto error; + } /* end if */ + + if(H5Dclose(dset) < 0) FAIL_STACK_ERROR + + /*************************************** + * Dataset of integer type + ***************************************/ + /* Create a dataset of native integer and write enum data to it */ + if((dset = H5Dcreate2(cwg, "color_table2", H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + + if(H5Dwrite(dset, type, space, space, H5P_DEFAULT, data1) < 0) FAIL_STACK_ERROR + + /* Test reading back the data with no conversion */ + if(H5Dread(dset, H5T_NATIVE_INT, space, space, H5P_DEFAULT, data_int) < 0) FAIL_STACK_ERROR + + for(i = 0; i < (size_t)ds_size[0]; i++) + if((int)data1[i] != data_int[i]) { + H5_FAILED(); + printf(" 4. data1[%lu]=%d, data_int[%lu]=%d (should be same)\n", + (unsigned long)i, (int)(data1[i]), + (unsigned long)i, (int)(data_int[i])); + goto error; + } /* end if */ + if(H5Dclose(dset) < 0) FAIL_STACK_ERROR + + /*************************************** + * Dataset of double type + ***************************************/ + /* Create a dataset of native double and write enum data to it */ + if((dset = H5Dcreate2(cwg, "color_table3", H5T_NATIVE_DOUBLE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + + if(H5Dwrite(dset, type, space, space, H5P_DEFAULT, data1) < 0) FAIL_STACK_ERROR + + /* Test reading back the data with no conversion */ + if(H5Dread(dset, H5T_NATIVE_DOUBLE, space, space, H5P_DEFAULT, data_double) < 0) FAIL_STACK_ERROR + + for(i = 0; i < (size_t)ds_size[0]; i++) + if((int)data1[i] != (int)data_double[i]) { + H5_FAILED(); + printf(" 5. data1[%lu]=%d, data_double[%lu]=%d (should be same)\n", + (unsigned long)i, (int)(data1[i]), + (unsigned long)i, (int)(data_double[i])); + goto error; + } /* end if */ + + if(H5Dclose(dset) < 0) FAIL_STACK_ERROR + if(H5Sclose(space) < 0) FAIL_STACK_ERROR if(H5Tclose(type) < 0) FAIL_STACK_ERROR if(H5Gclose(cwg) < 0) FAIL_STACK_ERROR @@ -572,7 +656,7 @@ main(void) /* Tests */ nerrors += test_named(file); - nerrors += test_noconv(file); + nerrors += test_conv(file); nerrors += test_tr1(file); nerrors += test_tr2(file); nerrors += test_value_dsnt_exist(); diff --git a/test/links.c b/test/links.c index 329b9a2..19b620a 100644 --- a/test/links.c +++ b/test/links.c @@ -1884,7 +1884,7 @@ external_link_root(hid_t fapl, hbool_t new_format) /* Check that all file IDs have been closed */ if(H5I_nmembers(H5I_FILE) != 0) TEST_ERROR - if(H5F_sfile_assert_num(0) != 0) TEST_ERROR + H5F_sfile_assert_num(0); /* Open first file again with read-only access and check on objects created */ if((fid = H5Fopen(filename1, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR @@ -1908,7 +1908,7 @@ external_link_root(hid_t fapl, hbool_t new_format) /* Check that all file IDs have been closed */ if(H5I_nmembers(H5I_FILE) != 0) TEST_ERROR - if(H5F_sfile_assert_num(0) != 0) TEST_ERROR + H5F_sfile_assert_num(0); /* Verify that new objects can't be created through a read-only external * link. @@ -1925,7 +1925,7 @@ external_link_root(hid_t fapl, hbool_t new_format) /* Check that all file IDs have been closed */ if(H5I_nmembers(H5I_FILE) != 0) TEST_ERROR - if(H5F_sfile_assert_num(0) != 0) TEST_ERROR + H5F_sfile_assert_num(0); PASSED(); return 0; @@ -6753,8 +6753,7 @@ external_file_cache(hid_t fapl, hbool_t new_format) TEST_ERROR /* Verify that only 1 file is open */ - if(H5F_sfile_assert_num(1) < 0) - TEST_ERROR + H5F_sfile_assert_num(1); /* Open and close the target of the external link */ if((oid = H5Oopen(fid1, "link_to_2", H5P_DEFAULT)) < 0) @@ -6763,16 +6762,14 @@ external_file_cache(hid_t fapl, hbool_t new_format) TEST_ERROR /* Verify that both files are now open */ - if(H5F_sfile_assert_num(2) < 0) - TEST_ERROR + H5F_sfile_assert_num(2); /* Close file 1 */ if(H5Fclose(fid1) < 0) TEST_ERROR /* Verify that both files are now closed */ - if(H5F_sfile_assert_num(0) < 0) - TEST_ERROR + H5F_sfile_assert_num(0); /* @@ -6794,8 +6791,7 @@ external_file_cache(hid_t fapl, hbool_t new_format) TEST_ERROR /* Verify that only 1 file is open */ - if(H5F_sfile_assert_num(1) < 0) - TEST_ERROR + H5F_sfile_assert_num(1); /* Open and close the target of the external link */ if((oid = H5Oopen(fid1, "link_to_2", H5P_DEFAULT)) < 0) @@ -6804,24 +6800,21 @@ external_file_cache(hid_t fapl, hbool_t new_format) TEST_ERROR /* Verify that both files are now open */ - if(H5F_sfile_assert_num(2) < 0) - TEST_ERROR + H5F_sfile_assert_num(2); /* Release file 1's EFC */ if(H5Fclear_elink_file_cache(fid1) < 0) TEST_ERROR /* Verify that only the parent file is now open */ - if(H5F_sfile_assert_num(1) < 0) - TEST_ERROR + H5F_sfile_assert_num(1); /* Close file 1 */ if(H5Fclose(fid1) < 0) TEST_ERROR /* Verify that both files are now closed */ - if(H5F_sfile_assert_num(0) < 0) - TEST_ERROR + H5F_sfile_assert_num(0); /* @@ -6857,8 +6850,7 @@ external_file_cache(hid_t fapl, hbool_t new_format) TEST_ERROR /* Verify that only 1 file is open */ - if(H5F_sfile_assert_num(1) < 0) - TEST_ERROR + H5F_sfile_assert_num(1); /* Open and close one branch of the tree */ if((oid = H5Oopen(fid1, "link_to_2/link_to_3", H5P_DEFAULT)) < 0) @@ -6867,8 +6859,7 @@ external_file_cache(hid_t fapl, hbool_t new_format) TEST_ERROR /* Verify that files 2 and 3 are now open */ - if(H5F_sfile_assert_num(3) < 0) - TEST_ERROR + H5F_sfile_assert_num(3); /* Open and close the other branch of the tree */ if((oid = H5Oopen(fid1, "link_to_2/link_to_4", H5P_DEFAULT)) < 0) @@ -6877,16 +6868,14 @@ external_file_cache(hid_t fapl, hbool_t new_format) TEST_ERROR /* Verify that all files are now open */ - if(H5F_sfile_assert_num(4) < 0) - TEST_ERROR + H5F_sfile_assert_num(4); /* Close file 1 */ if(H5Fclose(fid1) < 0) TEST_ERROR /* Verify that all files are now closed */ - if(H5F_sfile_assert_num(0) < 0) - TEST_ERROR + H5F_sfile_assert_num(0); /* @@ -6922,8 +6911,7 @@ external_file_cache(hid_t fapl, hbool_t new_format) TEST_ERROR /* Verify that only 1 file is open */ - if(H5F_sfile_assert_num(1) < 0) - TEST_ERROR + H5F_sfile_assert_num(1); /* Open and close one branch of the tree */ if((oid = H5Oopen(fid1, "link_to_2/link_to_3", H5P_DEFAULT)) < 0) @@ -6932,8 +6920,7 @@ external_file_cache(hid_t fapl, hbool_t new_format) TEST_ERROR /* Verify that files 2 and 3 are now open */ - if(H5F_sfile_assert_num(3) < 0) - TEST_ERROR + H5F_sfile_assert_num(3); /* Open and close the other branch of the tree */ if((oid = H5Oopen(fid1, "link_to_2/link_to_4", H5P_DEFAULT)) < 0) @@ -6942,24 +6929,21 @@ external_file_cache(hid_t fapl, hbool_t new_format) TEST_ERROR /* Verify that all files are now open */ - if(H5F_sfile_assert_num(4) < 0) - TEST_ERROR + H5F_sfile_assert_num(4); /* Release file 1's EFC */ if(H5Fclear_elink_file_cache(fid1) < 0) TEST_ERROR /* Verify that only file 1 is now open */ - if(H5F_sfile_assert_num(1) < 0) - TEST_ERROR + H5F_sfile_assert_num(1); /* Close file 1 */ if(H5Fclose(fid1) < 0) TEST_ERROR /* Verify that all files are now closed */ - if(H5F_sfile_assert_num(0) < 0) - TEST_ERROR + H5F_sfile_assert_num(0); #ifndef H5_CANNOT_OPEN_TWICE /* @@ -6991,8 +6975,7 @@ external_file_cache(hid_t fapl, hbool_t new_format) TEST_ERROR /* Verify that only 1 file is open */ - if(H5F_sfile_assert_num(1) < 0) - TEST_ERROR + H5F_sfile_assert_num(1); /* Open and close one complete cycle */ if((oid = H5Oopen(fid1, "link_to_2/link_to_3/link_to_1", H5P_DEFAULT)) < 0) @@ -7001,16 +6984,14 @@ external_file_cache(hid_t fapl, hbool_t new_format) TEST_ERROR /* Verify that all files are now open */ - if(H5F_sfile_assert_num(3) < 0) - TEST_ERROR + H5F_sfile_assert_num(3); /* Close file 1 */ if(H5Fclose(fid1) < 0) TEST_ERROR /* Verify that all files are now closed */ - if(H5F_sfile_assert_num(0) < 0) - TEST_ERROR + H5F_sfile_assert_num(0); /* @@ -7042,8 +7023,7 @@ external_file_cache(hid_t fapl, hbool_t new_format) TEST_ERROR /* Verify that only 1 file is open */ - if(H5F_sfile_assert_num(1) < 0) - TEST_ERROR + H5F_sfile_assert_num(1); /* Open and close one complete cycle */ if((oid = H5Oopen(fid1, "link_to_2/link_to_3/link_to_1", H5P_DEFAULT)) < 0) @@ -7052,24 +7032,21 @@ external_file_cache(hid_t fapl, hbool_t new_format) TEST_ERROR /* Verify that all files are now open */ - if(H5F_sfile_assert_num(3) < 0) - TEST_ERROR + H5F_sfile_assert_num(3); /* Release file 1's EFC */ if(H5Fclear_elink_file_cache(fid1) < 0) TEST_ERROR /* Verify that only file 1 is now open */ - if(H5F_sfile_assert_num(1) < 0) - TEST_ERROR + H5F_sfile_assert_num(1); /* Close file 1 */ if(H5Fclose(fid1) < 0) TEST_ERROR /* Verify that all files are now closed */ - if(H5F_sfile_assert_num(0) < 0) - TEST_ERROR + H5F_sfile_assert_num(0); #endif /* H5_CANNOT_OPEN_TWICE */ /* Close fapl */ @@ -7164,8 +7141,7 @@ external_open_twice(hid_t fapl, hbool_t new_format) TEST_ERROR /* Verify that both files are now closed */ - if(H5F_sfile_assert_num(0) < 0) - TEST_ERROR + H5F_sfile_assert_num(0); /* @@ -7211,8 +7187,7 @@ external_open_twice(hid_t fapl, hbool_t new_format) TEST_ERROR /* Verify that both files are now closed */ - if(H5F_sfile_assert_num(0) < 0) - TEST_ERROR + H5F_sfile_assert_num(0); /* @@ -7262,8 +7237,7 @@ external_open_twice(hid_t fapl, hbool_t new_format) TEST_ERROR /* Verify that both files are now closed */ - if(H5F_sfile_assert_num(0) < 0) - TEST_ERROR + H5F_sfile_assert_num(0); /* @@ -7311,8 +7285,7 @@ external_open_twice(hid_t fapl, hbool_t new_format) TEST_ERROR /* Verify that both files are now closed */ - if(H5F_sfile_assert_num(0) < 0) - TEST_ERROR + H5F_sfile_assert_num(0); PASSED(); diff --git a/test/mount.c b/test/mount.c index 438cf10..8c450cc 100644 --- a/test/mount.c +++ b/test/mount.c @@ -1181,7 +1181,7 @@ test_close(hid_t fapl) /* Check that all file IDs have been closed */ if(H5I_nmembers(H5I_FILE) != 0) TEST_ERROR - if(H5F_sfile_assert_num(0) != 0) TEST_ERROR + H5F_sfile_assert_num(0); /* Build the virtual file again */ if((file1 = H5Fopen(filename1, H5F_ACC_RDWR, fapl)) < 0 || @@ -1198,7 +1198,7 @@ test_close(hid_t fapl) /* Check that all file IDs have been closed */ if(H5I_nmembers(H5I_FILE) != 0) TEST_ERROR - if(H5F_sfile_assert_num(0) != 0) TEST_ERROR + H5F_sfile_assert_num(0); /* Shut down */ PASSED(); @@ -1809,8 +1809,7 @@ test_missing_unmount(hid_t fapl) /* Check that all file IDs have been closed */ if(H5I_nmembers(H5I_FILE) != 0) TEST_ERROR - if(H5F_sfile_assert_num(0) != 0) - TEST_ERROR + H5F_sfile_assert_num(0); PASSED(); return 0; @@ -1945,8 +1944,7 @@ test_hold_open_file(hid_t fapl) /* Check that all file IDs have been closed */ if(H5I_nmembers(H5I_FILE) != 0) TEST_ERROR - if(H5F_sfile_assert_num(0) != 0) - TEST_ERROR + H5F_sfile_assert_num(0); PASSED(); return 0; @@ -2102,8 +2100,7 @@ test_hold_open_group(hid_t fapl) /* Check that all file IDs have been closed */ if(H5I_nmembers(H5I_FILE) != 0) TEST_ERROR - if(H5F_sfile_assert_num(0) != 0) - TEST_ERROR + H5F_sfile_assert_num(0); PASSED(); return 0; @@ -2248,8 +2245,7 @@ test_fcdegree_same(hid_t fapl) /* Check that all file IDs have been closed */ if(H5I_nmembers(H5I_FILE) != 0) TEST_ERROR - if(H5F_sfile_assert_num(0) != 0) - TEST_ERROR + H5F_sfile_assert_num(0); PASSED(); return 0; @@ -2390,8 +2386,7 @@ test_fcdegree_semi(hid_t fapl) /* Check that all file IDs have been closed */ if(H5I_nmembers(H5I_FILE) != 0) TEST_ERROR - if(H5F_sfile_assert_num(0) != 0) - TEST_ERROR + H5F_sfile_assert_num(0); PASSED(); return 0; @@ -2529,8 +2524,7 @@ test_fcdegree_strong(hid_t fapl) /* Check that all file IDs have been closed */ if(H5I_nmembers(H5I_FILE) != 0) TEST_ERROR - if(H5F_sfile_assert_num(0) != 0) - TEST_ERROR + H5F_sfile_assert_num(0); PASSED(); return 0; @@ -2732,8 +2726,7 @@ test_acc_perm(hid_t fapl) /* Check that all file IDs have been closed */ if(H5I_nmembers(H5I_FILE) != 0) TEST_ERROR - if(H5F_sfile_assert_num(0) != 0) - TEST_ERROR + H5F_sfile_assert_num(0); PASSED(); return 0; @@ -2956,8 +2949,7 @@ test_mult_mount(hid_t fapl) /* Check that all file IDs have been closed */ if(H5I_nmembers(H5I_FILE) != 0) TEST_ERROR - if(H5F_sfile_assert_num(0) != 0) - TEST_ERROR + H5F_sfile_assert_num(0); PASSED(); return 0; @@ -3178,8 +3170,7 @@ test_nested_survive(hid_t fapl) /* Check that all file IDs have been closed */ if(H5I_nmembers(H5I_FILE) != 0) TEST_ERROR - if(H5F_sfile_assert_num(0) != 0) - TEST_ERROR + H5F_sfile_assert_num(0); PASSED(); return 0; @@ -3294,8 +3285,7 @@ test_close_parent(hid_t fapl) TEST_ERROR /* Both underlying shared files should be open still */ - if(H5F_sfile_assert_num(2) != 0) - TEST_ERROR + H5F_sfile_assert_num(2); /* Check the name of "M" is still defined */ *name = '\0'; @@ -3316,16 +3306,14 @@ test_close_parent(hid_t fapl) TEST_ERROR /* Just file #2's underlying shared file should be open still */ - if(H5F_sfile_assert_num(1) != 0) - TEST_ERROR + H5F_sfile_assert_num(1); /* Close group in file #2, letting file #2 close */ if(H5Gclose(gidM) < 0) TEST_ERROR /* All underlying shared file structs should be closed */ - if(H5F_sfile_assert_num(0) != 0) - TEST_ERROR + H5F_sfile_assert_num(0); PASSED(); return 0; @@ -3702,16 +3690,14 @@ test_cut_graph(hid_t fapl) TEST_ERROR /* Check that all seven underlying files are still opened */ - if(H5F_sfile_assert_num(7) != 0) - TEST_ERROR + H5F_sfile_assert_num(7); /* Close "M" in file #5, which should close files 2, 4 & 5 */ if(H5Gclose(gidM) < 0) TEST_ERROR /* Check that only four underlying files are still opened */ - if(H5F_sfile_assert_num(4) != 0) - TEST_ERROR + H5F_sfile_assert_num(4); /* Unmount file #3 from file #1, cutting the graph */ if(H5Funmount(gidQ, "/B") < 0) @@ -3719,8 +3705,7 @@ test_cut_graph(hid_t fapl) /* Check that only three underlying files are still opened */ /* (File #1 should close after being cut off from the graph) */ - if(H5F_sfile_assert_num(3) != 0) - TEST_ERROR + H5F_sfile_assert_num(3); /* Check the name of "Q" is defined in its file */ *name = '\0'; @@ -3748,8 +3733,7 @@ test_cut_graph(hid_t fapl) TEST_ERROR /* Verify that all underlying shared files have been closed now */ - if(H5F_sfile_assert_num(0) != 0) - TEST_ERROR + H5F_sfile_assert_num(0); PASSED(); return 0; @@ -3916,16 +3900,14 @@ test_symlink(hid_t fapl) TEST_ERROR /* Verify that all 3 underlying shared files are still open */ - if(H5F_sfile_assert_num(3) != 0) - TEST_ERROR + H5F_sfile_assert_num(3); /* Close object opened through soft link */ if(H5Gclose(gidL) < 0) TEST_ERROR /* Verify that all underlying shared files have been closed now */ - if(H5F_sfile_assert_num(0) != 0) - TEST_ERROR + H5F_sfile_assert_num(0); PASSED(); return 0; @@ -4035,8 +4017,7 @@ test_sharedacc(hid_t fapl) /* Check that all file IDs have been closed */ if(H5I_nmembers(H5I_FILE) != 0) TEST_ERROR - if(H5F_sfile_assert_num(0) != 0) - TEST_ERROR + H5F_sfile_assert_num(0); PASSED(); return 0; @@ -4128,16 +4109,14 @@ test_sharedclose(hid_t fapl) TEST_ERROR /* Check that file #3 is still open */ - if(H5F_sfile_assert_num(3) != 0) - TEST_ERROR + H5F_sfile_assert_num(3); /* Close group B/C in file #1b. This should close file #1b and #3. */ if(H5Gclose(gid3) < 0) TEST_ERROR /* Check that file #3 has been closed */ - if(H5F_sfile_assert_num(2) != 0) - TEST_ERROR + H5F_sfile_assert_num(2); /* Unmount file 2 and close the rest of the handles */ if(H5Funmount(fid1a, "A") < 0) @@ -4152,8 +4131,7 @@ test_sharedclose(hid_t fapl) /* Check that all file IDs have been closed */ if(H5I_nmembers(H5I_FILE) != 0) TEST_ERROR - if(H5F_sfile_assert_num(0) != 0) - TEST_ERROR + H5F_sfile_assert_num(0); /* Create file #1 & its group */ if((fid1a = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -4196,8 +4174,7 @@ test_sharedclose(hid_t fapl) /* Check that all file IDs have been closed */ if(H5I_nmembers(H5I_FILE) != 0) TEST_ERROR - if(H5F_sfile_assert_num(0) != 0) - TEST_ERROR + H5F_sfile_assert_num(0); PASSED(); return 0; @@ -4321,7 +4298,7 @@ test_multisharedclose(hid_t fapl) /* Check that all file IDs have been closed */ if(H5I_nmembers(H5I_FILE) != 0) TEST_ERROR - if(H5F_sfile_assert_num(0) < 0) TEST_ERROR + H5F_sfile_assert_num(0); PASSED(); return 0; |