summaryrefslogtreecommitdiffstats
path: root/c++/test/testhdf5.cpp
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2014-04-06 22:36:15 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2014-04-06 22:36:15 (GMT)
commita08f75b0737c86d51bbc91538e78b1455eb2cae7 (patch)
treea1e1c4f1cf8ddda6dd0a101af17dc8524ad23050 /c++/test/testhdf5.cpp
parent70daa61a876274a92c0d43ec0116d68e35d0c2ce (diff)
downloadhdf5-a08f75b0737c86d51bbc91538e78b1455eb2cae7.zip
hdf5-a08f75b0737c86d51bbc91538e78b1455eb2cae7.tar.gz
hdf5-a08f75b0737c86d51bbc91538e78b1455eb2cae7.tar.bz2
[svn-r24969] Description:
- Added wrappers to H5Object for H5Iget_name() to get object's name ssize_t getObjName(char *obj_name, size_t buf_size = 0) const; ssize_t getObjName(H5std_string& obj_name, size_t len = 0) const; H5std_string getObjName() const; - Added tests tobject.cpp - Added to various cleanup_* functions in tests to remove generated files - Added an overload H5I_type_t getHDFObjType() to get object's type Platforms tested: Linux/ppc64 (ostrich) Linux/32 2.6 (jam) SunOS 5.11 (emu) with gmake
Diffstat (limited to 'c++/test/testhdf5.cpp')
-rw-r--r--c++/test/testhdf5.cpp71
1 files changed, 42 insertions, 29 deletions
diff --git a/c++/test/testhdf5.cpp b/c++/test/testhdf5.cpp
index 57210d0..19b4f0d 100644
--- a/c++/test/testhdf5.cpp
+++ b/c++/test/testhdf5.cpp
@@ -67,41 +67,54 @@
int
main(int argc, char *argv[])
{
- /* Initialize testing framework */
- TestInit(argv[0], NULL, NULL);
-
- // testing file creation and opening in tfile.cpp
- 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("th5s", test_h5s, cleanup_h5s, "Dataspaces", NULL);
- // testing attribute functionalities in tattr.cpp
- AddTest("tattr", test_attr, cleanup_attr, "Attributes", NULL);
- // testing reference functionalities in trefer.cpp
- AddTest("trefer", test_reference, cleanup_reference, "References", NULL);
- // testing variable-length strings in tvlstr.cpp
- 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("tdspl", test_dsproplist, cleanup_dsproplist, "Dataset Property List", NULL);
- AddTest("tfilter", test_filters, cleanup_filters, "Various Filters", NULL);
- AddTest("tlinks", test_links, cleanup_links, "Various Links", NULL);
+ try
+ {
+ // Turn of the auto-printing when failure occurs so that we can
+ // handle the errors appropriately since sometime failures are
+ // caused deliberately and expected.
+ Exception::dontPrint();
+ /* Initialize testing framework */
+ TestInit(argv[0], NULL, NULL);
+
+ // testing file creation and opening in tfile.cpp
+ 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("th5s", test_h5s, cleanup_h5s, "Dataspaces", NULL);
+ // testing attribute functionalities in tattr.cpp
+ AddTest("tattr", test_attr, cleanup_attr, "Attributes", NULL);
+ // testing object functionalities in tobject.cpp
+ AddTest("tobject", test_object, cleanup_object, "Objects", NULL);
+ // testing reference functionalities in trefer.cpp
+ AddTest("trefer", test_reference, cleanup_reference, "References", NULL);
+ // testing variable-length strings in tvlstr.cpp
+ 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("tdspl", test_dsproplist, cleanup_dsproplist, "Dataset Property List", 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);
- AddTest("vltypes", test_vltypes, cleanup_vltypes, "Variable-Length Datatypes", NULL);
- AddTest("iterate", test_iterate, cleanup_iterate, "Group & Attribute Iteration", NULL);
- AddTest("array", test_array, cleanup_array, "Array Datatypes", NULL);
- AddTest("genprop", test_genprop, cleanup_genprop, "Generic Properties", NULL);
- AddTest("id", test_ids, NULL, "User-Created Identifiers", NULL);
+ AddTest("select", test_select, cleanup_select, "Selections", NULL);
+ AddTest("time", test_time, cleanup_time, "Time Datatypes", NULL);
+ AddTest("vltypes", test_vltypes, cleanup_vltypes, "Variable-Length Datatypes", NULL);
+ AddTest("iterate", test_iterate, cleanup_iterate, "Group & Attribute Iteration", NULL);
+ AddTest("array", test_array, cleanup_array, "Array Datatypes", NULL);
+ AddTest("genprop", test_genprop, cleanup_genprop, "Generic Properties", NULL);
+ AddTest("id", test_ids, NULL, "User-Created Identifiers", NULL);
Comment out tests that are not done yet */
/* Tentative - BMR 2007/1/12
- AddTest("datatypes", test_dtypes, cleanup_dtypes, "Data Types", NULL);
- AddTest("enum", test_enum, cleanup_enum, "Enum Data Types", NULL);
+ AddTest("enum", test_enum, cleanup_enum, "Enum Data Types", NULL);
*/
+ }
+ catch (Exception E)
+ {
+ issue_fail_msg("Tests failed", __LINE__, __FILE__, E.getCDetailMsg());
+ }
+
/* Display testing information */
TestInfo(argv[0]);