diff options
-rw-r--r-- | MANIFEST | 5 | ||||
-rw-r--r-- | release_docs/RELEASE.txt | 4 | ||||
-rw-r--r-- | tools/h5diff/CMakeLists.txt | 27 | ||||
-rw-r--r-- | tools/h5diff/h5diffgentest.c | 20 | ||||
-rw-r--r-- | tools/h5diff/testfiles/h5diff_450.txt | 3 | ||||
-rw-r--r-- | tools/h5diff/testfiles/h5diff_451.txt | 2 | ||||
-rw-r--r-- | tools/h5diff/testfiles/h5diff_471.txt | 38 | ||||
-rw-r--r-- | tools/h5diff/testfiles/h5diff_472.txt | 3 | ||||
-rw-r--r-- | tools/h5diff/testfiles/h5diff_473.txt | 3 | ||||
-rw-r--r-- | tools/h5diff/testfiles/h5diff_474.txt | 3 | ||||
-rw-r--r-- | tools/h5diff/testfiles/h5diff_475.txt | 3 | ||||
-rw-r--r-- | tools/h5diff/testfiles/h5diff_danglelinks1.h5 | bin | 5012 -> 4970 bytes | |||
-rw-r--r-- | tools/h5diff/testfiles/h5diff_danglelinks2.h5 | bin | 5012 -> 4970 bytes | |||
-rwxr-xr-x | tools/h5diff/testh5diff.sh | 16 | ||||
-rw-r--r-- | tools/lib/h5diff.c | 8 |
15 files changed, 129 insertions, 6 deletions
@@ -1863,6 +1863,11 @@ ./tools/h5diff/testfiles/h5diff_467.txt ./tools/h5diff/testfiles/h5diff_468.txt ./tools/h5diff/testfiles/h5diff_469.txt +./tools/h5diff/testfiles/h5diff_471.txt +./tools/h5diff/testfiles/h5diff_472.txt +./tools/h5diff/testfiles/h5diff_473.txt +./tools/h5diff/testfiles/h5diff_474.txt +./tools/h5diff/testfiles/h5diff_475.txt ./tools/h5diff/testfiles/h5diff_480.txt ./tools/h5diff/testfiles/h5diff_481.txt ./tools/h5diff/testfiles/h5diff_482.txt diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 87e1c56..da8c83d 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -696,6 +696,10 @@ Bug Fixes since HDF5-1.8.0 release Tools ----- + - h5diff: Fixed not to check and display dangling link status without + --follow-symlinks option. This also improved performance when + comparing lots of external links without the --follow-symlinks + option. HDFFV-7998 (JKM 2012/04/26) - h5unjam: Fixed sefgault when used -V (show version) option. HDFFV-8001 (JKM 2012/04/19) - h5repack: Fixed a failure when change the chunk size of a specified diff --git a/tools/h5diff/CMakeLists.txt b/tools/h5diff/CMakeLists.txt index da2aaf9..4ac4477 100644 --- a/tools/h5diff/CMakeLists.txt +++ b/tools/h5diff/CMakeLists.txt @@ -136,6 +136,11 @@ IF (BUILD_TESTING) h5diff_467.txt h5diff_468.txt h5diff_469.txt + h5diff_471.txt + h5diff_472.txt + h5diff_473.txt + h5diff_474.txt + h5diff_475.txt h5diff_480.txt h5diff_481.txt h5diff_482.txt @@ -683,6 +688,16 @@ IF (BUILD_TESTING) h5diff_468.out.err h5diff_469.out h5diff_469.out.err + h5diff_471.out + h5diff_471.out.err + h5diff_472.out + h5diff_472.out.err + h5diff_473.out + h5diff_473.out.err + h5diff_474.out + h5diff_474.out.err + h5diff_475.out + h5diff_475.out.err h5diff_480.out h5diff_480.out.err h5diff_481.out @@ -1309,6 +1324,18 @@ ADD_H5_TEST (h5diff_468 0 -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_dan # ext link vs. ext dangling ADD_H5_TEST (h5diff_469 1 -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /ext_link2) +#--------------------------------------------------- +# dangling links without follow symlink +# (HDFFV-7998) +# test - soft dangle links (same and different paths), +# - external dangle links (same and different paths) +ADD_H5_TEST (h5diff_471 1 -v h5diff_danglelinks1.h5 h5diff_danglelinks2.h5) +ADD_H5_TEST (h5diff_472 0 -v h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /soft_link1) +ADD_H5_TEST (h5diff_473 1 -v h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /soft_link4) +ADD_H5_TEST (h5diff_474 0 -v h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /ext_link4) +ADD_H5_TEST (h5diff_475 1 -v h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /ext_link1) + + # ############################################################################## # # test for group diff recursivly # ############################################################################## diff --git a/tools/h5diff/h5diffgentest.c b/tools/h5diff/h5diffgentest.c index 0b8b4cf..c370f79 100644 --- a/tools/h5diff/h5diffgentest.c +++ b/tools/h5diff/h5diffgentest.c @@ -2181,6 +2181,14 @@ static int test_dangle_links(const char *fname1, const char *fname2) goto out; } + status = H5Lcreate_soft("no_obj1", fid1, "soft_link4", H5P_DEFAULT, H5P_DEFAULT); + if (status < 0) + { + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + status = FAIL; + goto out; + } + /* file 2 */ status = H5Lcreate_soft("no_obj", fid2, "soft_link1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) @@ -2206,6 +2214,14 @@ static int test_dangle_links(const char *fname1, const char *fname2) goto out; } + status = H5Lcreate_soft("no_obj2", fid2, "soft_link4", H5P_DEFAULT, H5P_DEFAULT); + if (status < 0) + { + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); + status = FAIL; + goto out; + } + /*----------------------------------------------------------------------- * External Links *------------------------------------------------------------------------*/ @@ -2234,7 +2250,7 @@ static int test_dangle_links(const char *fname1, const char *fname2) goto out; } - status = H5Lcreate_external("no_file1.h5", "no_obj", fid1, "ext_link4", H5P_DEFAULT, H5P_DEFAULT); + status = H5Lcreate_external("no_file.h5", "no_obj", fid1, "ext_link4", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); @@ -2267,7 +2283,7 @@ static int test_dangle_links(const char *fname1, const char *fname2) goto out; } - status = H5Lcreate_external("no_file2.h5", "no_obj", fid2, "ext_link4", H5P_DEFAULT, H5P_DEFAULT); + status = H5Lcreate_external("no_file.h5", "no_obj", fid2, "ext_link4", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2); diff --git a/tools/h5diff/testfiles/h5diff_450.txt b/tools/h5diff/testfiles/h5diff_450.txt index bf4f6e9..a63d78f 100644 --- a/tools/h5diff/testfiles/h5diff_450.txt +++ b/tools/h5diff/testfiles/h5diff_450.txt @@ -11,6 +11,7 @@ file1 file2 x x /soft_link1 x x /soft_link2 x x /soft_link3 + x x /soft_link4 group : </> and </> 0 differences found @@ -32,4 +33,6 @@ obj2 </soft_link2> is a dangling link. 1 differences found obj1 </soft_link3> is a dangling link. 1 differences found +dangling link: </soft_link4> and </soft_link4> +0 differences found EXIT CODE: 1 diff --git a/tools/h5diff/testfiles/h5diff_451.txt b/tools/h5diff/testfiles/h5diff_451.txt index 0d30023..fd0691f 100644 --- a/tools/h5diff/testfiles/h5diff_451.txt +++ b/tools/h5diff/testfiles/h5diff_451.txt @@ -11,6 +11,7 @@ file1 file2 x x /soft_link1 x x /soft_link2 x x /soft_link3 + x x /soft_link4 group : </> and </> 0 differences found @@ -25,4 +26,5 @@ Warning: </ext_link4> is a dangling link. Warning: </soft_link1> is a dangling link. Warning: </soft_link2> is a dangling link. Warning: </soft_link3> is a dangling link. +Warning: </soft_link4> is a dangling link. EXIT CODE: 2 diff --git a/tools/h5diff/testfiles/h5diff_471.txt b/tools/h5diff/testfiles/h5diff_471.txt new file mode 100644 index 0000000..124cdd7 --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_471.txt @@ -0,0 +1,38 @@ + +file1 file2 +--------------------------------------- + x x / + x x /dset1 + x x /dset2 + x x /ext_link1 + x x /ext_link2 + x x /ext_link3 + x x /ext_link4 + x x /soft_link1 + x x /soft_link2 + x x /soft_link3 + x x /soft_link4 + +group : </> and </> +0 differences found +dataset: </dset1> and </dset1> +0 differences found +dataset: </dset2> and </dset2> +0 differences found +external link: </ext_link1> and </ext_link1> +1 differences found +external link: </ext_link2> and </ext_link2> +1 differences found +external link: </ext_link3> and </ext_link3> +1 differences found +external link: </ext_link4> and </ext_link4> +0 differences found +link : </soft_link1> and </soft_link1> +0 differences found +link : </soft_link2> and </soft_link2> +1 differences found +link : </soft_link3> and </soft_link3> +1 differences found +link : </soft_link4> and </soft_link4> +1 differences found +EXIT CODE: 1 diff --git a/tools/h5diff/testfiles/h5diff_472.txt b/tools/h5diff/testfiles/h5diff_472.txt new file mode 100644 index 0000000..57a8af4 --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_472.txt @@ -0,0 +1,3 @@ +link : </soft_link1> and </soft_link1> +0 differences found +EXIT CODE: 0 diff --git a/tools/h5diff/testfiles/h5diff_473.txt b/tools/h5diff/testfiles/h5diff_473.txt new file mode 100644 index 0000000..4c1855d --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_473.txt @@ -0,0 +1,3 @@ +link : </soft_link4> and </soft_link4> +1 differences found +EXIT CODE: 1 diff --git a/tools/h5diff/testfiles/h5diff_474.txt b/tools/h5diff/testfiles/h5diff_474.txt new file mode 100644 index 0000000..7807551 --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_474.txt @@ -0,0 +1,3 @@ +external link: </ext_link4> and </ext_link4> +0 differences found +EXIT CODE: 0 diff --git a/tools/h5diff/testfiles/h5diff_475.txt b/tools/h5diff/testfiles/h5diff_475.txt new file mode 100644 index 0000000..be6110e --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_475.txt @@ -0,0 +1,3 @@ +external link: </ext_link1> and </ext_link1> +1 differences found +EXIT CODE: 1 diff --git a/tools/h5diff/testfiles/h5diff_danglelinks1.h5 b/tools/h5diff/testfiles/h5diff_danglelinks1.h5 Binary files differindex 8cbaac1..b8be9bc 100644 --- a/tools/h5diff/testfiles/h5diff_danglelinks1.h5 +++ b/tools/h5diff/testfiles/h5diff_danglelinks1.h5 diff --git a/tools/h5diff/testfiles/h5diff_danglelinks2.h5 b/tools/h5diff/testfiles/h5diff_danglelinks2.h5 Binary files differindex f634210..3c3907c 100644 --- a/tools/h5diff/testfiles/h5diff_danglelinks2.h5 +++ b/tools/h5diff/testfiles/h5diff_danglelinks2.h5 diff --git a/tools/h5diff/testh5diff.sh b/tools/h5diff/testh5diff.sh index dfea6f7..b4863d1 100755 --- a/tools/h5diff/testh5diff.sh +++ b/tools/h5diff/testh5diff.sh @@ -209,6 +209,11 @@ $SRC_H5DIFF_TESTFILES/h5diff_466.txt $SRC_H5DIFF_TESTFILES/h5diff_467.txt $SRC_H5DIFF_TESTFILES/h5diff_468.txt $SRC_H5DIFF_TESTFILES/h5diff_469.txt +$SRC_H5DIFF_TESTFILES/h5diff_471.txt +$SRC_H5DIFF_TESTFILES/h5diff_472.txt +$SRC_H5DIFF_TESTFILES/h5diff_473.txt +$SRC_H5DIFF_TESTFILES/h5diff_474.txt +$SRC_H5DIFF_TESTFILES/h5diff_475.txt $SRC_H5DIFF_TESTFILES/h5diff_480.txt $SRC_H5DIFF_TESTFILES/h5diff_481.txt $SRC_H5DIFF_TESTFILES/h5diff_482.txt @@ -970,6 +975,17 @@ TOOLTEST h5diff_468.txt -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_dangl # ext link vs. ext dangling TOOLTEST h5diff_469.txt -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /ext_link2 +#---------------------------------------- +# dangling links without follow symlink +# (HDFFV-7998) +# test - soft dangle links (same and different paths), +# - external dangle links (same and different paths) +TOOLTEST h5diff_471.txt -v h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 +TOOLTEST h5diff_472.txt -v h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /soft_link1 +TOOLTEST h5diff_473.txt -v h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /soft_link4 +TOOLTEST h5diff_474.txt -v h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /ext_link4 +TOOLTEST h5diff_475.txt -v h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /ext_link1 + # ############################################################################## # # test for group diff recursivly # ############################################################################## diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index 306f914..bcd63f1 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -868,8 +868,8 @@ hsize_t h5diff(const char *fname1, /* get any symbolic links info */ - l_ret1 = H5tools_get_symlink_info(file1_id, obj1fullname, &trg_linfo1, TRUE); - l_ret2 = H5tools_get_symlink_info(file2_id, obj2fullname, &trg_linfo2, TRUE); + l_ret1 = H5tools_get_symlink_info(file1_id, obj1fullname, &trg_linfo1, options->follow_links); + l_ret2 = H5tools_get_symlink_info(file2_id, obj2fullname, &trg_linfo2, options->follow_links); /*--------------------------------------------- * check for following symlinks @@ -1697,7 +1697,7 @@ hsize_t diff(hid_t file1_id, */ /* target object1 - get type and name */ - ret = H5tools_get_symlink_info(file1_id, path1, &linkinfo1, TRUE); + ret = H5tools_get_symlink_info(file1_id, path1, &linkinfo1, options->follow_links); /* dangling link */ if (ret == 0) { @@ -1715,7 +1715,7 @@ hsize_t diff(hid_t file1_id, goto out; /* target object2 - get type and name */ - ret = H5tools_get_symlink_info(file2_id, path2, &linkinfo2, TRUE); + ret = H5tools_get_symlink_info(file2_id, path2, &linkinfo2, options->follow_links ); /* dangling link */ if (ret == 0) { |