summaryrefslogtreecommitdiffstats
path: root/c++/test
diff options
context:
space:
mode:
authorLarry Knox <lrknox@hdfgroup.org>2021-03-12 18:00:15 (GMT)
committerGitHub <noreply@github.com>2021-03-12 18:00:15 (GMT)
commita09e1ea2191ad0ea2a72f7bd519b2cc95f218328 (patch)
tree7b41ca2a3fe29309e39db5ea13d1708c2c0ca69a /c++/test
parent579b266e65974fad1f7c30ac5c7c24405e2d326e (diff)
downloadhdf5-a09e1ea2191ad0ea2a72f7bd519b2cc95f218328.zip
hdf5-a09e1ea2191ad0ea2a72f7bd519b2cc95f218328.tar.gz
hdf5-a09e1ea2191ad0ea2a72f7bd519b2cc95f218328.tar.bz2
Hdf5 merge issue #458 to hdf5_1_12 (#463)
* Snapshot version 1.12 release 1-3. Update version to 1.12.1-4. * First cut of the H5 public API documentation. (#80) * First cut of the H5 public API documentation. * Added H5Z "bonus track." * Applied Quincey's patch. * Added the missing patches from Quincey's original patch. * H5PL (complete) and basic H5VL API documentation. * Added H5I API docs. * Added H5L API docs. * First installment from Elena's H5T batch. * Second installment of Elena's H5T batch. * Final installment of Elena's H5T batch. * Full set of current H5F documentation. (#105) * First cut of the H5 public API documentation. * Added H5Z "bonus track." * Applied Quincey's patch. * Added the missing patches from Quincey's original patch. * H5PL (complete) and basic H5VL API documentation. * Added H5I API docs. * Added H5L API docs. * First installment from Elena's H5T batch. * Second installment of Elena's H5T batch. * Final installment of Elena's H5T batch. * Migrated documentation for SWMR functions. * Catching up on MDC functions. * Integrated the H5F MDC function documentation. * Added MDC and parallel H5F functions. * Slightly updated main page. * Added doxygen/dox/H5AC_cache_config_t.dox to MANIFEST. * Doxygen - added (mostly) beginner functions (#112) * Doxygen - added (mostly) beginner functions * Removed duplicate H5Pset_szip function * Add src/H5module.h to MANIFEST. * close #195. (#196) * Update HDF5PluginMacros.cmake * Update HDF5PluginMacros.cmake * Avoid aligned access for references by decoding into temporary buffer and then copying the result into the actual buffer. Update test to be more thorough with using compound datatype fields everywhere. (#206) * Modify temporary rpath for testing in java example scripts. (#230) * Fix undefined left shifting of negative numbers (#338) Undefined Bahavior Sanitizer errored here about left shifting negative numbers. * Fixes various warnings noticed on Windows (#425) * Fixes various warnings noticed on Windows - Adds a prototype for our implementation of vasprintf - Return type of H5_get_utf16_str() is now non-const - Fixes possible uninitialized return type in Wremove_utf8 - Better isolation of fork() code in accum.c:test_swmr_write_big() - Better isolation of non-zlib code in dsets.c:test_filter_delete() - Removed unused variable in trefer.c:test_reference_cmpnd_obj() * Fixes clang-format issues * Applied clang-tidy readability-non-const-parameter warning fixes auto… (#429) * Automatically applied clang-tidy readability-avoid-const-params-in-decls fixes Removes useless const declarations. * Fixed most readability-non-const-parameter warnings These changes were made automatically by clang-tidy, but I manually reverted the changes related to the H5Z_func_t signature. * Reformat source with clang v10.0.1. Co-authored-by: Larry Knox <lrknox@hdfgroup.org> * Added C++11 override keyword where appropriate (#433) Added H5_OVERRIDE macro for compatibility with both C++11 and older. * Various clang tidy warning fixes (#448) * Fixed clang-tidy bugprone-reserved-identifier warnings * Fixed clang-tidy bugprone-assert-side-effect warnings * Fixed clang-tidy bugprone-copy-constructor-init warning * Fixed clang-tidy readability-redundant-preprocessor warning For error_test.c the removed code was already dead, because it was in the else of an `#if H5_USE_16_API` block. Based on H5Location.h, I think p_get_ref_obj_type was meant to be in `#ifndef DOXYGEN_SHOULD_SKIP_THIS` and an `#endif` was missing. Similarly, in the header, getObjTypeByIdx is only in H5_NO_DEPRECATED_SYMBOLS, not DOXYGEN_SHOULD_SKIP_THIS. * Fixed clang-tidy readability-redundant-string-init warnings * Fixed some clang-tidy performance-type-promotion-in-math-fn warnings * Fixed clang-tidy performance-unnecessary-value-param warnings * Reformat source with clang v10.0.1. Co-authored-by: Larry Knox <lrknox@hdfgroup.org> * Removed checks/workarounds for pre-C++89 compatibility (#449) After 30+ years, just assume that the following exist: - extension-less includes - namespaces - std:: - static_cast - bool * Fixed all clang-tidy bugprone-suspicious-string-compare warnings (#451) * Fixed all clang-tidy bugprone-suspicious-string-compare warnings This change was generated entirely by clang-tidy itself. * Reformat code with clang v10.0.1. Co-authored-by: Larry Knox <lrknox@hdfgroup.org> * Remove 2 functions incorrectly merged from develop in a cherry-pick merge of PR #451. Co-authored-by: Gerd Heber <gheber@hdfgroup.org> Co-authored-by: bljhdf <58825073+bljhdf@users.noreply.github.com> Co-authored-by: H. Joe Lee <hyoklee@hdfgroup.org> Co-authored-by: Quincey Koziol <quincey@koziol.cc> Co-authored-by: Sean McBride <sean@rogue-research.com> Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com>
Diffstat (limited to 'c++/test')
-rw-r--r--c++/test/dsets.cpp6
-rw-r--r--c++/test/h5cpputil.cpp8
-rw-r--r--c++/test/h5cpputil.h4
-rw-r--r--c++/test/tarray.cpp4
-rw-r--r--c++/test/tattr.cpp24
-rw-r--r--c++/test/tcompound.cpp6
-rw-r--r--c++/test/tdspl.cpp4
-rw-r--r--c++/test/testhdf5.cpp4
-rw-r--r--c++/test/tfile.cpp4
-rw-r--r--c++/test/tfilter.cpp4
-rw-r--r--c++/test/th5s.cpp6
-rw-r--r--c++/test/titerate.cpp4
-rw-r--r--c++/test/tlinks.cpp6
-rw-r--r--c++/test/tobject.cpp4
-rw-r--r--c++/test/trefer.cpp4
-rw-r--r--c++/test/ttypes.cpp4
-rw-r--r--c++/test/tvlstr.cpp6
17 files changed, 19 insertions, 83 deletions
diff --git a/c++/test/dsets.cpp b/c++/test/dsets.cpp
index 03e4927..0faf457 100644
--- a/c++/test/dsets.cpp
+++ b/c++/test/dsets.cpp
@@ -23,11 +23,7 @@
***************************************************************************/
-#ifdef OLD_HEADER_FILENAME
-#include <iostream.h>
-#else
#include <iostream>
-#endif
using std::cerr;
using std::endl;
@@ -1161,7 +1157,7 @@ const int RANK1 = 1;
const H5std_string FILE_ACCPLIST("test_accplist.h5");
static herr_t
-test_chunk_cache(FileAccPropList fapl)
+test_chunk_cache(const FileAccPropList &fapl)
{
SUBTEST("DSetAccPropList::set/getChunkCache");
diff --git a/c++/test/h5cpputil.cpp b/c++/test/h5cpputil.cpp
index e38b34a..38f9300 100644
--- a/c++/test/h5cpputil.cpp
+++ b/c++/test/h5cpputil.cpp
@@ -19,11 +19,7 @@
***************************************************************************/
-#ifdef OLD_HEADER_FILENAME
-#include <iostream.h>
-#else
#include <iostream>
-#endif
using std::cerr;
using std::endl;
@@ -216,7 +212,7 @@ InvalidActionException::InvalidActionException() : Exception() {}
// func - IN: Name of the function where failure should occur
// message - IN: Message
//--------------------------------------------------------------------------
-InvalidActionException::InvalidActionException(const H5std_string func, const H5std_string message)
+InvalidActionException::InvalidActionException(const H5std_string &func, const H5std_string &message)
: Exception(func, message)
{
}
@@ -241,7 +237,7 @@ TestFailedException::TestFailedException() : Exception() {}
// func - IN: Name of the function where failure should occur
// message - IN: Message
//--------------------------------------------------------------------------
-TestFailedException::TestFailedException(const H5std_string func, const H5std_string message)
+TestFailedException::TestFailedException(const H5std_string &func, const H5std_string &message)
: Exception(func, message)
{
}
diff --git a/c++/test/h5cpputil.h b/c++/test/h5cpputil.h
index 4439ae3..444bc68 100644
--- a/c++/test/h5cpputil.h
+++ b/c++/test/h5cpputil.h
@@ -48,14 +48,14 @@ void issue_fail_msg(const char *where, int line, const char *file_name, const ch
class InvalidActionException : public Exception {
public:
- InvalidActionException(const H5std_string func_name, const H5std_string message = DEFAULT_MSG);
+ InvalidActionException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG);
InvalidActionException();
virtual ~InvalidActionException() throw();
};
class TestFailedException : public Exception {
public:
- TestFailedException(const H5std_string func_name, const H5std_string message = DEFAULT_MSG);
+ TestFailedException(const H5std_string &func_name, const H5std_string &message = DEFAULT_MSG);
TestFailedException();
virtual ~TestFailedException() throw();
};
diff --git a/c++/test/tarray.cpp b/c++/test/tarray.cpp
index ba71da8..ce1eae9 100644
--- a/c++/test/tarray.cpp
+++ b/c++/test/tarray.cpp
@@ -16,11 +16,7 @@
tarray.cpp - HDF5 C++ testing the array datatype functionality
***************************************************************************/
-#ifdef OLD_HEADER_FILENAME
-#include <iostream.h>
-#else
#include <iostream>
-#endif
using std::cerr;
using std::endl;
diff --git a/c++/test/tattr.cpp b/c++/test/tattr.cpp
index e308a3a..f8afb8f 100644
--- a/c++/test/tattr.cpp
+++ b/c++/test/tattr.cpp
@@ -17,11 +17,7 @@
C attribute interface (H5A)
***************************************************************************/
-#ifdef OLD_HEADER_FILENAME
-#include <iostream.h>
-#else
#include <iostream>
-#endif
using std::cerr;
using std::endl;
@@ -775,16 +771,16 @@ test_attr_compound_read()
hsize_t ii, jj;
for (ii = 0; ii < ATTR4_DIM1; ii++)
for (jj = 0; jj < ATTR4_DIM2; jj++)
- if (HDmemcmp(&attr_data4[ii][jj], &read_data4[ii][jj], sizeof(struct attr4_struct))) {
- TestErrPrintf(
- "%d:attribute data different: attr_data4[%d][%d].i=%d, read_data4[%d][%d].i=%d\n",
- __LINE__, ii, jj, attr_data4[ii][jj].i, ii, jj, read_data4[ii][jj].i);
- TestErrPrintf(
- "%d:attribute data different: attr_data4[%d][%d].d=%f, read_data4[%d][%d].d=%f\n",
- __LINE__, ii, jj, attr_data4[ii][jj].d, ii, jj, read_data4[ii][jj].d);
- TestErrPrintf(
- "%d:attribute data different: attr_data4[%d][%d].c=%c, read_data4[%d][%d].c=%c\n",
- __LINE__, ii, jj, attr_data4[ii][jj].c, ii, jj, read_data4[ii][jj].c);
+ if (HDmemcmp(&attr_data4[ii][jj], &read_data4[ii][jj], sizeof(struct attr4_struct)) != 0) {
+ TestErrPrintf("%d:attribute data different: attr_data4[%llu][%llu].i=%d, "
+ "read_data4[%llu][%llu].i=%d\n",
+ __LINE__, ii, jj, attr_data4[ii][jj].i, ii, jj, read_data4[ii][jj].i);
+ TestErrPrintf("%d:attribute data different: attr_data4[%llu][%llu].d=%f, "
+ "read_data4[%llu][%llu].d=%f\n",
+ __LINE__, ii, jj, attr_data4[ii][jj].d, ii, jj, read_data4[ii][jj].d);
+ TestErrPrintf("%d:attribute data different: attr_data4[%llu][%llu].c=%c, "
+ "read_data4[%llu][%llu].c=%c\n",
+ __LINE__, ii, jj, attr_data4[ii][jj].c, ii, jj, read_data4[ii][jj].c);
} /* end if */
// Verify name
diff --git a/c++/test/tcompound.cpp b/c++/test/tcompound.cpp
index 641002e..82c21e8 100644
--- a/c++/test/tcompound.cpp
+++ b/c++/test/tcompound.cpp
@@ -16,11 +16,7 @@
tcompound.cpp - HDF5 C++ testing the compound data type functionality
***************************************************************************/
-#ifdef OLD_HEADER_FILENAME
-#include <iostream.h>
-#else
#include <iostream>
-#endif
using std::cerr;
using std::endl;
@@ -491,7 +487,7 @@ test_compound_5()
int_array.close();
/* Check results */
- if (memcmp(src[1].name, dst[1].name, sizeof(src[1].name)) || src[1].tdim != dst[1].tdim ||
+ if (memcmp(src[1].name, dst[1].name, sizeof(src[1].name)) != 0 || src[1].tdim != dst[1].tdim ||
src[1].coll_ids[0] != dst[1].coll_ids[0] || src[1].coll_ids[1] != dst[1].coll_ids[1] ||
src[1].coll_ids[2] != dst[1].coll_ids[2] || src[1].coll_ids[3] != dst[1].coll_ids[3]) {
H5_FAILED();
diff --git a/c++/test/tdspl.cpp b/c++/test/tdspl.cpp
index fc73a6a..257233e 100644
--- a/c++/test/tdspl.cpp
+++ b/c++/test/tdspl.cpp
@@ -17,11 +17,7 @@
list functionality
***************************************************************************/
-#ifdef OLD_HEADER_FILENAME
-#include <iostream.h>
-#else
#include <iostream>
-#endif
using std::cerr;
using std::endl;
diff --git a/c++/test/testhdf5.cpp b/c++/test/testhdf5.cpp
index da5e2a4..71428ce 100644
--- a/c++/test/testhdf5.cpp
+++ b/c++/test/testhdf5.cpp
@@ -38,11 +38,7 @@
GetTestNumErrs() -- Retrieve the number of testing errors
***************************************************************************/
-#ifdef OLD_HEADER_FILENAME
-#include <iostream.h>
-#else
#include <iostream>
-#endif
using std::cerr;
using std::endl;
diff --git a/c++/test/tfile.cpp b/c++/test/tfile.cpp
index b082f0a..5e4e91b 100644
--- a/c++/test/tfile.cpp
+++ b/c++/test/tfile.cpp
@@ -20,11 +20,7 @@
h5_fileaccess() -- in h5test.c, returns a file access template
***************************************************************************/
-#ifdef OLD_HEADER_FILENAME
-#include <iostream.h>
-#else
#include <iostream>
-#endif
using std::cerr;
using std::endl;
diff --git a/c++/test/tfilter.cpp b/c++/test/tfilter.cpp
index 2df88b2..e89838c 100644
--- a/c++/test/tfilter.cpp
+++ b/c++/test/tfilter.cpp
@@ -16,11 +16,7 @@
tfilter.cpp - HDF5 C++ testing various filters and their combination.
***************************************************************************/
-#ifdef OLD_HEADER_FILENAME
-#include <iostream.h>
-#else
#include <iostream>
-#endif
using std::cerr;
using std::endl;
diff --git a/c++/test/th5s.cpp b/c++/test/th5s.cpp
index e57ac04..9952e68 100644
--- a/c++/test/th5s.cpp
+++ b/c++/test/th5s.cpp
@@ -19,11 +19,7 @@
EXTERNAL ROUTINES/VARIABLES:
***************************************************************************/
-#ifdef OLD_HEADER_FILENAME
-#include <iostream.h>
-#else
#include <iostream>
-#endif
using std::cerr;
using std::endl;
@@ -516,7 +512,7 @@ test_h5s_compound_scalar_read()
dataset.read(&rdata, type);
// Verify read data
- if (HDmemcmp(&space4_data, &rdata, sizeof(struct space4_struct))) {
+ if (HDmemcmp(&space4_data, &rdata, sizeof(struct space4_struct)) != 0) {
cerr << "scalar data different: space4_data.c1=" << space4_data.c1
<< ", read_data4.c1=" << rdata.c1 << endl;
cerr << "scalar data different: space4_data.u=" << space4_data.u << ", read_data4.u=" << rdata.u
diff --git a/c++/test/titerate.cpp b/c++/test/titerate.cpp
index 1fb2f57..17620ca 100644
--- a/c++/test/titerate.cpp
+++ b/c++/test/titerate.cpp
@@ -16,11 +16,7 @@
titerate.cpp - HDF5 C++ testing iterate related functionality
***************************************************************************/
-#ifdef OLD_HEADER_FILENAME
-#include <iostream.h>
-#else
#include <iostream>
-#endif
using std::cerr;
using std::endl;
diff --git a/c++/test/tlinks.cpp b/c++/test/tlinks.cpp
index 231bff2..e8dad5b 100644
--- a/c++/test/tlinks.cpp
+++ b/c++/test/tlinks.cpp
@@ -16,11 +16,7 @@
C link interface (H5L)
***************************************************************************/
-#ifdef OLD_HEADER_FILENAME
-#include <iostream.h>
-#else
#include <iostream>
-#endif
using std::cerr;
using std::endl;
@@ -593,7 +589,7 @@ visit_obj_cb(H5Object &obj, const H5std_string name, const H5O_info2_t *oinfo, v
ovisit_ud_t *op_data = static_cast<ovisit_ud_t *>(_op_data);
// Check for correct object information
- if (strcmp(op_data->info[op_data->idx].path, name.c_str()))
+ if (strcmp(op_data->info[op_data->idx].path, name.c_str()) != 0)
return (H5_ITER_ERROR);
if (op_data->info[op_data->idx].type != oinfo->type)
return (H5_ITER_ERROR);
diff --git a/c++/test/tobject.cpp b/c++/test/tobject.cpp
index 87abd43..5892f39 100644
--- a/c++/test/tobject.cpp
+++ b/c++/test/tobject.cpp
@@ -16,11 +16,7 @@
tobject.cpp - HDF5 C++ testing object related functionality
***************************************************************************/
-#ifdef OLD_HEADER_FILENAME
-#include <iostream.h>
-#else
#include <iostream>
-#endif
#include <string>
#include "H5Cpp.h" // C++ API header file
diff --git a/c++/test/trefer.cpp b/c++/test/trefer.cpp
index 5ec04cd..939b0ee 100644
--- a/c++/test/trefer.cpp
+++ b/c++/test/trefer.cpp
@@ -17,11 +17,7 @@
Reference interface (H5R)
***************************************************************************/
-#ifdef OLD_HEADER_FILENAME
-#include <iostream.h>
-#else
#include <iostream>
-#endif
using std::cerr;
using std::endl;
diff --git a/c++/test/ttypes.cpp b/c++/test/ttypes.cpp
index cf32b2b..5fc82a5 100644
--- a/c++/test/ttypes.cpp
+++ b/c++/test/ttypes.cpp
@@ -16,11 +16,7 @@
ttypes.cpp - HDF5 C++ testing the general datatype functionality
***************************************************************************/
-#ifdef OLD_HEADER_FILENAME
-#include <iostream.h>
-#else
#include <iostream>
-#endif
using std::cerr;
using std::endl;
diff --git a/c++/test/tvlstr.cpp b/c++/test/tvlstr.cpp
index 5d671d1..b371518 100644
--- a/c++/test/tvlstr.cpp
+++ b/c++/test/tvlstr.cpp
@@ -18,11 +18,7 @@
EXTERNAL ROUTINES/VARIABLES:
***************************************************************************/
-#ifdef OLD_HEADER_FILENAME
-#include <iostream.h>
-#else
#include <iostream>
-#endif
using std::cerr;
using std::endl;
@@ -865,7 +861,7 @@ read_scalar_dset(H5File &file, DataType &type, DataSpace &space, char *name, cha
dset.read(&data_read, type, space, space);
dset.close();
- if (HDstrcmp(data, data_read))
+ if (HDstrcmp(data, data_read) != 0)
TestErrPrintf("Expected %s for dataset %s but read %s\n", data, name, data_read);
HDfree(data_read);