diff options
-rw-r--r-- | c++/test/dsets.cpp | 44 | ||||
-rw-r--r-- | c++/test/h5cpputil.h | 4 | ||||
-rw-r--r-- | c++/test/tattr.cpp | 26 | ||||
-rw-r--r-- | c++/test/tcompound.cpp | 2 | ||||
-rw-r--r-- | c++/test/testhdf5.cpp | 24 | ||||
-rw-r--r-- | c++/test/tfile.cpp | 10 | ||||
-rw-r--r-- | c++/test/tfilter.cpp | 2 | ||||
-rw-r--r-- | c++/test/th5s.cpp | 14 | ||||
-rw-r--r-- | c++/test/tlinks.cpp | 2 | ||||
-rw-r--r-- | c++/test/trefer.cpp | 6 | ||||
-rw-r--r-- | c++/test/ttypes.cpp | 2 | ||||
-rw-r--r-- | c++/test/tvlstr.cpp | 20 |
12 files changed, 78 insertions, 78 deletions
diff --git a/c++/test/dsets.cpp b/c++/test/dsets.cpp index 6a5f223..e860f34 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; @@ -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..58f26f0 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 @@ -121,7 +120,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 @@ -270,7 +269,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 +335,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 +395,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 +450,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 +525,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 +593,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 870efae..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 @@ -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 { 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 |