summaryrefslogtreecommitdiffstats
path: root/c++/test/th5s.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'c++/test/th5s.cpp')
-rw-r--r--c++/test/th5s.cpp23
1 files changed, 9 insertions, 14 deletions
diff --git a/c++/test/th5s.cpp b/c++/test/th5s.cpp
index 258e904..e63c9af 100644
--- a/c++/test/th5s.cpp
+++ b/c++/test/th5s.cpp
@@ -36,7 +36,6 @@
#endif // H5_NO_STD
#endif
-#include "testhdf5.h" // C test header file
#include "H5Cpp.h" // C++ API header file
#ifndef H5_NO_NAMESPACE
@@ -44,6 +43,7 @@
#endif
#include "h5cpputil.h" // C++ utilility header file
+#include "H5srcdir.h" // srcdir querying header file
const H5std_string TESTFILE("th5s.h5");
const H5std_string DATAFILE("th5s1.h5");
@@ -121,7 +121,7 @@ static void test_h5s_basic()
hsize_t tmax[4];
// Output message about test being performed
- SUBTEST("Testing Dataspace Manipulation");
+ SUBTEST("Dataspace Manipulation");
try {
// Create simple dataspace sid1
@@ -185,13 +185,7 @@ static void test_h5s_basic()
* If this test fails and the H5S_MAX_RANK variable has changed, follow
* the instructions in space_overflow.c for regenating the th5s.h5 file.
*/
- char testfile[512]="";
- char *srcdir = getenv("srcdir");
- if (srcdir && ((strlen(srcdir) + strlen(TESTFILE.c_str()) + 1) < sizeof(testfile))){
- strcpy(testfile, srcdir);
- strcat(testfile, "/");
- }
- strcat(testfile, TESTFILE.c_str());
+ const char *testfile = H5_get_srcdir_filename(TESTFILE.c_str());
// Create file
H5File fid1(testfile, H5F_ACC_RDONLY);
@@ -270,7 +264,7 @@ static void test_h5s_basic()
static void test_h5s_scalar_write()
{
// Output message about test being performed
- SUBTEST("Testing Scalar Dataspace Writing");
+ SUBTEST("Scalar Dataspace Writing");
try {
// Create file
@@ -336,7 +330,7 @@ static void test_h5s_scalar_read()
hsize_t tdims[4]; // Dimension array to test with
// Output message about test being performed
- SUBTEST("Testing Scalar Dataspace Reading");
+ SUBTEST("Scalar Dataspace Reading");
try {
// Create file
@@ -396,7 +390,7 @@ static void test_h5s_scalar_read()
static void test_h5s_null()
{
// Output message about test being performed
- SUBTEST("Testing Null Dataspace Writing");
+ SUBTEST("Null Dataspace Writing");
try {
// Create file
@@ -451,7 +445,7 @@ static void test_h5s_null()
static void test_h5s_compound_scalar_write()
{
// Output message about test being performed
- SUBTEST("Testing Compound Dataspace Writing");
+ SUBTEST("Compound Dataspace Writing");
try {
// Create file
@@ -526,7 +520,7 @@ static void test_h5s_compound_scalar_read()
hsize_t tdims[4]; // Dimension array to test with
// Output message about test being performed
- SUBTEST("Testing Compound Dataspace Reading");
+ SUBTEST("Compound Dataspace Reading");
try {
// Create file
H5File fid1(DATAFILE, H5F_ACC_RDWR);
@@ -594,6 +588,7 @@ extern "C"
void test_h5s()
{
// Output message about test being performed
+ //MESSAGE("Testing Dataspaces\n");
MESSAGE(5, ("Testing Dataspaces\n"));
test_h5s_basic(); // Test basic H5S code