summaryrefslogtreecommitdiffstats
path: root/tools/h5diff
diff options
context:
space:
mode:
Diffstat (limited to 'tools/h5diff')
-rw-r--r--tools/h5diff/CMakeLists.txt27
-rw-r--r--tools/h5diff/h5diffgentest.c20
-rw-r--r--tools/h5diff/testfiles/h5diff_450.txt3
-rw-r--r--tools/h5diff/testfiles/h5diff_451.txt2
-rw-r--r--tools/h5diff/testfiles/h5diff_471.txt38
-rw-r--r--tools/h5diff/testfiles/h5diff_472.txt3
-rw-r--r--tools/h5diff/testfiles/h5diff_473.txt3
-rw-r--r--tools/h5diff/testfiles/h5diff_474.txt3
-rw-r--r--tools/h5diff/testfiles/h5diff_475.txt3
-rw-r--r--tools/h5diff/testfiles/h5diff_danglelinks1.h5bin5012 -> 4970 bytes
-rw-r--r--tools/h5diff/testfiles/h5diff_danglelinks2.h5bin5012 -> 4970 bytes
-rwxr-xr-xtools/h5diff/testh5diff.sh16
12 files changed, 116 insertions, 2 deletions
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
index 8cbaac1..b8be9bc 100644
--- a/tools/h5diff/testfiles/h5diff_danglelinks1.h5
+++ b/tools/h5diff/testfiles/h5diff_danglelinks1.h5
Binary files differ
diff --git a/tools/h5diff/testfiles/h5diff_danglelinks2.h5 b/tools/h5diff/testfiles/h5diff_danglelinks2.h5
index f634210..3c3907c 100644
--- a/tools/h5diff/testfiles/h5diff_danglelinks2.h5
+++ b/tools/h5diff/testfiles/h5diff_danglelinks2.h5
Binary files differ
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
# ##############################################################################