summaryrefslogtreecommitdiffstats
path: root/c++/test
diff options
context:
space:
mode:
Diffstat (limited to 'c++/test')
-rw-r--r--c++/test/H5srcdir_str.h.in22
-rw-r--r--c++/test/Makefile.am8
-rw-r--r--c++/test/Makefile.in38
-rw-r--r--c++/test/dsets.cpp46
-rw-r--r--c++/test/h5cpputil.h4
-rw-r--r--c++/test/tattr.cpp26
-rw-r--r--c++/test/tcompound.cpp2
-rw-r--r--c++/test/testhdf5.cpp24
-rw-r--r--c++/test/tfile.cpp10
-rw-r--r--c++/test/tfilter.cpp2
-rw-r--r--c++/test/th5s.cpp23
-rw-r--r--c++/test/tlinks.cpp6
-rw-r--r--c++/test/trefer.cpp6
-rw-r--r--c++/test/ttypes.cpp2
-rw-r--r--c++/test/tvlstr.cpp20
15 files changed, 126 insertions, 113 deletions
diff --git a/c++/test/H5srcdir_str.h.in b/c++/test/H5srcdir_str.h.in
new file mode 100644
index 0000000..d472124
--- /dev/null
+++ b/c++/test/H5srcdir_str.h.in
@@ -0,0 +1,22 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the files COPYING and Copyright.html. COPYING can be found at the root *
+ * of the source code distribution tree; Copyright.html can be found at the *
+ * root level of an installed copy of the electronic HDF5 document set and *
+ * is linked from the top-level documents page. It can also be found at *
+ * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
+ * access to either file, you may request a copy from help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/* If you are reading this file and it has a '.h' suffix, it was automatically
+ * generated from the '.in' version. Make changes there.
+ */
+
+/* Set the 'srcdir' path from configure time */
+static const char *config_srcdir = "@srcdir@";
+
diff --git a/c++/test/Makefile.am b/c++/test/Makefile.am
index fdfdd61..687f0ca 100644
--- a/c++/test/Makefile.am
+++ b/c++/test/Makefile.am
@@ -31,15 +31,15 @@ endif
# These are our main targets. They should be listed in the order to be
# executed, generally most specific tests to least specific tests.
-TEST_PROG=dsets testhdf5
+TEST_PROG=testhdf5
check_PROGRAMS=$(TEST_PROG)
# The tests depend on the hdf5 library, test library, and the c++ library
LDADD=$(LIBH5TEST) $(LIBH5CPP) $(LIBHDF5)
-dsets_SOURCES=dsets.cpp h5cpputil.cpp
-testhdf5_SOURCES=testhdf5.cpp tattr.cpp tcompound.cpp tfile.cpp tfilter.cpp \
- th5s.cpp tlinks.cpp trefer.cpp ttypes.cpp tvlstr.cpp h5cpputil.cpp
+testhdf5_SOURCES=testhdf5.cpp dsets.cpp tattr.cpp tcompound.cpp \
+ tfile.cpp tfilter.cpp th5s.cpp tlinks.cpp trefer.cpp \
+ ttypes.cpp tvlstr.cpp h5cpputil.cpp
# Tell conclude.am that these are C++ tests.
CXX_API=yes
diff --git a/c++/test/Makefile.in b/c++/test/Makefile.in
index e6d4f70..03c8ff7 100644
--- a/c++/test/Makefile.in
+++ b/c++/test/Makefile.in
@@ -50,8 +50,8 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
- $(top_srcdir)/config/commence.am \
+DIST_COMMON = $(srcdir)/H5srcdir_str.h.in $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in $(top_srcdir)/config/commence.am \
$(top_srcdir)/config/conclude.am
# Shared C++ libraries aren't universally supported.
@@ -65,17 +65,14 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/src/H5config.h
-CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_FILES = H5srcdir_str.h
CONFIG_CLEAN_VPATH_FILES =
-am__EXEEXT_1 = dsets$(EXEEXT) testhdf5$(EXEEXT)
-am_dsets_OBJECTS = dsets.$(OBJEXT) h5cpputil.$(OBJEXT)
-dsets_OBJECTS = $(am_dsets_OBJECTS)
-dsets_LDADD = $(LDADD)
-dsets_DEPENDENCIES = $(LIBH5TEST) $(LIBH5CPP) $(LIBHDF5)
-am_testhdf5_OBJECTS = testhdf5.$(OBJEXT) tattr.$(OBJEXT) \
- tcompound.$(OBJEXT) tfile.$(OBJEXT) tfilter.$(OBJEXT) \
- th5s.$(OBJEXT) tlinks.$(OBJEXT) trefer.$(OBJEXT) \
- ttypes.$(OBJEXT) tvlstr.$(OBJEXT) h5cpputil.$(OBJEXT)
+am__EXEEXT_1 = testhdf5$(EXEEXT)
+am_testhdf5_OBJECTS = testhdf5.$(OBJEXT) dsets.$(OBJEXT) \
+ tattr.$(OBJEXT) tcompound.$(OBJEXT) tfile.$(OBJEXT) \
+ tfilter.$(OBJEXT) th5s.$(OBJEXT) tlinks.$(OBJEXT) \
+ trefer.$(OBJEXT) ttypes.$(OBJEXT) tvlstr.$(OBJEXT) \
+ h5cpputil.$(OBJEXT)
testhdf5_OBJECTS = $(am_testhdf5_OBJECTS)
testhdf5_LDADD = $(LDADD)
testhdf5_DEPENDENCIES = $(LIBH5TEST) $(LIBH5CPP) $(LIBHDF5)
@@ -92,8 +89,8 @@ CXXLD = $(CXX)
CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
-SOURCES = $(dsets_SOURCES) $(testhdf5_SOURCES)
-DIST_SOURCES = $(dsets_SOURCES) $(testhdf5_SOURCES)
+SOURCES = $(testhdf5_SOURCES)
+DIST_SOURCES = $(testhdf5_SOURCES)
ETAGS = etags
CTAGS = ctags
am__tty_colors = \
@@ -362,13 +359,13 @@ INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/test -I$(top_srcdir)/c++/src
# These are our main targets. They should be listed in the order to be
# executed, generally most specific tests to least specific tests.
-TEST_PROG = dsets testhdf5
+TEST_PROG = testhdf5
# The tests depend on the hdf5 library, test library, and the c++ library
LDADD = $(LIBH5TEST) $(LIBH5CPP) $(LIBHDF5)
-dsets_SOURCES = dsets.cpp h5cpputil.cpp
-testhdf5_SOURCES = testhdf5.cpp tattr.cpp tcompound.cpp tfile.cpp tfilter.cpp \
- th5s.cpp tlinks.cpp trefer.cpp ttypes.cpp tvlstr.cpp h5cpputil.cpp
+testhdf5_SOURCES = testhdf5.cpp dsets.cpp tattr.cpp tcompound.cpp \
+ tfile.cpp tfilter.cpp th5s.cpp tlinks.cpp trefer.cpp \
+ ttypes.cpp tvlstr.cpp h5cpputil.cpp
# Tell conclude.am that these are C++ tests.
@@ -423,6 +420,8 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
+H5srcdir_str.h: $(top_builddir)/config.status $(srcdir)/H5srcdir_str.h.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
clean-checkPROGRAMS:
@list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \
@@ -432,9 +431,6 @@ clean-checkPROGRAMS:
list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
echo " rm -f" $$list; \
rm -f $$list
-dsets$(EXEEXT): $(dsets_OBJECTS) $(dsets_DEPENDENCIES)
- @rm -f dsets$(EXEEXT)
- $(CXXLINK) $(dsets_OBJECTS) $(dsets_LDADD) $(LIBS)
testhdf5$(EXEEXT): $(testhdf5_OBJECTS) $(testhdf5_DEPENDENCIES)
@rm -f testhdf5$(EXEEXT)
$(CXXLINK) $(testhdf5_OBJECTS) $(testhdf5_LDADD) $(LIBS)
diff --git a/c++/test/dsets.cpp b/c++/test/dsets.cpp
index 6a5f223..ee1a206 100644
--- a/c++/test/dsets.cpp
+++ b/c++/test/dsets.cpp
@@ -39,7 +39,6 @@
#endif // H5_NO_STD
#endif
-#include "testhdf5.h" // C test header file
#include "H5Cpp.h" // C++ API header file
#ifndef H5_NO_NAMESPACE
@@ -82,7 +81,7 @@ static size_t filter_bogus(unsigned int flags, size_t cd_nelmts,
static herr_t
test_create( H5File& file)
{
- TESTING("create, open, close");
+ SUBTEST("create, open, close");
// Setting this to NULL for cleaning up in failure situations
DataSet *dataset = NULL;
@@ -203,7 +202,7 @@ static herr_t
test_simple_io( H5File& file)
{
- TESTING("simple I/O");
+ SUBTEST("simple I/O");
int points[100][200];
int check[100][200];
@@ -294,7 +293,7 @@ test_tconv( H5File& file)
in = new char [4*1000000];
//assert (in);
- TESTING("data type conversion");
+ SUBTEST("data type conversion");
// Initialize the dataset
for (int i = 0; i < 1000000; i++) {
@@ -449,7 +448,7 @@ test_compression(H5File& file)
dscreatplist.setDeflate (6);
#ifdef H5_HAVE_FILTER_DEFLATE
- TESTING("compression (setup)");
+ SUBTEST("Compression (setup)");
// Create the dataset
dataset = new DataSet (file.createDataSet
@@ -461,7 +460,7 @@ test_compression(H5File& file)
* STEP 1: Read uninitialized data. It should be zero.
*----------------------------------------------------------------------
*/
- TESTING("compression (uninitialized read)");
+ SUBTEST("Compression (uninitialized read)");
dataset->read ((void*) check, PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer);
@@ -483,7 +482,7 @@ test_compression(H5File& file)
* to it.
*----------------------------------------------------------------------
*/
- TESTING("compression (write)");
+ SUBTEST("Compression (write)");
for (i=n=0; i<size[0]; i++)
{
@@ -501,7 +500,7 @@ test_compression(H5File& file)
* STEP 3: Try to read the data we just wrote.
*----------------------------------------------------------------------
*/
- TESTING("compression (read)");
+ SUBTEST("Compression (read)");
// Read the dataset back
dataset->read ((void*)check, PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer);
@@ -524,7 +523,7 @@ test_compression(H5File& file)
* dataset although we rewrite the whole thing.
*----------------------------------------------------------------------
*/
- TESTING("compression (modify)");
+ SUBTEST("Compression (modify)");
for (i=0; i<size[0]; i++)
{
@@ -555,7 +554,7 @@ test_compression(H5File& file)
* object header.
*----------------------------------------------------------------------
*/
- TESTING("compression (re-open)");
+ SUBTEST("Compression (re-open)");
// close this dataset to reuse the var
delete dataset;
@@ -581,7 +580,7 @@ test_compression(H5File& file)
* boundaries (we know that case already works from above tests).
*----------------------------------------------------------------------
*/
- TESTING("compression (partial I/O)");
+ SUBTEST("Compression (partial I/O)");
const hsize_t hs_size[2] = {4, 50};
const hsize_t hs_offset[2] = {7, 30};
@@ -617,7 +616,7 @@ test_compression(H5File& file)
PASSED();
#else
- TESTING("deflate filter");
+ SUBTEST("deflate filter");
SKIPPED();
cerr << not_supported << endl;
#endif
@@ -627,7 +626,7 @@ test_compression(H5File& file)
* to write and then read the dataset.
*----------------------------------------------------------------------
*/
- TESTING("compression (app-defined method)");
+ SUBTEST("Compression (app-defined method)");
if (H5Zregister (H5Z_BOGUS)<0)
throw Exception("test_compression", "Failed in app-defined method");
@@ -699,7 +698,7 @@ static herr_t
test_multiopen (H5File& file)
{
- TESTING("multi-open with extending");
+ SUBTEST("Multi-open with extending");
DataSpace* space = NULL;
try {
@@ -780,7 +779,7 @@ test_multiopen (H5File& file)
static herr_t
test_types(H5File& file)
{
- TESTING("various datatypes");
+ SUBTEST("Various datatypes");
size_t i;
DataSet* dset = NULL;
@@ -951,7 +950,7 @@ test_types(H5File& file)
} // test_types
/*-------------------------------------------------------------------------
- * Function: main
+ * Function: test_dset
*
* Purpose: Tests the dataset interface (H5D)
*
@@ -972,13 +971,16 @@ test_types(H5File& file)
*
*-------------------------------------------------------------------------
*/
-int
-main()
+#ifdef __cplusplus
+extern "C"
+#endif
+void test_dset()
{
hid_t fapl_id;
fapl_id = h5_fileaccess(); // in h5test.c, returns a file access template
int nerrors=0; // keep track of number of failures occurr
+
try
{
// Turn of the auto-printing when failure occurs so that we can
@@ -1005,16 +1007,12 @@ main()
}
catch (Exception E)
{
- return(test_report(nerrors, H5std_string(" Dataset")));
+ test_report(nerrors, H5std_string(" Dataset"));
}
// Clean up data file
cleanup_dsets();
-
- // Print out dsets test results
- cerr << endl << endl;
- return(test_report(nerrors, H5std_string(" Dataset")));
-} // main
+} // test_dset
/*-------------------------------------------------------------------------
* Function: cleanup_dsets
diff --git a/c++/test/h5cpputil.h b/c++/test/h5cpputil.h
index c547070..3313483 100644
--- a/c++/test/h5cpputil.h
+++ b/c++/test/h5cpputil.h
@@ -35,7 +35,8 @@ using std::cerr;
using std::endl;
#endif
-#define SUBTEST(WHAT) {printf(" Subtest: %-52s",WHAT); fflush(stdout);}
+#define MESSAGE(V,A) {if (HDGetTestVerbosity()>(V)) print_func A;}
+#define SUBTEST(TEST) {printf(" Subtest: %-52s",TEST); fflush(stdout);}
int check_values (hsize_t i, hsize_t j, int apoint, int acheck);
int test_report (int, const H5std_string&);
@@ -122,6 +123,7 @@ void test_h5s();
void test_reference();
void test_types();
void test_vlstrings();
+void test_dset();
/* Prototypes for the cleanup routines */
void cleanup_attr();
diff --git a/c++/test/tattr.cpp b/c++/test/tattr.cpp
index 48a3200..6bb9ca0 100644
--- a/c++/test/tattr.cpp
+++ b/c++/test/tattr.cpp
@@ -34,7 +34,6 @@
#endif // H5_NO_STD
#endif
-#include "testhdf5.h" // C test header file
#include "H5Cpp.h" // C++ API header file
#ifndef H5_NO_NAMESPACE
@@ -118,7 +117,7 @@ static void test_attr_basic_write()
int i;
// Output message about test being performed
- SUBTEST("Testing Basic Attribute Writing Functions");
+ SUBTEST("Basic Attribute Writing Functions");
try {
// Create file
@@ -237,7 +236,7 @@ static void test_attr_rename()
int i;
// Output message about test being performed
- SUBTEST("Testing Rename Attribute Function");
+ SUBTEST("Rename Attribute Function");
try {
// Open file
@@ -308,7 +307,7 @@ static void test_attr_basic_read()
int i, j;
// Output message about test being performed
- SUBTEST("Testing Basic Attribute Reading Functions");
+ SUBTEST("Basic Attribute Reading Functions");
try {
// Open file
@@ -375,7 +374,7 @@ static void test_attr_compound_write()
{
// Output message about test being performed
- SUBTEST("Testing Multiple Attribute Functions");
+ SUBTEST("Multiple Attribute Functions");
try {
// Create file
@@ -439,7 +438,7 @@ static void test_attr_compound_read()
int i,j;
// Output message about test being performed
- SUBTEST("Testing Basic Attribute Functions");
+ SUBTEST("Basic Attribute Functions");
try {
// Open file
@@ -568,7 +567,7 @@ static void test_attr_compound_read()
static void test_attr_scalar_write()
{
// Output message about test being performed
- SUBTEST("Testing Basic Scalar Attribute Writing Functions");
+ SUBTEST("Basic Scalar Attribute Writing Functions");
try {
// Create file
@@ -622,7 +621,7 @@ static void test_attr_scalar_write()
static void test_attr_scalar_read()
{
// Output message about test being performed
- SUBTEST("Testing Basic Scalar Attribute Reading Functions");
+ SUBTEST("Basic Scalar Attribute Reading Functions");
try {
// Open file
@@ -666,7 +665,7 @@ static void test_attr_scalar_read()
static void test_attr_mult_write()
{
// Output message about test being performed
- SUBTEST("Testing Multiple Attribute Writing Functions");
+ SUBTEST("Multiple Attribute Writing Functions");
try {
// Create file
@@ -743,7 +742,7 @@ static void test_attr_mult_read()
int i,j,k;
// Output message about test being performed
- SUBTEST("Testing Multiple Attribute Reading Functions");
+ SUBTEST("Multiple Attribute Reading Functions");
try {
// Open file
@@ -932,7 +931,7 @@ static void test_attr_delete()
H5std_string attr_name; // Buffer for attribute names
// Output message about test being performed
- SUBTEST("Testing Removing Attribute Function");
+ SUBTEST("Removing Attribute Function");
try {
// Open file
@@ -1032,7 +1031,7 @@ static void test_attr_dtype_shared()
h5_stat_size_t filesize; /* Size of file after modifications */
// Output message about test being performed
- SUBTEST("Testing Shared Datatypes with Attributes");
+ SUBTEST("Shared Datatypes with Attributes");
try {
// Create a file
@@ -1189,7 +1188,7 @@ const int ATTR_LEN = 17;
static void test_string_attr()
{
// Output message about test being performed
- SUBTEST("Testing I/O on FL and VL String Attributes");
+ SUBTEST("I/O on FL and VL String Attributes");
try {
// Create file
@@ -1308,6 +1307,7 @@ extern "C"
void test_attr()
{
// Output message about test being performed
+ //MESSAGE("Testing Attributes\n");
MESSAGE(5, ("Testing Attributes\n"));
test_attr_basic_write(); // Test basic H5A writing code
diff --git a/c++/test/tcompound.cpp b/c++/test/tcompound.cpp
index 2b1879b..fb8bd17 100644
--- a/c++/test/tcompound.cpp
+++ b/c++/test/tcompound.cpp
@@ -33,7 +33,6 @@
#endif // H5_NO_STD
#endif
-#include "testhdf5.h" // C test header file
#include "H5Cpp.h" // C++ API header file
#ifndef H5_NO_NAMESPACE
@@ -730,6 +729,7 @@ extern "C"
void test_compound()
{
// Output message about test being performed
+ //MESSAGE("Testing Compound Data Type operations\n");
MESSAGE(5, ("Testing Compound Data Type operations\n"));
test_compound_1(); // various things about compound data types
diff --git a/c++/test/testhdf5.cpp b/c++/test/testhdf5.cpp
index d61babf..fe08d6d 100644
--- a/c++/test/testhdf5.cpp
+++ b/c++/test/testhdf5.cpp
@@ -26,8 +26,6 @@
into the list of AddTest() calls in main() below. Functions which depend
on other functionality should be placed below the AddTest() call for the
base functionality testing.
- Each test module should include testhdf5.h and define a unique set of
- names for test files they create.
EXTERNAL ROUTINES/VARIABLES:
TestInit(...) -- Initialize testing framework
@@ -57,7 +55,7 @@
#endif // H5_NO_STD
#endif
-#include "testhdf5.h" // C test header file
+#include "h5test.h" // C test header file
#include "H5Cpp.h" // C++ API header file
#ifndef H5_NO_NAMESPACE
@@ -73,19 +71,21 @@ main(int argc, char *argv[])
TestInit(argv[0], NULL, NULL);
// testing file creation and opening in tfile.cpp
- AddTest("file", test_file, cleanup_file, "File I/O Operations", NULL);
+ AddTest("tfile", test_file, cleanup_file, "File I/O Operations", NULL);
+ // testing dataset functionalities in dset.cpp
+ AddTest("dsets", test_dset, cleanup_dsets, "Dataset I/O Operations", NULL);
// testing dataspace functionalities in th5s.cpp
- AddTest("h5s", test_h5s, cleanup_h5s, "Dataspaces", NULL);
+ AddTest("th5s", test_h5s, cleanup_h5s, "Dataspaces", NULL);
// testing attribute functionalities in tattr.cpp
- AddTest("attr", test_attr, cleanup_attr, "Attributes", NULL);
+ AddTest("tattr", test_attr, cleanup_attr, "Attributes", NULL);
// testing reference functionalities in trefer.cpp
- AddTest("reference", test_reference, cleanup_reference, "References", NULL);
+ AddTest("trefer", test_reference, cleanup_reference, "References", NULL);
// testing variable-length strings in tvlstr.cpp
- AddTest("vlstrings", test_vlstrings, cleanup_vlstrings, "Variable-Length Strings", NULL);
- AddTest("types", test_types, cleanup_types, "Generic Data Types", NULL);
- AddTest("compound", test_compound, cleanup_compound, "Compound Data Types", NULL);
- AddTest("filter", test_filters, cleanup_filters, "Various Filters", NULL);
- AddTest("links", test_links, cleanup_links, "Various Links", NULL);
+ AddTest("tvlstr", test_vlstrings, cleanup_vlstrings, "Variable-Length Strings", NULL);
+ AddTest("ttypes", test_types, cleanup_types, "Generic Data Types", NULL);
+ AddTest("tcompound", test_compound, cleanup_compound, "Compound Data Types", NULL);
+ AddTest("tfilter", test_filters, cleanup_filters, "Various Filters", NULL);
+ AddTest("tlinks", test_links, cleanup_links, "Various Links", NULL);
/* Comment out tests that are not done yet. - BMR, Feb 2001
AddTest("select", test_select, cleanup_select, "Selections", NULL);
AddTest("time", test_time, cleanup_time, "Time Datatypes", NULL);
diff --git a/c++/test/tfile.cpp b/c++/test/tfile.cpp
index 71f0a60..88ffc03 100644
--- a/c++/test/tfile.cpp
+++ b/c++/test/tfile.cpp
@@ -37,7 +37,6 @@
#endif // H5_NO_STD
#endif
-#include "testhdf5.h" // C test header file
#include "H5Cpp.h" // C++ API header file
#ifndef H5_NO_NAMESPACE
@@ -94,7 +93,7 @@ const H5std_string FILE4("tfile4.h5");
static void test_file_create()
{
// Output message about test being performed
- SUBTEST("Testing File Creation I/O");
+ SUBTEST("File Creation I/O");
// Test create with various sequences of H5F_ACC_EXCL and
// H5F_ACC_TRUNC flags
@@ -302,7 +301,7 @@ static void test_file_create()
static void test_file_open()
{
// Output message about test being performed
- SUBTEST("Testing File Opening I/O");
+ SUBTEST("File Opening I/O");
try {
@@ -351,7 +350,7 @@ static void test_file_open()
static void test_file_size()
{
// Output message about test being performed
- SUBTEST("Testing File Size");
+ SUBTEST("File Size");
hid_t fapl_id;
fapl_id = h5_fileaccess(); // in h5test.c, returns a file access template
@@ -419,7 +418,7 @@ typedef struct s1_t {
static void test_file_name()
{
// Output message about test being performed
- SUBTEST("Testing File Name");
+ SUBTEST("File Name");
H5std_string file_name;
try {
@@ -499,6 +498,7 @@ void test_file()
{
// Output message about test being performed
MESSAGE(5, ("Testing File I/O operations\n"));
+ //MESSAGE("Testing File I/O operations\n");
test_file_create(); // Test file creation (also creation templates)
test_file_open(); // Test file opening
diff --git a/c++/test/tfilter.cpp b/c++/test/tfilter.cpp
index 1d3cec2..e59707a 100644
--- a/c++/test/tfilter.cpp
+++ b/c++/test/tfilter.cpp
@@ -33,7 +33,6 @@
#endif // H5_NO_STD
#endif
-#include "testhdf5.h" // C test header file
#include "H5Cpp.h" // C++ API header file
#ifndef H5_NO_NAMESPACE
@@ -252,6 +251,7 @@ extern "C"
void test_filters()
{
// Output message about test being performed
+ //MESSAGE("Testing Various Filters\n");
MESSAGE(5, ("Testing Various Filters\n"));
hid_t fapl_id;
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
diff --git a/c++/test/tlinks.cpp b/c++/test/tlinks.cpp
index 83e33e1..53a1c8c 100644
--- a/c++/test/tlinks.cpp
+++ b/c++/test/tlinks.cpp
@@ -33,7 +33,6 @@
#endif // H5_NO_STD
#endif
-#include "testhdf5.h" // C test header file
#include "H5Cpp.h" // C++ API header file
#ifndef H5_NO_NAMESPACE
@@ -484,7 +483,7 @@ static void test_basic_links(hid_t fapl_id, hbool_t new_format)
// Verify link existence
if(H5Lexists(file.getId(), "dset1", H5P_DEFAULT) != TRUE)
throw InvalidActionException("H5Lexists", "dset1 doesn't exist");
- if(H5Lexists(file.getId(), "grp1/soft", H5P_DEFAULT) != TRUE)
+ if(H5Lexists(file.getId(), "grp1/soft", H5P_DEFAULT) != TRUE)
throw InvalidActionException("H5Lexists", "grp1/soft doesn't exist");
// Verify link values
@@ -531,6 +530,7 @@ void test_links()
fapl_id = h5_fileaccess();
// Output message about test being performed
+ //MESSAGE("Testing Various Links\n");
MESSAGE(5, ("Testing Various Links\n"));
try
{
@@ -689,7 +689,7 @@ void test_links()
* called last so the reset doesn't interfere with the property lists. This
* routine will delete its own file. */
/* nerrors += external_reset_register() < 0 ? 1 : 0;
- */
+ */
}
catch (Exception E)
{
diff --git a/c++/test/trefer.cpp b/c++/test/trefer.cpp
index c4ac93b..3875dfd 100644
--- a/c++/test/trefer.cpp
+++ b/c++/test/trefer.cpp
@@ -34,7 +34,6 @@
#endif // H5_NO_STD
#endif
-#include "testhdf5.h" // C test header file
#include "H5Cpp.h" // C++ API header file
#ifndef H5_NO_NAMESPACE
@@ -82,7 +81,7 @@ static void test_reference_obj(void)
const H5std_string write_comment="Foo!"; // Comments for group
// Output message about test being performed
- SUBTEST("Testing Object Reference Functions");
+ SUBTEST("Object Reference Functions");
H5File* file1 = NULL;
try {
@@ -205,7 +204,7 @@ static void test_reference_obj(void)
dset2.read(tbuf, PredType::NATIVE_UINT);
for(tu32=(unsigned *)tbuf,i=0; i<SPACE1_DIM1; i++,tu32++)
- VERIFY(*tu32, (uint32_t)(i*3), "Data");
+ verify_val(*tu32, (uint32_t)(i*3), "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__);
// Close dereferenced dataset
dset2.close();
@@ -290,6 +289,7 @@ extern "C"
void test_reference(void)
{
// Output message about test being performed
+ //MESSAGE("Testing References\n");
MESSAGE(5, ("Testing References\n"));
test_reference_obj(); // Test basic object reference functionality
diff --git a/c++/test/ttypes.cpp b/c++/test/ttypes.cpp
index e9c1615..ef00c08 100644
--- a/c++/test/ttypes.cpp
+++ b/c++/test/ttypes.cpp
@@ -33,7 +33,6 @@
#endif // H5_NO_STD
#endif
-#include "testhdf5.h" // C test header file
#include "H5Cpp.h" // C++ API header file
#ifndef H5_NO_NAMESPACE
@@ -524,6 +523,7 @@ extern "C"
void test_types()
{
// Output message about test being performed
+ //MESSAGE("Testing Generic Data Types\n");
MESSAGE(5, ("Testing Generic Data Types\n"));
// Test basic datatypes
diff --git a/c++/test/tvlstr.cpp b/c++/test/tvlstr.cpp
index 9722331..91036f9 100644
--- a/c++/test/tvlstr.cpp
+++ b/c++/test/tvlstr.cpp
@@ -35,7 +35,6 @@
#endif // H5_NO_STD
#endif
-#include "testhdf5.h" // C test header file
#include "H5Cpp.h" // C++ API header file
#ifndef H5_NO_NAMESPACE
@@ -140,7 +139,7 @@ const H5std_string DSET1_DATA("String Dataset");
static void test_vlstring_dataset()
{
// Output message about test being performed
- SUBTEST("Testing VL String on Datasets");
+ SUBTEST("VL String on Datasets");
try {
// Open the file
@@ -230,7 +229,7 @@ static void test_vlstring_array_dataset()
}; // Information to write
// Output message about test being performed
- SUBTEST("Testing VL String Array on Datasets");
+ SUBTEST("VL String Array on Datasets");
H5File* file1;
try {
@@ -327,7 +326,7 @@ static void test_vlstrings_special()
char *rdata[SPACE1_DIM1]; // Information read in
// Output message about test being performed.
- SUBTEST("Testing Special VL Strings");
+ SUBTEST("Special VL Strings");
try {
// Create file.
@@ -441,7 +440,7 @@ const H5std_string VLSTR_TYPE("vl_string_type");
static void test_vlstring_type()
{
// Output message about test being performed.
- SUBTEST("Testing VL String Type");
+ SUBTEST("VL String Type");
H5File* file1 = NULL;
try {
@@ -526,7 +525,7 @@ static void test_vlstring_type()
static void test_compact_vlstring()
{
// Output message about test being performed
- SUBTEST("Testing VL Strings on Compact Dataset");
+ SUBTEST("VL Strings on Compact Dataset");
try {
// Create file
@@ -609,7 +608,7 @@ const H5std_string ATTRSTR_DATA("String Attribute");
static void test_vlstring_attribute()
{
// Output message about test being performed
- SUBTEST("Testing VL String on Attributes");
+ SUBTEST("VL String on Attributes");
try {
// Open the file
@@ -692,7 +691,7 @@ static void test_read_vl_string_attribute()
{
// Output message about test being performed
- SUBTEST("Testing reading VL String as attributes");
+ SUBTEST("reading VL String as attributes");
try {
// Open file
@@ -757,7 +756,7 @@ static void test_vlstring_array_attribute()
}; // Information to write
// Output message about test being performed
- SUBTEST("Testing VL String Array on Attributes");
+ SUBTEST("VL String Array on Attributes");
try {
// Open the file
@@ -866,7 +865,7 @@ const int REWRITE_NDATASETS = 32;
static void test_vl_rewrite()
{
// Output message about test being performed
- SUBTEST("Testing I/O on VL strings with link/unlink");
+ SUBTEST("I/O on VL strings with link/unlink");
try {
// Create the files.
@@ -946,6 +945,7 @@ extern "C"
void test_vlstrings()
{
// Output message about test being performed
+ //MESSAGE("Testing Variable-Length Strings");
MESSAGE(5, ("Testing Variable-Length Strings"));
// These tests use the same file