summaryrefslogtreecommitdiffstats
path: root/c++/test/dsets.cpp
diff options
context:
space:
mode:
authorLarry Knox <lrknox@hdfgroup.org>2018-06-07 16:30:08 (GMT)
committerLarry Knox <lrknox@hdfgroup.org>2018-06-07 16:30:08 (GMT)
commit551f15f8ae02ca9c995619b216121081eb07633e (patch)
tree995de8be59b4d8524753eba6b542ce4039d54c79 /c++/test/dsets.cpp
parentb8c6b68c35fa2be23ef488a1d81097ff3ed55000 (diff)
parent664186b91d9198915baca4c6dca3f7b03695d316 (diff)
downloadhdf5-hdf5-1_8_21.zip
hdf5-hdf5-1_8_21.tar.gz
hdf5-hdf5-1_8_21.tar.bz2
Merge pull request #1106 in HDFFV/hdf5 from ~LRKNOX/hdf5_lrk:1.8/master to 1.8/masterhdf5-1_8_21
* commit '664186b91d9198915baca4c6dca3f7b03695d316': (124 commits) Commit HDF5 1.8.21 release version strings. Update INSTALL and INSTALL_parallel files to remove references to ancient systems and add generic steps for building HDF5 on HPC clusters. Update various INSTALL files for 1.8.21 release. Add missing space and correct typo. Modified a section for newly supported systems and compilers (vs. 1.8.20 release); Brought edits for tools bug fixes from 1.10.2 RELEASE.txt as we agreed with Allen. It is my test under Larry's guidance. Remove build directory which was unintentionally committed. Updated MANIFEST Switch default build mode to production. Update version to 1.8.21 in anticipation of release. Fixed EED-319 Description: Added an html version for the C++ function mapping table and removed the single web page version. Updated cpp_doc_config to use the html file. Fixed some typos. Running "doxygen cpp_doc_config" successfully. HDFFV-10473 fix HDFFV-10398 attribute location Add missing C++ entries to RELEASE.txt. pre1 release. Add missing RELEASE.txt entries for C++. Update Windows test machines Fix soversion naming and update cmake scripts Update version in RELEASE.txt. Correct merge errors from hdf5_1_8. Fixed typos Fixed typos Fixed typos ...
Diffstat (limited to 'c++/test/dsets.cpp')
-rw-r--r--c++/test/dsets.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/c++/test/dsets.cpp b/c++/test/dsets.cpp
index 8d2618b..0a187ef 100644
--- a/c++/test/dsets.cpp
+++ b/c++/test/dsets.cpp
@@ -68,6 +68,8 @@ static size_t filter_bogus(unsigned int flags, size_t cd_nelmts,
*
*-------------------------------------------------------------------------
*/
+const H5std_string DSET_COMMENT ("This is a dataset");
+const H5std_string NON_EXISTING_DSET ("does_not_exist");
static herr_t
test_create( H5File& file)
{
@@ -83,13 +85,12 @@ test_create( H5File& file)
DataSpace space (2, dims, NULL);
// Create a dataset using the default dataset creation properties.
- // We're not sure what they are, so we won't check.
dataset = new DataSet (file.createDataSet
(DSET_DEFAULT_NAME, PredType::NATIVE_DOUBLE, space));
// Add a comment to the dataset
- file.setComment (DSET_DEFAULT_NAME, "This is a dataset");
+ file.setComment (DSET_DEFAULT_NAME, DSET_COMMENT);
// Close the dataset
delete dataset;
@@ -120,7 +121,7 @@ test_create( H5File& file)
// Get and verify the comment from this dataset, using
// H5std_string getComment(const H5std_string& name, <buf_size=0, by default>)
H5std_string comment = file.getComment(DSET_DEFAULT_NAME);
- verify_val(comment, "This is a dataset", "DataSet::getComment", __LINE__, __FILE__);
+ verify_val(comment, DSET_COMMENT, "DataSet::getComment", __LINE__, __FILE__);
// Close the dataset when accessing is completed
delete dataset;
@@ -132,24 +133,24 @@ test_create( H5File& file)
// exception is not thrown for this action by openDataSet, then
// display failure information and throw an exception.
try {
- dataset = new DataSet (file.openDataSet( "does_not_exist" ));
+ dataset = new DataSet (file.openDataSet(NON_EXISTING_DSET));
// continuation here, that means no exception has been thrown
throw InvalidActionException("H5File::openDataSet", "Attempted to open a non-existent dataset");
}
- catch (FileIException& E ) // catching creating non-existent dataset
+ catch (FileIException& E ) // catching opening non-existent dataset
{} // do nothing, exception expected
- // Create a new dataset that uses chunked storage instead of the default
- // layout.
+ // Create a new dataset that uses chunked storage instead of the
+ // default layout.
DSetCreatPropList create_parms;
- hsize_t csize[2];
+ hsize_t csize[2];
csize[0] = 5;
csize[1] = 100;
create_parms.setChunk( 2, csize );
dataset = new DataSet (file.createDataSet
- (DSET_CHUNKED_NAME, PredType::NATIVE_DOUBLE, space, create_parms));
+ (DSET_CHUNKED_NAME, PredType::NATIVE_DOUBLE, space, create_parms));
// Note: this one has no error message in C when failure occurs?
// clean up and return with success