summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLarry Knox <lrknox@hdfgroup.org>2019-07-26 16:56:03 (GMT)
committerLarry Knox <lrknox@hdfgroup.org>2019-07-26 16:56:03 (GMT)
commit094f14ef3857a47deb15bdfe45a1d4fe26655a6a (patch)
treee3aa525daacf5262a255b9b693e7f85b44d25bef
parent8008294578b5a133907d7ab1dd20e34735c54535 (diff)
downloadhdf5-094f14ef3857a47deb15bdfe45a1d4fe26655a6a.zip
hdf5-094f14ef3857a47deb15bdfe45a1d4fe26655a6a.tar.gz
hdf5-094f14ef3857a47deb15bdfe45a1d4fe26655a6a.tar.bz2
Add HD to string functions.
Switched strtoul to strtoumax in H5FDs3comms.c. Removed unused functions and variables in s3 and hdfs TestH5Pfapl*.java. Update Copyright headers.
-rw-r--r--config/cmake/ConfigureChecks.cmake2
-rw-r--r--java/examples/groups/JavaGroupExample.sh.in2
-rw-r--r--java/test/TestH5Pfaplhdfs.java212
-rw-r--r--java/test/TestH5Pfapls3.java212
-rw-r--r--src/H5FDros3.c34
-rw-r--r--src/H5FDros3.h18
-rw-r--r--src/H5FDs3comms.c42
-rw-r--r--src/H5FDs3comms.h17
-rw-r--r--test/hdfs.c18
-rw-r--r--test/ros3.c18
-rw-r--r--test/s3comms.c18
-rw-r--r--tools/libtest/Makefile.am2
-rw-r--r--tools/libtest/h5tools_test_utils.c (renamed from tools/libtest/h5tools_utils.c)25
13 files changed, 99 insertions, 521 deletions
diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake
index f295a1c..cb1eb48 100644
--- a/config/cmake/ConfigureChecks.cmake
+++ b/config/cmake/ConfigureChecks.cmake
@@ -155,7 +155,7 @@ if (NOT WINDOWS)
endif ()
#-----------------------------------------------------------------------------
-# Check if ROS3 driver works
+# Check if ROS3 driver can be built
#-----------------------------------------------------------------------------
option (HDF5_ENABLE_ROS3_VFD "Build the ROS3 Virtual File Driver" OFF)
if (HDF5_ENABLE_ROS3_VFD)
diff --git a/java/examples/groups/JavaGroupExample.sh.in b/java/examples/groups/JavaGroupExample.sh.in
index 3ba512a..9d4673f 100644
--- a/java/examples/groups/JavaGroupExample.sh.in
+++ b/java/examples/groups/JavaGroupExample.sh.in
@@ -64,8 +64,6 @@ $HDFTEST_HOME/h5ex_g_iterate.h5
$HDFTEST_HOME/h5ex_g_visit.h5
"
LIST_DATA_FILES="
-$HDFTEST_HOME/h5ex_g_iterate.h5
-$HDFTEST_HOME/h5ex_g_visit.h5
$HDFTEST_HOME/../testfiles/examples.groups.H5Ex_G_Create.txt
$HDFTEST_HOME/../testfiles/examples.groups.H5Ex_G_Iterate.txt
$HDFTEST_HOME/../testfiles/examples.groups.H5Ex_G_Compact.txt
diff --git a/java/test/TestH5Pfaplhdfs.java b/java/test/TestH5Pfaplhdfs.java
index 2b0a808..30d326e 100644
--- a/java/test/TestH5Pfaplhdfs.java
+++ b/java/test/TestH5Pfaplhdfs.java
@@ -41,228 +41,16 @@ import org.junit.rules.TestName;
public class TestH5Pfaplhdfs {
@Rule public TestName testname = new TestName();
- private static final String H5_FILE = "testPf.h5";
- private static final String H5_LOG_FILE = "testPf.log";
- private static final String H5_FAMILY_FILE = "testPf%05d";
- private static final String H5_MULTI_FILE = "testPfmulti";
- private static char MULTI_LETTERS[] = {'X','s','b','r','g','l','o'};
- private static final int DIM_X = 4;
- private static final int DIM_Y = 6;
- private static final int DIMF_X = 12;
- private static final int DIMF_Y = 18;
long H5fid = -1;
long H5dsid = -1;
long H5did = -1;
long H5Fdsid = -1;
long H5Fdid = -1;
- long[] H5dims = { DIM_X, DIM_Y };
long fapl_id = -1;
long plapl_id = -1;
long dapl_id = -1;
long plist_id = -1;
long btplist_id = -1;
- long[] H5Fdims = { DIMF_X, DIMF_Y };
- double windchillF[][] =
- {{36.0, 31.0, 25.0, 19.0, 13.0, 7.0, 1.0, -5.0, -11.0, -16.0, -22.0, -28.0, -34.0, -40.0, -46.0, -52.0, -57.0, -63.0},
- {34.0, 27.0, 21.0, 15.0, 9.0, 3.0, -4.0, -10.0, -16.0, -22.0, -28.0, -35.0, -41.0, -47.0, -53.0, -59.0, -66.0, -72.0},
- {32.0, 25.0, 19.0, 13.0, 6.0, 0.0, -7.0, -13.0, -19.0, -26.0, -32.0, -39.0, -45.0, -51.0, -58.0, -64.0, -71.0, -77.0},
- {30.0, 24.0, 17.0, 11.0, 4.0, -2.0, -9.0, -15.0, -22.0, -29.0, -35.0, -42.0, -48.0, -55.0, -61.0, -68.0, -74.0, -81.0},
- {29.0, 23.0, 16.0, 9.0, 3.0, -4.0, -11.0, -17.0, -24.0, -31.0, -37.0, -44.0, -51.0, -58.0, -64.0, -71.0, -78.0, -84.0},
- {28.0, 22.0, 15.0, 8.0, 1.0, -5.0, -12.0, -19.0, -26.0, -33.0, -39.0, -46.0, -53.0, -60.0, -67.0, -73.0, -80.0, -87.0},
- {28.0, 21.0, 14.0, 7.0, 0.0, -7.0, -14.0, -21.0, -27.0, -34.0, -41.0, -48.0, -55.0, -62.0, -69.0, -76.0, -82.0, -89.0},
- {27.0, 20.0, 13.0, 6.0, -1.0, -8.0, -15.0, -22.0, -29.0, -36.0, -43.0, -50.0, -57.0, -64.0, -71.0, -78.0, -84.0, -91.0},
- {26.0, 19.0, 12.0, 5.0, -2.0, -9.0, -16.0, -23.0, -30.0, -37.0, -44.0, -51.0, -58.0, -65.0, -72.0, -79.0, -86.0, -93.0},
- {26.0, 19.0, 12.0, 4.0, -3.0, -10.0, -17.0, -24.0, -31.0, -38.0, -45.0, -52.0, -60.0, -67.0, -74.0, -81.0, -88.0, -95.0},
- {25.0, 18.0, 11.0, 4.0, -3.0, -11.0, -18.0, -25.0, -32.0, -39.0, -46.0, -54.0, -61.0, -68.0, -75.0, -82.0, -89.0, -97.0},
- {25.0, 17.0, 10.0, 3.0, -4.0, -11.0, -19.0, -26.0, -33.0, -40.0, -48.0, -55.0, -62.0, -69.0, -76.0, -84.0, -91.0, -98.0}
- };
-
- private final void _deleteFile(String filename) {
- File file = null;
- try {
- file = new File(filename);
- }
- catch (Throwable err) {}
-
- if (file.exists()) {
- try {file.delete();} catch (SecurityException e) {}
- }
- }
-
- private final void _deleteLogFile() {
- File file = null;
- try {
- file = new File(H5_LOG_FILE);
- }
- catch (Throwable err) {}
-
- if (file.exists()) {
- try {file.delete();} catch (SecurityException e) {}
- }
- }
-
- private final void _deleteFamilyFile() {
- File file = null;
- for(int indx = 0; ;indx++) {
- java.text.DecimalFormat myFormat = new java.text.DecimalFormat("00000");
- try {
- file = new File("test"+myFormat.format(new Integer(indx))+".h5");
- }
- catch (Throwable err) {}
-
- if (file.exists()) {
- try {file.delete();} catch (SecurityException e) {}
- }
- else
- return;
- }
- }
-
- private final void _deleteMultiFile() {
- File file = null;
- for(int indx = 1;indx<7;indx++) {
- try {
- file = new File(H5_MULTI_FILE+"-"+MULTI_LETTERS[indx]+".h5");
- }
- catch (Throwable err) {}
-
- if (file.exists()) {
- try {file.delete();} catch (SecurityException e) {}
- }
- }
- }
-
- private final long _createDataset(long fid, long dsid, String name, long dapl) {
- long did = -1;
- try {
- did = H5.H5Dcreate(fid, name, HDF5Constants.H5T_STD_I32BE, dsid,
- HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, dapl);
- }
- catch (Throwable err) {
- err.printStackTrace();
- fail("H5.H5Dcreate: " + err);
- }
- assertTrue("TestH5Pfapl._createDataset: ", did > 0);
-
- return did;
- }
-
- private final void _createFloatDataset() {
- try {
- H5Fdsid = H5.H5Screate_simple(2, H5Fdims, null);
- H5Fdid = H5.H5Dcreate(H5fid, "dsfloat", HDF5Constants.H5T_NATIVE_FLOAT, H5Fdsid,
- HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT);
- }
- catch (Throwable err) {
- err.printStackTrace();
- fail("H5.H5Dcreate: " + err);
- }
- assertTrue("TestH5Pfapl._createFloatDataset: ", H5Fdid > 0);
-
- try {
- H5.H5Fflush(H5fid, HDF5Constants.H5F_SCOPE_LOCAL);
- }
- catch (Throwable err) {
- err.printStackTrace();
- }
- }
-
- private final void _createH5multiFileDS() {
- try {
- H5did = _createDataset(H5fid, H5dsid, "dset", HDF5Constants.H5P_DEFAULT);
- }
- catch (Throwable err) {
- err.printStackTrace();
- fail("TestH5Pfapl.createH5file: " + err);
- }
- assertTrue("TestH5Pfapl.createH5file: _createDataset: ", H5did > 0);
-
- try {
- H5.H5Fflush(H5fid, HDF5Constants.H5F_SCOPE_LOCAL);
- }
- catch (Throwable err) {
- err.printStackTrace();
- }
- }
-
- private final void _createH5File(long fapl) {
- try {
- H5fid = H5.H5Fcreate(H5_FILE, HDF5Constants.H5F_ACC_TRUNC,
- HDF5Constants.H5P_DEFAULT, fapl);
- H5dsid = H5.H5Screate_simple(2, H5dims, null);
- H5did = _createDataset(H5fid, H5dsid, "dset", HDF5Constants.H5P_DEFAULT);
- }
- catch (Throwable err) {
- err.printStackTrace();
- fail("TestH5Pfapl.createH5file: " + err);
- }
- assertTrue("TestH5Pfapl.createH5file: H5.H5Fcreate: ", H5fid > 0);
- assertTrue("TestH5Pfapl.createH5file: H5.H5Screate_simple: ", H5dsid > 0);
- assertTrue("TestH5Pfapl.createH5file: _createDataset: ", H5did > 0);
-
- try {
- H5.H5Fflush(H5fid, HDF5Constants.H5F_SCOPE_LOCAL);
- }
- catch (Throwable err) {
- err.printStackTrace();
- }
- }
-
- private final void _createH5familyFile(long fapl) {
- try {
- H5fid = H5.H5Fcreate(H5_FAMILY_FILE+".h5", HDF5Constants.H5F_ACC_TRUNC,
- HDF5Constants.H5P_DEFAULT, fapl);
- H5dsid = H5.H5Screate_simple(2, H5dims, null);
- H5did = _createDataset(H5fid, H5dsid, "dset", HDF5Constants.H5P_DEFAULT);
- }
- catch (Throwable err) {
- err.printStackTrace();
- fail("TestH5Pfapl.createH5file: " + err);
- }
- assertTrue("TestH5Pfapl.createH5file: H5.H5Fcreate: ", H5fid > 0);
- assertTrue("TestH5Pfapl.createH5file: H5.H5Screate_simple: ", H5dsid > 0);
- assertTrue("TestH5Pfapl.createH5file: _createDataset: ", H5did > 0);
-
- try {
- H5.H5Fflush(H5fid, HDF5Constants.H5F_SCOPE_LOCAL);
- }
- catch (Throwable err) {
- err.printStackTrace();
- }
- }
-
- private final void _createH5multiFile(long fapl) {
- try {
- H5fid = H5.H5Fcreate(H5_MULTI_FILE, HDF5Constants.H5F_ACC_TRUNC,
- HDF5Constants.H5P_DEFAULT, fapl);
- H5dsid = H5.H5Screate_simple(2, H5dims, null);
- }
- catch (Throwable err) {
- err.printStackTrace();
- fail("TestH5Pfapl.createH5file: " + err);
- }
- assertTrue("TestH5Pfapl.createH5file: H5.H5Fcreate: ", H5fid > 0);
- assertTrue("TestH5Pfapl.createH5file: H5.H5Screate_simple: ", H5dsid > 0);
-
- try {
- H5.H5Fflush(H5fid, HDF5Constants.H5F_SCOPE_LOCAL);
- }
- catch (Throwable err) {
- err.printStackTrace();
- }
- }
-
- public void deleteH5file() {
- _deleteFile(H5_FILE);
- }
-
- public void deleteH5familyfile() {
- _deleteFamilyFile();
- }
-
- public void deleteH5multifile() {
- _deleteMultiFile();
- }
@Before
public void createFileAccess()
diff --git a/java/test/TestH5Pfapls3.java b/java/test/TestH5Pfapls3.java
index 3107bc8..00a2a73 100644
--- a/java/test/TestH5Pfapls3.java
+++ b/java/test/TestH5Pfapls3.java
@@ -41,228 +41,16 @@ import org.junit.rules.TestName;
public class TestH5Pfapls3 {
@Rule public TestName testname = new TestName();
- private static final String H5_FILE = "testPf.h5";
- private static final String H5_LOG_FILE = "testPf.log";
- private static final String H5_FAMILY_FILE = "testPf%05d";
- private static final String H5_MULTI_FILE = "testPfmulti";
- private static char MULTI_LETTERS[] = {'X','s','b','r','g','l','o'};
- private static final int DIM_X = 4;
- private static final int DIM_Y = 6;
- private static final int DIMF_X = 12;
- private static final int DIMF_Y = 18;
long H5fid = -1;
long H5dsid = -1;
long H5did = -1;
long H5Fdsid = -1;
long H5Fdid = -1;
- long[] H5dims = { DIM_X, DIM_Y };
long fapl_id = -1;
long plapl_id = -1;
long dapl_id = -1;
long plist_id = -1;
long btplist_id = -1;
- long[] H5Fdims = { DIMF_X, DIMF_Y };
- double windchillF[][] =
- {{36.0, 31.0, 25.0, 19.0, 13.0, 7.0, 1.0, -5.0, -11.0, -16.0, -22.0, -28.0, -34.0, -40.0, -46.0, -52.0, -57.0, -63.0},
- {34.0, 27.0, 21.0, 15.0, 9.0, 3.0, -4.0, -10.0, -16.0, -22.0, -28.0, -35.0, -41.0, -47.0, -53.0, -59.0, -66.0, -72.0},
- {32.0, 25.0, 19.0, 13.0, 6.0, 0.0, -7.0, -13.0, -19.0, -26.0, -32.0, -39.0, -45.0, -51.0, -58.0, -64.0, -71.0, -77.0},
- {30.0, 24.0, 17.0, 11.0, 4.0, -2.0, -9.0, -15.0, -22.0, -29.0, -35.0, -42.0, -48.0, -55.0, -61.0, -68.0, -74.0, -81.0},
- {29.0, 23.0, 16.0, 9.0, 3.0, -4.0, -11.0, -17.0, -24.0, -31.0, -37.0, -44.0, -51.0, -58.0, -64.0, -71.0, -78.0, -84.0},
- {28.0, 22.0, 15.0, 8.0, 1.0, -5.0, -12.0, -19.0, -26.0, -33.0, -39.0, -46.0, -53.0, -60.0, -67.0, -73.0, -80.0, -87.0},
- {28.0, 21.0, 14.0, 7.0, 0.0, -7.0, -14.0, -21.0, -27.0, -34.0, -41.0, -48.0, -55.0, -62.0, -69.0, -76.0, -82.0, -89.0},
- {27.0, 20.0, 13.0, 6.0, -1.0, -8.0, -15.0, -22.0, -29.0, -36.0, -43.0, -50.0, -57.0, -64.0, -71.0, -78.0, -84.0, -91.0},
- {26.0, 19.0, 12.0, 5.0, -2.0, -9.0, -16.0, -23.0, -30.0, -37.0, -44.0, -51.0, -58.0, -65.0, -72.0, -79.0, -86.0, -93.0},
- {26.0, 19.0, 12.0, 4.0, -3.0, -10.0, -17.0, -24.0, -31.0, -38.0, -45.0, -52.0, -60.0, -67.0, -74.0, -81.0, -88.0, -95.0},
- {25.0, 18.0, 11.0, 4.0, -3.0, -11.0, -18.0, -25.0, -32.0, -39.0, -46.0, -54.0, -61.0, -68.0, -75.0, -82.0, -89.0, -97.0},
- {25.0, 17.0, 10.0, 3.0, -4.0, -11.0, -19.0, -26.0, -33.0, -40.0, -48.0, -55.0, -62.0, -69.0, -76.0, -84.0, -91.0, -98.0}
- };
-
- private final void _deleteFile(String filename) {
- File file = null;
- try {
- file = new File(filename);
- }
- catch (Throwable err) {}
-
- if (file.exists()) {
- try {file.delete();} catch (SecurityException e) {}
- }
- }
-
- private final void _deleteLogFile() {
- File file = null;
- try {
- file = new File(H5_LOG_FILE);
- }
- catch (Throwable err) {}
-
- if (file.exists()) {
- try {file.delete();} catch (SecurityException e) {}
- }
- }
-
- private final void _deleteFamilyFile() {
- File file = null;
- for(int indx = 0; ;indx++) {
- java.text.DecimalFormat myFormat = new java.text.DecimalFormat("00000");
- try {
- file = new File("test"+myFormat.format(new Integer(indx))+".h5");
- }
- catch (Throwable err) {}
-
- if (file.exists()) {
- try {file.delete();} catch (SecurityException e) {}
- }
- else
- return;
- }
- }
-
- private final void _deleteMultiFile() {
- File file = null;
- for(int indx = 1;indx<7;indx++) {
- try {
- file = new File(H5_MULTI_FILE+"-"+MULTI_LETTERS[indx]+".h5");
- }
- catch (Throwable err) {}
-
- if (file.exists()) {
- try {file.delete();} catch (SecurityException e) {}
- }
- }
- }
-
- private final long _createDataset(long fid, long dsid, String name, long dapl) {
- long did = -1;
- try {
- did = H5.H5Dcreate(fid, name, HDF5Constants.H5T_STD_I32BE, dsid,
- HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, dapl);
- }
- catch (Throwable err) {
- err.printStackTrace();
- fail("H5.H5Dcreate: " + err);
- }
- assertTrue("TestH5Pfapl._createDataset: ", did > 0);
-
- return did;
- }
-
- private final void _createFloatDataset() {
- try {
- H5Fdsid = H5.H5Screate_simple(2, H5Fdims, null);
- H5Fdid = H5.H5Dcreate(H5fid, "dsfloat", HDF5Constants.H5T_NATIVE_FLOAT, H5Fdsid,
- HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT);
- }
- catch (Throwable err) {
- err.printStackTrace();
- fail("H5.H5Dcreate: " + err);
- }
- assertTrue("TestH5Pfapl._createFloatDataset: ", H5Fdid > 0);
-
- try {
- H5.H5Fflush(H5fid, HDF5Constants.H5F_SCOPE_LOCAL);
- }
- catch (Throwable err) {
- err.printStackTrace();
- }
- }
-
- private final void _createH5multiFileDS() {
- try {
- H5did = _createDataset(H5fid, H5dsid, "dset", HDF5Constants.H5P_DEFAULT);
- }
- catch (Throwable err) {
- err.printStackTrace();
- fail("TestH5Pfapl.createH5file: " + err);
- }
- assertTrue("TestH5Pfapl.createH5file: _createDataset: ", H5did > 0);
-
- try {
- H5.H5Fflush(H5fid, HDF5Constants.H5F_SCOPE_LOCAL);
- }
- catch (Throwable err) {
- err.printStackTrace();
- }
- }
-
- private final void _createH5File(long fapl) {
- try {
- H5fid = H5.H5Fcreate(H5_FILE, HDF5Constants.H5F_ACC_TRUNC,
- HDF5Constants.H5P_DEFAULT, fapl);
- H5dsid = H5.H5Screate_simple(2, H5dims, null);
- H5did = _createDataset(H5fid, H5dsid, "dset", HDF5Constants.H5P_DEFAULT);
- }
- catch (Throwable err) {
- err.printStackTrace();
- fail("TestH5Pfapl.createH5file: " + err);
- }
- assertTrue("TestH5Pfapl.createH5file: H5.H5Fcreate: ", H5fid > 0);
- assertTrue("TestH5Pfapl.createH5file: H5.H5Screate_simple: ", H5dsid > 0);
- assertTrue("TestH5Pfapl.createH5file: _createDataset: ", H5did > 0);
-
- try {
- H5.H5Fflush(H5fid, HDF5Constants.H5F_SCOPE_LOCAL);
- }
- catch (Throwable err) {
- err.printStackTrace();
- }
- }
-
- private final void _createH5familyFile(long fapl) {
- try {
- H5fid = H5.H5Fcreate(H5_FAMILY_FILE+".h5", HDF5Constants.H5F_ACC_TRUNC,
- HDF5Constants.H5P_DEFAULT, fapl);
- H5dsid = H5.H5Screate_simple(2, H5dims, null);
- H5did = _createDataset(H5fid, H5dsid, "dset", HDF5Constants.H5P_DEFAULT);
- }
- catch (Throwable err) {
- err.printStackTrace();
- fail("TestH5Pfapl.createH5file: " + err);
- }
- assertTrue("TestH5Pfapl.createH5file: H5.H5Fcreate: ", H5fid > 0);
- assertTrue("TestH5Pfapl.createH5file: H5.H5Screate_simple: ", H5dsid > 0);
- assertTrue("TestH5Pfapl.createH5file: _createDataset: ", H5did > 0);
-
- try {
- H5.H5Fflush(H5fid, HDF5Constants.H5F_SCOPE_LOCAL);
- }
- catch (Throwable err) {
- err.printStackTrace();
- }
- }
-
- private final void _createH5multiFile(long fapl) {
- try {
- H5fid = H5.H5Fcreate(H5_MULTI_FILE, HDF5Constants.H5F_ACC_TRUNC,
- HDF5Constants.H5P_DEFAULT, fapl);
- H5dsid = H5.H5Screate_simple(2, H5dims, null);
- }
- catch (Throwable err) {
- err.printStackTrace();
- fail("TestH5Pfapl.createH5file: " + err);
- }
- assertTrue("TestH5Pfapl.createH5file: H5.H5Fcreate: ", H5fid > 0);
- assertTrue("TestH5Pfapl.createH5file: H5.H5Screate_simple: ", H5dsid > 0);
-
- try {
- H5.H5Fflush(H5fid, HDF5Constants.H5F_SCOPE_LOCAL);
- }
- catch (Throwable err) {
- err.printStackTrace();
- }
- }
-
- public void deleteH5file() {
- _deleteFile(H5_FILE);
- }
-
- public void deleteH5familyfile() {
- _deleteFamilyFile();
- }
-
- public void deleteH5multifile() {
- _deleteMultiFile();
- }
@Before
public void createFileAccess()
diff --git a/src/H5FDros3.c b/src/H5FDros3.c
index 8bf0420..86642aa 100644
--- a/src/H5FDros3.c
+++ b/src/H5FDros3.c
@@ -1,18 +1,18 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Read-Only S3 Virtual File Driver (VFD) *
- * Copyright (c) 2017-2018, The HDF Group. *
- * *
+ * Copyright by The HDF Group. *
* All rights reserved. *
* *
- * NOTICE: *
- * All information contained herein is, and remains, the property of The HDF *
- * Group. The intellectual and technical concepts contained herein are *
- * proprietary to The HDF Group. Dissemination of this information or *
- * reproduction of this material is strictly forbidden unless prior written *
- * permission is obtained from The HDF Group. *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
+ * Read-Only S3 Virtual File Driver (VFD)
+ *
* Programmer: Jacob Smith <jake.smith@hdfgroup.org>
* 2017-10-13
*
@@ -1334,14 +1334,14 @@ H5FD_ros3_cmp(const H5FD_t *_f1,
HDassert(purl2->host != NULL);
/* URL: SCHEME */
- if (strcmp(purl1->scheme, purl2->scheme)) HGOTO_DONE(-1);
+ if (HDstrcmp(purl1->scheme, purl2->scheme)) HGOTO_DONE(-1);
/* URL: HOST */
- if (strcmp(purl1->host, purl2->host)) HGOTO_DONE(-1);
+ if (HDstrcmp(purl1->host, purl2->host)) HGOTO_DONE(-1);
/* URL: PORT */
if (purl1->port && purl2->port) {
- if (strcmp(purl1->port, purl2->port)) HGOTO_DONE(-1);
+ if (HDstrcmp(purl1->port, purl2->port)) HGOTO_DONE(-1);
} else if (purl1->port) {
HGOTO_DONE(-1);
} else if (purl2->port) {
@@ -1350,7 +1350,7 @@ H5FD_ros3_cmp(const H5FD_t *_f1,
/* URL: PATH */
if (purl1->path && purl2->path) {
- if (strcmp(purl1->path, purl2->path)) HGOTO_DONE(-1);
+ if (HDstrcmp(purl1->path, purl2->path)) HGOTO_DONE(-1);
} else if (purl1->path && !purl2->path) {
HGOTO_DONE(-1);
} else if (purl2->path && !purl1->path) {
@@ -1359,7 +1359,7 @@ H5FD_ros3_cmp(const H5FD_t *_f1,
/* URL: QUERY */
if (purl1->query && purl2->query) {
- if (strcmp(purl1->query, purl2->query)) HGOTO_DONE(-1);
+ if (HDstrcmp(purl1->query, purl2->query)) HGOTO_DONE(-1);
} else if (purl1->query && !purl2->query) {
HGOTO_DONE(-1);
} else if (purl2->query && !purl1->query) {
@@ -1368,7 +1368,7 @@ H5FD_ros3_cmp(const H5FD_t *_f1,
/* FAPL: AWS_REGION */
if (f1->fa.aws_region[0] != '\0' && f1->fa.aws_region[0] != '\0') {
- if (strcmp(f1->fa.aws_region, f2->fa.aws_region)) HGOTO_DONE(-1);
+ if (HDstrcmp(f1->fa.aws_region, f2->fa.aws_region)) HGOTO_DONE(-1);
} else if (f1->fa.aws_region[0] != '\0') {
HGOTO_DONE(-1);
} else if (f2->fa.aws_region[0] != '\0') {
@@ -1377,7 +1377,7 @@ H5FD_ros3_cmp(const H5FD_t *_f1,
/* FAPL: SECRET_ID */
if (f1->fa.secret_id[0] != '\0' && f1->fa.secret_id[0] != '\0') {
- if (strcmp(f1->fa.secret_id, f2->fa.secret_id)) HGOTO_DONE(-1);
+ if (HDstrcmp(f1->fa.secret_id, f2->fa.secret_id)) HGOTO_DONE(-1);
} else if (f1->fa.secret_id[0] != '\0') {
HGOTO_DONE(-1);
} else if (f2->fa.secret_id[0] != '\0') {
@@ -1386,7 +1386,7 @@ H5FD_ros3_cmp(const H5FD_t *_f1,
/* FAPL: SECRET_KEY */
if (f1->fa.secret_key[0] != '\0' && f1->fa.secret_key[0] != '\0') {
- if (strcmp(f1->fa.secret_key, f2->fa.secret_key)) HGOTO_DONE(-1);
+ if (HDstrcmp(f1->fa.secret_key, f2->fa.secret_key)) HGOTO_DONE(-1);
} else if (f1->fa.secret_key[0] != '\0') {
HGOTO_DONE(-1);
} else if (f2->fa.secret_key[0] != '\0') {
diff --git a/src/H5FDros3.h b/src/H5FDros3.h
index 49e757c..7dfc95b 100644
--- a/src/H5FDros3.h
+++ b/src/H5FDros3.h
@@ -1,18 +1,18 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Read-Only S3 Virtual File Driver (VFD) *
- * Copyright (c) 2017-2018, The HDF Group. *
- * *
+ * Copyright by The HDF Group. *
* All rights reserved. *
* *
- * NOTICE: *
- * All information contained herein is, and remains, the property of The HDF *
- * Group. The intellectual and technical concepts contained herein are *
- * proprietary to The HDF Group. Dissemination of this information or *
- * reproduction of this material is strictly forbidden unless prior written *
- * permission is obtained from The HDF Group. *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
+ * Read-Only S3 Virtual File Driver (VFD)
+ *
* Programmer: John Mainzer
* 2017-10-10
*
diff --git a/src/H5FDs3comms.c b/src/H5FDs3comms.c
index 7caeacb..4c24866 100644
--- a/src/H5FDs3comms.c
+++ b/src/H5FDs3comms.c
@@ -1,18 +1,18 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Read-Only S3 Virtual File Driver (VFD) *
- * Copyright (c) 2017-2018, The HDF Group. *
- * *
+ * Copyright by The HDF Group. *
* All rights reserved. *
* *
- * NOTICE: *
- * All information contained herein is, and remains, the property of The HDF *
- * Group. The intellectual and technical concepts contained herein are *
- * proprietary to The HDF Group. Dissemination of this information or *
- * reproduction of this material is strictly forbidden unless prior written *
- * permission is obtained from The HDF Group. *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*****************************************************************************
+ * Read-Only S3 Virtual File Driver (VFD)
+ *
* Source for S3 Communications module
*
* ***NOT A FILE DRIVER***
@@ -1005,7 +1005,7 @@ herr_t
H5FD_s3comms_s3r_getsize(s3r_t *handle)
{
#ifdef H5_HAVE_ROS3_VFD
- unsigned long int content_length = 0;
+ uintmax_t content_length = 0;
CURL *curlh = NULL;
char *end = NULL;
char *headerresponse = NULL;
@@ -1135,9 +1135,14 @@ H5FD_s3comms_s3r_getsize(s3r_t *handle)
*/
*end = '\0';
- content_length = strtoul((const char *)start,
+ content_length = strtoumax((const char *)start,
NULL,
0);
+
+ if (UINTMAX_MAX > SIZE_MAX && content_length > SIZE_MAX) {
+ HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "content_length overflows size_t\n");
+ }
+
if (content_length == 0 ||
content_length == ULONG_MAX ||
errno == ERANGE) /* errno set by strtoul */
@@ -1156,7 +1161,7 @@ H5FD_s3comms_s3r_getsize(s3r_t *handle)
if ( CURLE_OK !=
curl_easy_setopt(curlh,
CURLOPT_NOBODY,
- 0) )
+ NULL) )
{
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
"error while setting CURL option (CURLOPT_NOBODY). "
@@ -1166,7 +1171,7 @@ H5FD_s3comms_s3r_getsize(s3r_t *handle)
if ( CURLE_OK !=
curl_easy_setopt(curlh,
CURLOPT_HEADERDATA,
- 0) )
+ NULL) )
{
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
"error while setting CURL option (CURLOPT_HEADERDATA). "
@@ -2518,7 +2523,7 @@ done:
* + internal error occurred.
* + -1 :: unable to format profile label
* + -2 :: profile name/label not found in file
- * + -3 :: some other error
+ * + -3 :: some other error
*
* Programmer: Jacob Smith
* 2018-02-27
@@ -2602,14 +2607,14 @@ H5FD__s3comms_load_aws_creds_from_file(
"unable to format line prefix")
/* found a matching name? */
- if (!strncmp(line_buffer, line_prefix, setting_name_len + 1)) {
+ if (!HDstrncmp(line_buffer, line_prefix, setting_name_len + 1)) {
found_setting = 1;
/* skip NULL destination buffer */
if (setting_pointers[setting_i] == NULL)
break;
- /* advance to end fo name in string */
+ /* advance to end of name in string */
do {
line_buffer++;
} while (*line_buffer != 0 && *line_buffer != '=');
@@ -2620,7 +2625,8 @@ H5FD__s3comms_load_aws_creds_from_file(
line_buffer++; /* was pointing at '='; advance */
/* copy line buffer into out pointer */
- strcpy(setting_pointers[setting_i], (const char *)line_buffer);
+ HDstrncpy(setting_pointers[setting_i], (const char *)line_buffer,
+ HDstrlen(line_buffer));
/* "trim" tailing whitespace by replacing with null terminator*/
buffer_i = 0;
@@ -2889,7 +2895,7 @@ H5FD_s3comms_parse_url(const char *str,
* READ SCHEME *
***************/
- tmpstr = strchr(curstr, ':');
+ tmpstr = HDstrchr(curstr, ':');
if (tmpstr == NULL) {
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,
"invalid SCHEME construction: probably not URL");
diff --git a/src/H5FDs3comms.h b/src/H5FDs3comms.h
index 0524c46..93a5a81 100644
--- a/src/H5FDs3comms.h
+++ b/src/H5FDs3comms.h
@@ -1,18 +1,17 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Read-Only S3 Virtual File Driver (VFD) *
- * Copyright (c) 2017-2018, The HDF Group. *
- * *
+ * Copyright by The HDF Group. *
* All rights reserved. *
* *
- * NOTICE: *
- * All information contained herein is, and remains, the property of The HDF *
- * Group. The intellectual and technical concepts contained herein are *
- * proprietary to The HDF Group. Dissemination of this information or *
- * reproduction of this material is strictly forbidden unless prior written *
- * permission is obtained from The HDF Group. *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*****************************************************************************
+ * Read-Only S3 Virtual File Driver (VFD)
*
* This is the header for the S3 Communications module
*
diff --git a/test/hdfs.c b/test/hdfs.c
index 11b9918..57dbac9 100644
--- a/test/hdfs.c
+++ b/test/hdfs.c
@@ -1,18 +1,18 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Read-Only HDFS Virtual File Driver (VFD) *
- * Copyright (c) 2018, The HDF Group. *
- * *
+ * Copyright by The HDF Group. *
* All rights reserved. *
* *
- * NOTICE: *
- * All information contained herein is, and remains, the property of The HDF *
- * Group. The intellectual and technical concepts contained herein are *
- * proprietary to The HDF Group. Dissemination of this information or *
- * reproduction of this material is strictly forbidden unless prior written *
- * permission is obtained from The HDF Group. *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
+ * Read-Only HDFS Virtual File Driver (VFD)
+ *
* Purpose:
*
* Verify behavior for Read-Only HDFS VFD.
diff --git a/test/ros3.c b/test/ros3.c
index 51c1a89..60d3932 100644
--- a/test/ros3.c
+++ b/test/ros3.c
@@ -1,18 +1,18 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Read-Only S3 Virtual File Driver (VFD) *
- * Copyright (c) 2017-2018, The HDF Group. *
- * *
+ * Copyright by The HDF Group. *
* All rights reserved. *
* *
- * NOTICE: *
- * All information contained herein is, and remains, the property of The HDF *
- * Group. The intellectual and technical concepts contained herein are *
- * proprietary to The HDF Group. Dissemination of this information or *
- * reproduction of this material is strictly forbidden unless prior written *
- * permission is obtained from The HDF Group. *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
+ * Read-Only S3 Virtual File Driver (VFD)
+ *
* Purpose:
*
* Verify behavior for Read-Only S3 VFD
diff --git a/test/s3comms.c b/test/s3comms.c
index 71d93c2..a797e04 100644
--- a/test/s3comms.c
+++ b/test/s3comms.c
@@ -1,18 +1,18 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Read-Only S3 Virtual File Driver (VFD) *
- * Copyright (c) 2017-2018, The HDF Group. *
- * *
+ * Copyright by The HDF Group. *
* All rights reserved. *
* *
- * NOTICE: *
- * All information contained herein is, and remains, the property of The HDF *
- * Group. The intellectual and technical concepts contained herein are *
- * proprietary to The HDF Group. Dissemination of this information or *
- * reproduction of this material is strictly forbidden unless prior written *
- * permission is obtained from The HDF Group. *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
+ * Read-Only S3 Virtual File Driver (VFD)
+ *
* Purpose: Unit tests for the S3 Communications (s3comms) module.
*
* Programmer: Jacob Smith <jake.smith@hdfgroup.org>
diff --git a/tools/libtest/Makefile.am b/tools/libtest/Makefile.am
index 5aa72b8..a93e25d 100644
--- a/tools/libtest/Makefile.am
+++ b/tools/libtest/Makefile.am
@@ -27,7 +27,7 @@ LDADD=$(LIBH5TOOLS) $(LIBHDF5)
# main target
-bin_PROGRAMS=h5tools_utils
+bin_PROGRAMS=h5tools_test_utils
# check_PROGRAMS=$(TEST_PROG)
diff --git a/tools/libtest/h5tools_utils.c b/tools/libtest/h5tools_test_utils.c
index 56e8a01..ac8e4c0 100644
--- a/tools/libtest/h5tools_utils.c
+++ b/tools/libtest/h5tools_test_utils.c
@@ -1,14 +1,13 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Copyright (c) 2017-2018, The HDF Group. *
- * *
+ * Copyright by The HDF Group. *
* All rights reserved. *
* *
- * NOTICE: *
- * All information contained herein is, and remains, the property of The HDF *
- * Group. The intellectual and technical concepts contained herein are *
- * proprietary to The HDF Group. Dissemination of this information or *
- * reproduction of this material is strictly forbidden unless prior written *
- * permission is obtained from The HDF Group. *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
@@ -331,7 +330,7 @@ if ((long)(actual) == (long)(expected)) { \
*----------------------------------------------------------------------------
*/
#define JSVERIFY_STR(expected, actual, reason) \
-if (strcmp((actual), (expected)) != 0) { \
+if (HDstrcmp((actual), (expected)) != 0) { \
JSERR_STR((expected), (actual), (reason)); \
goto error; \
} /* JSVERIFY_STR */
@@ -377,7 +376,7 @@ if ((long)(actual) == (long)(expected)) { \
*----------------------------------------------------------------------------
*/
#define JSVERIFY_STR(actual, expected, reason) \
-if (strcmp((actual), (expected)) != 0) { \
+if (HDstrcmp((actual), (expected)) != 0) { \
JSERR_STR((expected), (actual), (reason)); \
goto error; \
} /* JSVERIFY_STR */
@@ -773,7 +772,7 @@ test_populate_ros3_fa(void)
if (show_progress) { HDprintf("region overflow\n"); }
- HDassert(strlen(values[0]) > H5FD__ROS3_MAX_REGION_LEN);
+ HDassert(HDstrlen(values[0]) > H5FD__ROS3_MAX_REGION_LEN);
JSVERIFY( 0, h5tools_populate_ros3_fapl(&fa, values),
"could not fill fapl" )
@@ -841,7 +840,7 @@ test_populate_ros3_fa(void)
if (show_progress) { HDprintf("id overflow\n"); }
- HDassert(strlen(values[1]) > H5FD__ROS3_MAX_SECRET_ID_LEN);
+ HDassert(HDstrlen(values[1]) > H5FD__ROS3_MAX_SECRET_ID_LEN);
JSVERIFY( 0, h5tools_populate_ros3_fapl(&fa, values),
"could not fill fapl" )
@@ -945,7 +944,7 @@ test_populate_ros3_fa(void)
if (show_progress) { HDprintf("key overflow\n"); }
- HDassert(strlen(values[2]) > H5FD__ROS3_MAX_SECRET_KEY_LEN);
+ HDassert(HDstrlen(values[2]) > H5FD__ROS3_MAX_SECRET_KEY_LEN);
JSVERIFY( 0, h5tools_populate_ros3_fapl(&fa, values),
"could not fill fapl" )