From e36db373ef271a1e4e87c891942b24701941863a Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Wed, 5 Apr 2006 11:50:56 -0500 Subject: [svn-r12202] Purpose: Maintenance Description: Changed to alias string instead of std, i.e. H5std_string instead of H5std, because the old way wasn't working when std didn't exist. Platforms tested: Linux 2.4 (heping) SunOS 5.8 64-bit (sol) HPUX 11.00 (kelgia) - this was the problematic platform but I wasn't able to test before. --- c++/test/dsets.cpp | 19 +++++++++---------- c++/test/h5cpputil.cpp | 5 ++--- c++/test/h5cpputil.h | 4 ++-- c++/test/tattr.cpp | 45 ++++++++++++++++++++++----------------------- c++/test/tfile.cpp | 19 +++++++++---------- c++/test/th5s.cpp | 21 ++++++++++----------- 6 files changed, 54 insertions(+), 59 deletions(-) diff --git a/c++/test/dsets.cpp b/c++/test/dsets.cpp index aaab3e2..3f0dec5 100644 --- a/c++/test/dsets.cpp +++ b/c++/test/dsets.cpp @@ -43,18 +43,17 @@ #ifndef H5_NO_NAMESPACE using namespace H5; - using H5_std::string; #endif #include "h5cpputil.h" // C++ utilility header file -const string FILE1("dataset.h5"); -const string DSET_DEFAULT_NAME("default"); -const string DSET_CHUNKED_NAME("chunked"); -const string DSET_SIMPLE_IO_NAME("simple_io"); -const string DSET_TCONV_NAME ("tconv"); -const string DSET_COMPRESS_NAME("compressed"); -const string DSET_BOGUS_NAME ("bogus"); +const H5std_string FILE1("dataset.h5"); +const H5std_string DSET_DEFAULT_NAME("default"); +const H5std_string DSET_CHUNKED_NAME("chunked"); +const H5std_string DSET_SIMPLE_IO_NAME("simple_io"); +const H5std_string DSET_TCONV_NAME ("tconv"); +const H5std_string DSET_COMPRESS_NAME("compressed"); +const H5std_string DSET_BOGUS_NAME ("bogus"); const int H5Z_FILTER_BOGUS = 305; @@ -1039,7 +1038,7 @@ main(void) } catch (Exception E) { - return(test_report(nerrors, string(" Dataset"))); + return(test_report(nerrors, H5std_string(" Dataset"))); } // Clean up data file @@ -1047,7 +1046,7 @@ main(void) // Print out dsets test results cerr << endl << endl; - return(test_report(nerrors, string(" Dataset"))); + return(test_report(nerrors, H5std_string(" Dataset"))); } // main /*------------------------------------------------------------------------- diff --git a/c++/test/h5cpputil.cpp b/c++/test/h5cpputil.cpp index a711f81..03f0c9f 100644 --- a/c++/test/h5cpputil.cpp +++ b/c++/test/h5cpputil.cpp @@ -39,7 +39,6 @@ #ifndef H5_NO_NAMESPACE using namespace H5; - using H5_std::string; #endif #include "h5cpputil.h" @@ -63,7 +62,7 @@ * *------------------------------------------------------------------------- */ -int test_report( int nerrors, const string& testname ) +int test_report( int nerrors, const H5std_string& testname ) { if (nerrors) { @@ -120,7 +119,7 @@ InvalidActionException::InvalidActionException():Exception(){} // func_name - IN: Name of the function where failure should occur // message - IN: Message //-------------------------------------------------------------------------- -InvalidActionException::InvalidActionException(const string func_name, const string message) : Exception(func_name, message) {} +InvalidActionException::InvalidActionException(const H5std_string func_name, const H5std_string message) : Exception(func_name, message) {} //-------------------------------------------------------------------------- // Function: InvalidActionException destructor diff --git a/c++/test/h5cpputil.h b/c++/test/h5cpputil.h index abd076a..0173d2f 100644 --- a/c++/test/h5cpputil.h +++ b/c++/test/h5cpputil.h @@ -34,7 +34,7 @@ using std::cerr; using std::endl; #endif -int test_report (int, const string&); +int test_report (int, const H5std_string&); void issue_fail_msg(const char* where, int line, const char* file_name, const char* message=""); @@ -70,7 +70,7 @@ template class InvalidActionException : public Exception { public: - InvalidActionException(const string func_name, const string message = DEFAULT_MSG); + InvalidActionException(const H5std_string func_name, const H5std_string message = DEFAULT_MSG); InvalidActionException(); virtual ~InvalidActionException(); }; diff --git a/c++/test/tattr.cpp b/c++/test/tattr.cpp index 73c7390..9051f3f 100644 --- a/c++/test/tattr.cpp +++ b/c++/test/tattr.cpp @@ -38,59 +38,58 @@ #ifndef H5_NO_NAMESPACE using namespace H5; - using H5_std::string; #endif #include "h5cpputil.h" // C++ utilility header file -const string FILENAME("tattr.h5"); +const H5std_string FILENAME("tattr.h5"); const size_t ATTR_MAX_DIMS = 7; -const string ATTR_TMP_NAME("temp_name"); +const H5std_string ATTR_TMP_NAME("temp_name"); /* 3-D dataset with fixed dimensions */ -const string SPACE1_NAME("Space1"); +const H5std_string SPACE1_NAME("Space1"); const int SPACE1_RANK = 3; const int SPACE1_DIM1 = 3; const int SPACE1_DIM2 = 15; const int SPACE1_DIM3 = 13; /* Dataset Information */ -const string DSET1_NAME("Dataset1"); -const string DSET2_NAME("Dataset2"); +const H5std_string DSET1_NAME("Dataset1"); +const H5std_string DSET2_NAME("Dataset2"); /* Group Information */ -const string GROUP1_NAME("/Group1"); +const H5std_string GROUP1_NAME("/Group1"); /* Named Datatype Information */ -const string TYPE1_NAME("/Type"); +const H5std_string TYPE1_NAME("/Type"); /* Attribute Rank & Dimensions */ -const string ATTR1_NAME("Attr1"); +const H5std_string ATTR1_NAME("Attr1"); const int ATTR1_RANK = 1; const int ATTR1_DIM1 = 3; int attr_data1[ATTR1_DIM1]={512,-234,98123}; /* Test data for 1st attribute */ -const string ATTR2_NAME("Attr2"); +const H5std_string ATTR2_NAME("Attr2"); const int ATTR2_RANK = 2; const int ATTR2_DIM1 = 2; const int ATTR2_DIM2 = 2; int attr_data2[ATTR2_DIM1][ATTR2_DIM2]={{7614,-416},{197814,-3}}; /* Test data for 2nd attribute */ -const string ATTR3_NAME("Attr3"); +const H5std_string ATTR3_NAME("Attr3"); const int ATTR3_RANK = 3; const int ATTR3_DIM1 = 2; const int ATTR3_DIM2 = 2; const int ATTR3_DIM3 = 2; double attr_data3[ATTR3_DIM1][ATTR3_DIM2][ATTR3_DIM3]={{{2.3,-26.1},{0.123,-10.0}},{{981724.2,-0.91827},{2.0,23.0}}}; /* Test data for 3rd attribute */ -const string ATTR4_NAME("Attr4"); +const H5std_string ATTR4_NAME("Attr4"); const int ATTR4_RANK = 2; const int ATTR4_DIM1 = 2; const int ATTR4_DIM2 = 2; -const string ATTR4_FIELDNAME1("i"); -const string ATTR4_FIELDNAME2("d"); -const string ATTR4_FIELDNAME3("c"); +const H5std_string ATTR4_FIELDNAME1("i"); +const H5std_string ATTR4_FIELDNAME2("d"); +const H5std_string ATTR4_FIELDNAME3("c"); size_t attr4_field1_off=0; size_t attr4_field2_off=0; size_t attr4_field3_off=0; @@ -101,12 +100,12 @@ struct attr4_struct { } attr_data4[ATTR4_DIM1][ATTR4_DIM2]={{{3,-26.1,'d'},{-100000, 0.123,'3'}}, {{-23,981724.2,'Q'},{0,2.0,'\n'}}}; // Test data for 4th attribute -const string ATTR5_NAME("Attr5"); +const H5std_string ATTR5_NAME("Attr5"); const int ATTR5_RANK = 0; float attr_data5 = (float)-5.123; // Test data for 5th attribute /* Info for another attribute */ -const string ATTR1A_NAME("Attr1_a"); +const H5std_string ATTR1A_NAME("Attr1_a"); int attr_data1a[ATTR1_DIM1]={256,11945,-22107}; /**************************************************************** @@ -257,7 +256,7 @@ test_attr_rename(void) Attribute attr1(dataset.openAttribute(ATTR_TMP_NAME)); // Verify new attribute name - string attr_name = attr1.getName(); + H5std_string attr_name = attr1.getName(); verify_val(attr_name, ATTR_TMP_NAME, "Attribute::getName", __LINE__, __FILE__); // Read attribute information immediately, without closing attribute @@ -275,7 +274,7 @@ test_attr_rename(void) Attribute attr2(dataset.openAttribute(ATTR1A_NAME)); // Verify second attribute name - string attr2_name = attr2.getName(); + H5std_string attr2_name = attr2.getName(); verify_val(attr2_name, ATTR1A_NAME, "Attribute::getName", __LINE__, __FILE__); // Read attribute information immediately, without closing attribute @@ -488,7 +487,7 @@ test_attr_compound_read(void) // was created for(i=0; i