summaryrefslogtreecommitdiffstats
path: root/java/test
diff options
context:
space:
mode:
authorRichard Warren <Richard.Warren@hdfgroup.org>2020-09-25 11:44:33 (GMT)
committerRichard Warren <Richard.Warren@hdfgroup.org>2020-09-25 11:44:33 (GMT)
commitd612a249afe1eb4799ccbf725d8309452446dee7 (patch)
tree0fc5efc8f31546bf3513f939e6d2a9abd5fe42b7 /java/test
parentbeee2bdb648a6a223a64ba8733d8518e5ee79b66 (diff)
downloadhdf5-d612a249afe1eb4799ccbf725d8309452446dee7.zip
hdf5-d612a249afe1eb4799ccbf725d8309452446dee7.tar.gz
hdf5-d612a249afe1eb4799ccbf725d8309452446dee7.tar.bz2
Create a new branch for the September Subfiling deliverable
Diffstat (limited to 'java/test')
-rw-r--r--java/test/TestH5Pfapl.java32
-rw-r--r--java/test/TestH5S.java2
-rw-r--r--java/test/junit.sh.in16
-rw-r--r--java/test/testfiles/JUnit-TestH5Pfapl.txt3
4 files changed, 45 insertions, 8 deletions
diff --git a/java/test/TestH5Pfapl.java b/java/test/TestH5Pfapl.java
index 10a79dd..4233580 100644
--- a/java/test/TestH5Pfapl.java
+++ b/java/test/TestH5Pfapl.java
@@ -1398,4 +1398,36 @@ public class TestH5Pfapl {
fail("H5P_evict_on_close: " + err);
}
}
+
+ @Test
+ public void testH5P_file_locking() {
+ boolean use_file_locking = false;
+ boolean ignore_disabled_file_locking = false;
+ try {
+ // false values (usually not the default)
+ H5.H5Pset_file_locking(fapl_id, false, false);
+ use_file_locking = H5.H5Pget_use_file_locking(fapl_id);
+ ignore_disabled_file_locking = H5.H5Pget_ignore_disabled_file_locking(fapl_id);
+ assertFalse("H5P_file_locking", use_file_locking);
+ assertFalse("H5P_file_locking", ignore_disabled_file_locking);
+
+ // true values (typically the default)
+ H5.H5Pset_file_locking(fapl_id, true, true);
+ use_file_locking = H5.H5Pget_use_file_locking(fapl_id);
+ ignore_disabled_file_locking = H5.H5Pget_ignore_disabled_file_locking(fapl_id);
+ assertTrue("H5P_file_locking", use_file_locking);
+ assertTrue("H5P_file_locking", ignore_disabled_file_locking);
+ }
+ catch (HDF5PropertyListInterfaceException err) {
+ // parallel is not supported
+ if (err.getMinorErrorNumber() != HDF5Constants.H5E_UNSUPPORTED) {
+ err.printStackTrace();
+ fail("H5P_test_file_locking: " + err);
+ }
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("H5P_test_file_locking: " + err);
+ }
+ }
}
diff --git a/java/test/TestH5S.java b/java/test/TestH5S.java
index 985342b..97c0b68 100644
--- a/java/test/TestH5S.java
+++ b/java/test/TestH5S.java
@@ -171,7 +171,7 @@ public class TestH5S {
try {
H5.H5Sset_extent_none(H5sid);
read_type = H5.H5Sget_simple_extent_type(H5sid);
- assertTrue("H5.H5Sget_simple_extent_type: "+read_type, HDF5Constants.H5S_NO_CLASS == read_type);
+ assertTrue("H5.H5Sget_simple_extent_type: "+read_type, HDF5Constants.H5S_NULL == read_type);
}
catch (Throwable err) {
err.printStackTrace();
diff --git a/java/test/junit.sh.in b/java/test/junit.sh.in
index 598b3d2..62a5104 100644
--- a/java/test/junit.sh.in
+++ b/java/test/junit.sh.in
@@ -15,12 +15,12 @@
top_builddir=@top_builddir@
top_srcdir=@top_srcdir@
srcdir=@srcdir@
-prefix=@prefix@
USE_FILTER_SZIP="@USE_FILTER_SZIP@"
USE_FILTER_DEFLATE="@USE_FILTER_DEFLATE@"
USE_ROS3_VFD="@HAVE_ROS3_VFD@"
USE_HDFS_VFD="@HAVE_LIBHDFS@"
+IS_DARWIN="@H5_IS_DARWIN@"
TESTNAME=JUnitInterface
EXIT_SUCCESS=0
@@ -43,8 +43,8 @@ myos=`uname -s`
# where the libs exist
HDFLIB_HOME="$top_srcdir/java/lib"
-BLDLIBDIR="$prefix/lib"
BLDDIR="."
+BLDLIBDIR="$BLDDIR/testlibs"
HDFTEST_HOME="$top_srcdir/java/test"
JARFILE=jar@PACKAGE_TARNAME@-@PACKAGE_VERSION@.jar
TESTJARFILE=jar@PACKAGE_TARNAME@test.jar
@@ -146,6 +146,13 @@ COPY_LIBFILES_TO_BLDLIBDIR()
fi
fi
done
+ if [ "$IS_DARWIN" = "yes" ]; then
+ (cd testlibs; \
+ install_name_tool -add_rpath @loader_path libhdf5_java.dylib; \
+ exist_path=` otool -l libhdf5_java.dylib | grep libhdf5 | grep -v java | awk '{print $2}'`; \
+ echo $exist_path; \
+ install_name_tool -change $exist_path @rpath/libhdf5.dylib libhdf5_java.dylib)
+ fi
# copy jar files. Used -f to make sure get a new copy
for tstfile in $COPY_JARTESTFILES
do
@@ -204,10 +211,7 @@ CLEAN_LIBFILES_AND_BLDLIBDIR()
INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'`
INODE_DDIR=`$LS -i -d $BLDLIBDIR | $AWK -F' ' '{print $1}'`
if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then
- for tstfile in $COPY_JARTESTFILES
- do
- $RM $BLDLIBDIR/tstfile
- done
+ $RM -rf $BLDLIBDIR
fi
}
diff --git a/java/test/testfiles/JUnit-TestH5Pfapl.txt b/java/test/testfiles/JUnit-TestH5Pfapl.txt
index c4f37d0..c34ac1c 100644
--- a/java/test/testfiles/JUnit-TestH5Pfapl.txt
+++ b/java/test/testfiles/JUnit-TestH5Pfapl.txt
@@ -28,6 +28,7 @@ JUnit version 4.11
.testH5Pset_elink_fapl
.testH5P_hyper_vector_size
.testH5P_gc_references
+.testH5P_file_locking
.testH5P_family_offset
.testH5P_fapl_core
.testH5P_fapl_muti
@@ -37,5 +38,5 @@ JUnit version 4.11
Time: XXXX
-OK (35 tests)
+OK (36 tests)