diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2012-10-17 18:41:42 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2012-10-17 18:41:42 (GMT) |
commit | 0324f055660fde2ddbdd928b6b674814a9e53210 (patch) | |
tree | 9919843f57d954c35f2743c075c460f8cb1f20e5 /test/mount.c | |
parent | 1c45b31cc674a38e32a87a168d50249a6875f821 (diff) | |
download | hdf5-0324f055660fde2ddbdd928b6b674814a9e53210.zip hdf5-0324f055660fde2ddbdd928b6b674814a9e53210.tar.gz hdf5-0324f055660fde2ddbdd928b6b674814a9e53210.tar.bz2 |
[svn-r22915] Description:
Bring Coverity changes back to trunk:
r20399:
Change parse_command_line to free hand structure on error and only "leave()" at end of main.
r20400:
Purpose: Fix coverity issue 592
Description: Added void cast to call to H5F_sfile_assert_num() in
H5F_term)interface(). There is no need to check the return value of this
function in general, and there would be nothing to do even if it did fail.
r20401:
Added free(src_sizes) and free(src_offset). --gh
Tested on:
Mac OSX/64 10.8.2 (amazon) w/C++, FORTRAN, threadsafe
(too minor for h5committest)
Diffstat (limited to 'test/mount.c')
-rw-r--r-- | test/mount.c | 75 |
1 files changed, 26 insertions, 49 deletions
diff --git a/test/mount.c b/test/mount.c index b7180fa..2502bbe 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(); @@ -1810,8 +1810,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; @@ -1946,8 +1945,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; @@ -2103,8 +2101,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; @@ -2249,8 +2246,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; @@ -2391,8 +2387,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; @@ -2530,8 +2525,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; @@ -2733,8 +2727,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; @@ -2957,8 +2950,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; @@ -3179,8 +3171,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; @@ -3295,8 +3286,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'; @@ -3317,16 +3307,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; @@ -3703,16 +3691,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) @@ -3720,8 +3706,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'; @@ -3749,8 +3734,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; @@ -3917,16 +3901,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; @@ -4036,8 +4018,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; @@ -4129,16 +4110,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) @@ -4153,8 +4132,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) @@ -4197,8 +4175,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; @@ -4324,7 +4301,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; |