summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2007-02-03 20:30:44 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2007-02-03 20:30:44 (GMT)
commita7aa86f7d89bbfd31eae159e15860ebbe19e7d03 (patch)
treee726a27a7945696697e4a307cec279335e0c99cc
parentc78a1c555eecc9754224e4b1bb7de4faed66a360 (diff)
downloadhdf5-a7aa86f7d89bbfd31eae159e15860ebbe19e7d03.zip
hdf5-a7aa86f7d89bbfd31eae159e15860ebbe19e7d03.tar.gz
hdf5-a7aa86f7d89bbfd31eae159e15860ebbe19e7d03.tar.bz2
[svn-r13231] Purpose: Clean up C++ tests
Description: Cleaned up comments/unused variables in several test functions. Fixed some mismatched type parameters shown up on Windows. Platforms tested Windows XP AIX 5.1 (copper) Linux 2.6 (kagiso)
-rw-r--r--c++/test/tcompound.cpp2
-rw-r--r--c++/test/tfilter.cpp4
-rw-r--r--c++/test/ttypes.cpp299
-rw-r--r--c++/test/tvlstr.cpp11
4 files changed, 90 insertions, 226 deletions
diff --git a/c++/test/tcompound.cpp b/c++/test/tcompound.cpp
index 27c759b..4789cf7 100644
--- a/c++/test/tcompound.cpp
+++ b/c++/test/tcompound.cpp
@@ -595,7 +595,7 @@ static void test_compound_6(void)
buf = (unsigned char*)malloc(nelmts * MAX(sizeof(src_typ_t), sizeof(dst_typ_t)));
bkg = (unsigned char*)malloc(nelmts * sizeof(dst_typ_t));
orig = (unsigned char*)malloc(nelmts * sizeof(src_typ_t));
- for (int i=0; i<nelmts; i++) {
+ for (i=0; i<nelmts; i++) {
s_ptr = ((src_typ_t*)orig) + i;
s_ptr->b = (i*8+1) & 0x7fff;
s_ptr->d = (i*8+6) & 0x7fff;
diff --git a/c++/test/tfilter.cpp b/c++/test/tfilter.cpp
index 242fb20..aa7861b 100644
--- a/c++/test/tfilter.cpp
+++ b/c++/test/tfilter.cpp
@@ -158,7 +158,7 @@ static void test_null_filter(void)
try
{
- hsize_t null_size; // Size of dataset with null filter
+ //hsize_t null_size; // Size of dataset with null filter
// Prepare dataset create property list
DSetCreatPropList dsplist;
@@ -214,7 +214,7 @@ void test_szip_filter(H5File& file1)
{
#ifdef H5_HAVE_FILTER_SZIP
int points[DSET_DIM1][DSET_DIM2], check[DSET_DIM1][DSET_DIM2];
- hsize_t szip_size; /* Size of dataset with szip filter */
+ //hsize_t szip_size; /* Size of dataset with szip filter */
unsigned szip_options_mask=H5_SZIP_NN_OPTION_MASK;
unsigned szip_pixels_per_block=4;
diff --git a/c++/test/ttypes.cpp b/c++/test/ttypes.cpp
index 906ed23..1bfcab7 100644
--- a/c++/test/ttypes.cpp
+++ b/c++/test/ttypes.cpp
@@ -1,6 +1,6 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Copyright by The HDF Group (THG). *
- * All rights reserved. *
+ * Copyright by The HDF Group (THG). *
+ * All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
@@ -9,7 +9,7 @@
* 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://www.hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
- * access to either file, you may request a copy from help@hdfgroup.org. *
+ * access to either file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*****************************************************************************
@@ -45,16 +45,17 @@ const H5std_string DATAFILE("ttypes.h5");
#define NTESTS 1
-/* Number of elements in each test */
+// Number of elements in each test
#define NTESTELEM 100000
-/* Define if you want to see a count of overflows */
+// Define if you want to see a count of overflows
#undef SHOW_OVERFLOWS
/*
* Offset from alinged memory returned by malloc(). This can be used to test
* that type conversions handle non-aligned buffers correctly.
*/
+
#define ALIGNMENT 1
/*
@@ -62,9 +63,10 @@ const H5std_string DATAFILE("ttypes.h5");
* normally require alignment. When set, all native data types must be aligned
* on a byte boundary equal to the data size.
*/
+
#define TEST_ALIGNMENT
-/* Alignment test stuff */
+// Alignment test stuff
#ifdef TEST_ALIGNMENT
#define H5T_PACKAGE
#include "H5Tpkg.h"
@@ -84,6 +86,7 @@ const char *FILENAME[] = {
* endian. If local variable `endian' is H5T_ORDER_BE then the result will
* be I, otherwise the result will be Z-(I+1).
*/
+
#define ENDIAN(Z,I) (H5T_ORDER_BE==endian?(I):(Z)-((I)+1))
@@ -96,18 +99,18 @@ typedef enum int_t {
INT_LONG, INT_ULONG, INT_LLONG, INT_ULLONG, INT_OTHER
} int_t;
-/* Count the number of overflows */
+// Count the number of overflows
#ifdef SHOW_OVERFLOWS
static int noverflows_g = 0;
#endif
-/* Skip overflow tests if non-zero */
+// Skip overflow tests if non-zero
static int skip_overflow_tests_g = 0;
-/* Don't use hardware conversions if set */
+// Don't use hardware conversions if set
static int without_hardware_g = 0;
-/* Count opaque conversions */
+// Count opaque conversions
static int num_opaque_conversions_g = 0;
/*
@@ -117,11 +120,12 @@ static int num_opaque_conversions_g = 0;
* be allowed to continue (cf. Posix signals) so in order to recover from a
* SIGFPE we run tests that might generate one in a child process.
*/
+
#if defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID)
# define HANDLE_SIGFPE
#endif
-/* Allocates memory aligned on a certain boundary. */
+// Allocates memory aligned on a certain boundary.
#define aligned_malloc(Z) ((void*)((char*)malloc(ALIGNMENT+Z)+ALIGNMENT))
#define aligned_free(M) free((char*)(M)-ALIGNMENT)
@@ -238,10 +242,6 @@ static void test_classes(void)
*/
static void test_copy(void)
{
- hid_t a_copy;
- herr_t status;
-
- //MESSAGE(5, ("DataType::copy() and DataType::operator="));
SUBTEST("DataType::copy() and DataType::operator=");
try {
// Test copying from a predefined datatype using DataType::operator=
@@ -308,17 +308,16 @@ static void test_query(void)
long c;
double d;
} s_type_t;
- char filename[1024];
short enum_val;
// Output message about test being performed
SUBTEST("Query functions of compound and enumeration types");
try
{
- /* Create File */
+ // Create File
H5File file(FILENAME[2], H5F_ACC_TRUNC);
- /* Create a compound datatype */
+ // Create a compound datatype
CompType tid1(sizeof(s_type_t));
tid1.insertMember("a", HOFFSET(s_type_t, a), PredType::NATIVE_INT);
@@ -326,7 +325,7 @@ static void test_query(void)
tid1.insertMember("c", HOFFSET(s_type_t, c), PredType::NATIVE_LONG);
tid1.insertMember("d", HOFFSET(s_type_t, d), PredType::NATIVE_DOUBLE);
- /* Create a enumerate datatype */
+ // Create a enumerate datatype
EnumType tid2(sizeof(short));
tid2.insert("RED", (enum_val=0,&enum_val));
@@ -335,48 +334,48 @@ static void test_query(void)
tid2.insert("ORANGE", (enum_val=3,&enum_val));
tid2.insert("YELLOW", (enum_val=4,&enum_val));
- /* Query member number and member index by name, for compound type */
+ // Query member number and member index by name, for compound type
int nmembs = tid1.getNmembers();
verify_val(nmembs, 4, "CompType::getNmembers()", __LINE__, __FILE__);
int index = tid1.getMemberIndex("c");
verify_val(index, 2, "CompType::getMemberIndex()", __LINE__, __FILE__);
- /* Query member number and member index by name, for enumeration type. */
+ // Query member number and member index by name, for enumeration type.
nmembs = tid2.getNmembers();
verify_val(nmembs, 5, "EnumType::getNmembers()", __LINE__, __FILE__);
index = tid2.getMemberIndex("ORANGE");
verify_val(index, 3, "EnumType::getMemberIndex()", __LINE__, __FILE__);
- /* Commit compound datatype and close it */
+ // Commit compound datatype and close it
tid1.commit(file, CompT_NAME);
tid1.close();
- /* Commit enumeration datatype and close it */
+ // Commit enumeration datatype and close it
tid2.commit(file, EnumT_NAME);
tid2.close();
- /* Open the datatype for query */
+ // Open the datatype for query
tid1 = file.openCompType(CompT_NAME);
tid2 = file.openEnumType(EnumT_NAME);
- /* Query member number and member index by name, for compound type */
+ // Query member number and member index by name, for compound type
nmembs = tid1.getNmembers();
verify_val(nmembs, 4, "CompType::getNmembers()", __LINE__, __FILE__);
index = tid1.getMemberIndex("c");
verify_val(index, 2, "CompType::getMemberIndex()", __LINE__, __FILE__);
- /* Query member number and member index by name, for enumeration type */
+ // Query member number and member index by name, for enumeration type
nmembs = tid2.getNmembers();
verify_val(nmembs, 5, "EnumType::getNmembers()", __LINE__, __FILE__);
index = tid2.getMemberIndex("ORANGE");
verify_val(index, 3, "EnumType::getMemberIndex()", __LINE__, __FILE__);
- /* Close data types and file */
+ // Close data types and file
tid1.close();
tid2.close();
file.close();
@@ -405,38 +404,38 @@ static void test_query(void)
*
*-------------------------------------------------------------------------
*/
-const char* filename1("dtypes1.h5");
+const H5std_string filename1("dtypes1.h5");
static void test_transient ()
{
static hsize_t ds_size[2] = {10, 20};
- //MESSAGE(5, ("transient data types"));
SUBTEST("Transient data types");
try {
H5File file(filename1, H5F_ACC_TRUNC);
DataSpace space(2, ds_size, ds_size);
- /* Predefined types cannot be modified or closed */
-// PredType::NATIVE_INT is a constant and cannot make a call, don't need these tests
+ // Predefined types cannot be modified or closed
+ // PredType::NATIVE_INT is a constant and cannot make a call,
+ // don't need these tests
- /* Copying a predefined type results in a modifiable copy */
+ // Copying a predefined type results in a modifiable copy
IntType type(PredType::NATIVE_INT);
type.setPrecision(256);
- /* It should not be possible to create an attribute for a transient type */
+ // It should not be possible to create an attribute for a transient
+ // type
try {
Attribute attr(type.createAttribute("attr1", PredType::NATIVE_INT, space));
// Should FAIL but didn't, so throw an invalid action exception
throw InvalidActionException("H5Object::createAttribute", "Attempted to commit a predefined datatype.");
} catch (AttributeIException err) {}
- /* Create a dataset from a transient data type */
-// type.close(); - put printf in H5Tclose to make sure it's closed
+ // Create a dataset from a transient data type
type.copy(PredType::NATIVE_INT);
DataSet dset(file.createDataSet("dset1", type, space));
- /* The type returned from a dataset should not be modifiable */
+ // The type returned from a dataset should not be modifiable
IntType itype(dset);
try {
itype.setPrecision(256);
@@ -447,26 +446,26 @@ static void test_transient ()
itype.close();
- /*
- * Get the dataset data type by applying H5Tcopy() to the dataset. The
- * result should be modifiable.
- */
+ //
+ // Get the dataset data type by applying H5Tcopy() to the dataset. The
+ // result should be modifiable.
+ ///
itype.copy(dset);
itype.setPrecision(256);
- /*
- * Close the dataset and reopen it, testing that its type is still
- * read-only. <--- how come modifiable below?
- */
+ //
+ // Close the dataset and reopen it, testing that its type is still
+ // read-only. <--- how come modifiable below?
+ ///
dset.close();
//if (H5Dclose (dset)<0) printf("goto error in C\n");
dset = file.openDataSet("dset1");
//if ((dset=H5Dopen (file, "dset1"))<0) printf("goto error in C\n");
- /*
- * Get the dataset data type by applying H5Tcopy() to the dataset. The
- * result should be modifiable.
- */
+ //
+ // Get the dataset data type by applying H5Tcopy() to the dataset. The
+ // result should be modifiable.
+ ///
itype.copy(dset);
itype.setPrecision(256);
itype.close();
@@ -503,62 +502,35 @@ static void test_transient ()
const H5std_string filename2("dtypes2.h5");
static void test_named ()
{
- herr_t status;
static hsize_t ds_size[2] = {10, 20};
hsize_t i;
unsigned attr_data[10][20];
- char filename[1024];
//MESSAGE(5, ("named data types"));
SUBTEST("Named data types");
try {
-
-// h5_fixname(FILENAME[1], fapl_id, filename, sizeof filename);
+ // Create the file
H5File file(filename2, H5F_ACC_TRUNC);
+ // Create simple dataspace
DataSpace space(2, ds_size, ds_size);
- /* Predefined types cannot be committed */
+ // Predefined types cannot be committed
try {
-PredType nativeint(PredType::NATIVE_INT);
-nativeint.commit(file, "test_named_1 (should not exist)");
- //PredType::NATIVE_INT.commit(file, "test_named_1 (should not exist)");
+ PredType nativeint(PredType::NATIVE_INT);
+ nativeint.commit(file, "test_named_1 (should not exist)");
+
// Should FAIL but didn't, so throw an invalid action exception
throw InvalidActionException("PredType::commit", "Attempted to commit a predefined datatype.");
} catch (DataTypeIException err) {}
-/*
- H5E_BEGIN_TRY {
- status = H5Tcommit (file, "test_named_1 (should not exist)",
- H5T_NATIVE_INT);
- } H5E_END_TRY;
- if (status>=0) {
- H5_FAILED();
- puts (" Predefined types should not be committable!");
- printf("goto error in C\n");
- }
-*/
-
- /* Copy a predefined data type and commit the copy */
+ // Copy a predefined data type and commit the copy
IntType itype(PredType::NATIVE_INT);
- //if ((type = H5Tcopy (H5T_NATIVE_INT))<0) printf("goto error in C\n");
-
itype.commit(file, "native-int");
- //if (H5Tcommit (file, "native-int", type)<0) printf("goto error in C\n");0,
-
- if (itype.committed() <= 0)
+ if (itype.committed() <= (bool)0)
cerr << "IntType::committed() returned false" << endl;
-
-/*
- if ((status=H5Tcommitted (type))<0) printf("goto error in C\n");
- if (0==status) {
- H5_FAILED();
- puts (" H5Tcommitted() returned false!");
- printf("goto error in C\n");
- }
-*/
- /* We should not be able to modify a type after it has been committed. */
+ // We should not be able to modify a type after it has been committed.
try {
itype.setPrecision(256);
@@ -566,17 +538,7 @@ nativeint.commit(file, "test_named_1 (should not exist)");
throw InvalidActionException("IntType::setPrecision", "Attempted to modify a committed datatype.");
} catch (DataTypeIException err) {}
-/*
- H5E_BEGIN_TRY {
- status = H5Tset_precision (type, 256);
- } H5E_END_TRY;
- if (status>=0) {
- H5_FAILED();
- puts (" Committed type is not constant!");
- printf("goto error in C\n");
- }
-*/
- /* We should not be able to re-commit a committed type */
+ // We should not be able to re-commit a committed type
try {
itype.commit(file, "test_named_2 (should not exist)");
@@ -584,131 +546,67 @@ nativeint.commit(file, "test_named_1 (should not exist)");
throw InvalidActionException("IntType::commit", "Attempted to re-commit a committed data type.");
} catch (DataTypeIException err) {}
-/*
- H5E_BEGIN_TRY {
- status = H5Tcommit(file, "test_named_2 (should not exist)", type);
- } H5E_END_TRY;
- if (status>=0) {
- H5_FAILED();
- puts (" Committed types should not be recommitted!");
- printf("goto error in C\n");
- }
-*/
-
- /* It should be possible to define an attribute for the named type */
+ // It should be possible to define an attribute for the named type
Attribute attr1 = itype.createAttribute("attr1", PredType::NATIVE_UCHAR, space);
- //if ((attr1=H5Acreate (type, "attr1", H5T_NATIVE_UCHAR, space,
-// H5P_DEFAULT))<0) printf("goto error in C\n");
-
- for (i=0; i<ds_size[0]*ds_size[1]; i++) attr_data[0][i] = (int)i;/*tricky*/
+ for (i=0; i<ds_size[0]*ds_size[1]; i++)
+ attr_data[0][i] = (int)i; //tricky
attr1.write(PredType::NATIVE_UINT, attr_data);
attr1.close();
- //if (H5Awrite(attr1, H5T_NATIVE_UINT, attr_data)<0) printf("goto error in C\n");
- //if (H5Aclose (attr1)<0) printf("goto error in C\n");
- /*
- * Copying a committed type should result in a transient type which is
- * not locked.
- */
+ // Copying a committed type should result in a transient type which
+ // is not locked.
IntType trans_type;
trans_type.copy(itype);
bool iscommitted = trans_type.committed();
- verify_val(iscommitted, 0, "DataType::committed() - Copying a named type should result in a transient type!", __LINE__, __FILE__);
-/*
- if ((t2 = H5Tcopy (type))<0) printf("goto error in C\n");
- if ((status=H5Tcommitted (t2))<0) printf("goto error in C\n");
- if (status) {
- H5_FAILED();
- puts (" Copying a named type should result in a transient type!");
- printf("goto error in C\n");
- }
-*/
+ verify_val(iscommitted, (bool)0, "DataType::committed() - Copying a named type should result in a transient type!", __LINE__, __FILE__);
+
trans_type.setPrecision(256);
trans_type.close();
- //if (H5Tset_precision (t2, 256)<0) printf("goto error in C\n");
- //if (H5Tclose (t2)<0) printf("goto error in C\n");
-
- /*
- * Close the committed type and reopen it. It should return a named type.
- */
-/* This had something to do with the way IntType was returned and assigned
-and caused itype.committed not working correctly. So, use another_type for
-now.
+
+ // Close the committed type and reopen it. It should return a
+ // named type.
+
+ /* This had something to do with the way IntType was returned and
+ assigned and caused itype.committed not working correctly. So,
+ use another_type for now. Need to address it later - BMR 01/2007
itype = file.openIntType("native-int");
iscommitted = itype.committed();
-*/
+ */
IntType another_type = file.openIntType("native-int");
iscommitted = another_type.committed();
if (!iscommitted)
throw InvalidActionException("IntType::committed()", "Opened named types should be named types!");
-/*
- if (H5Tclose (type)<0) printf("goto error in C\n");
- if ((type=H5Topen (file, "native-int"))<0) printf("goto error in C\n");
- if ((status=H5Tcommitted (type))<0) printf("goto error in C\n");
- if (!status) {
- H5_FAILED();
- puts (" Opened named types should be named types!");
- printf("goto error in C\n");
- }
- */
- /* Create a dataset that uses the named type */
+ // Create a dataset that uses the named type
DataSet dset = file.createDataSet("dset1", itype, space);
- //if ((dset = H5Dcreate (file, "dset1", type, space, H5P_DEFAULT))<0)
- /* Get the dataset's data type and make sure it's a named type */
+ // Get the dataset's data type and make sure it's a named type
DataType *ds_type = new DataType(dset.getDataType());
iscommitted = ds_type->committed();
if (!iscommitted)
throw InvalidActionException("IntType::committed()", "1 Dataset type should be named type!");
-/*
- if ((t2 = H5Dget_type (dset))<0) printf("goto error in C\n");
- if ((status=H5Tcommitted (t2))<0) printf("goto error in C\n");
- if (!status) {
- H5_FAILED();
- puts (" Dataset type should be a named type!");
- printf("goto error in C\n");
- }
-*/
-
- /* Close the dataset, then close its type, then reopen the dataset */
+ // Close the dataset, then close its type, then reopen the dataset
dset.close();
ds_type->close();
- //if (H5Dclose (dset)<0) printf("goto error in C\n");
- //if (H5Tclose (t2)<0) printf("goto error in C\n");
dset = file.openDataSet("dset1");
- //if ((dset = H5Dopen (file, "dset1"))<0) printf("goto error in C\n");
- /* Get the dataset's type and make sure it's named */
- /* Get the dataset's data type and make sure it's a named type */
+ // Get the dataset's data type and make sure it's a named type
ds_type = new DataType(dset.getDataType());
iscommitted = ds_type->committed();
if (!iscommitted)
throw InvalidActionException("IntType::committed()", "Dataset type should be named type!");
-/*
- if ((t2 = H5Dget_type (dset))<0) printf("goto error in C\n");
- if ((status=H5Tcommitted (t2))<0) printf("goto error in C\n");
- if (!status) {
- H5_FAILED();
- puts (" Dataset type should be a named type!");
- printf("goto error in C\n");
- }
-*/
- /*
- * Close the dataset and create another with the type returned from the
- * first dataset.
- */
+ // Close the dataset and create another with the type returned
+ // from the first dataset.
dset.close();
- //if (H5Dclose (dset)<0) printf("goto error in C\n");
dset = file.createDataSet("dset2", *ds_type, space);
- //if ((dset=H5Dcreate (file, "dset2", t2, space, H5P_DEFAULT))<0)
- /* Reopen the second dataset and make sure the type is shared */
+ // Close then reopen the second dataset and make sure the type is
+ // shared
ds_type->close();
dset.close();
dset = file.openDataSet("dset2");
@@ -717,52 +615,23 @@ now.
if (!iscommitted)
throw InvalidActionException("IntType::committed()", "Dataset type should be named type!");
-/*
- if (H5Tclose (t2)<0) printf("goto error in C\n");
- if (H5Dclose (dset)<0) printf("goto error in C\n");
- if ((dset = H5Dopen (file, "dset2"))<0) printf("goto error in C\n");
- if ((t2 = H5Dget_type (dset))<0) printf("goto error in C\n");
- if ((status=H5Tcommitted (t2))<0) printf("goto error in C\n");
- if (!status) {
- H5_FAILED();
- puts (" Dataset type should be a named type!");
- printf("goto error in C\n");
- }
-*/
ds_type->close();
- //if (H5Tclose (t2)<0) printf("goto error in C\n");
- /*
- * Get the dataset data type by applying H5Tcopy() to the dataset. The
- * result should be modifiable.
- */
- //DataType copied_type = dset.copyType();
+ // Get the dataset data type by way of copying via the dataset. The
+ // result should be modifiable.
IntType copied_type;
copied_type.copy(dset);
- //if ((t2=H5Tcopy (dset))<0) printf("goto error in C\n");
-
-// find another function that can be in DataType
- copied_type.setPrecision(256);
-// if (H5Tset_precision (t2, 256)<0) printf("goto error in C\n");
- //copied_type.close();
+ copied_type.setPrecision(256); // modifiable
copied_type.close();
- //if (H5Tclose (t2)<0) printf("goto error in C\n");
- /* Clean up */
+ // Close all objects and file.
dset.close();
itype.close();
space.close();
file.close();
-/*
- if (H5Dclose (dset)<0) printf("goto error in C\n");
- if (H5Tclose (type)<0) printf("goto error in C\n");
- if (H5Sclose (space)<0) printf("goto error in C\n");
- if (H5Fclose (file)<0) printf("goto error in C\n");
-*/
PASSED();
} // end of try block
catch (Exception E) {
-cerr << "all the way here?" << endl;
issue_fail_msg(E.getCFuncName(), __LINE__, __FILE__, E.getCDetailMsg());
}
} // test_named
diff --git a/c++/test/tvlstr.cpp b/c++/test/tvlstr.cpp
index 145c4c8..a719221 100644
--- a/c++/test/tvlstr.cpp
+++ b/c++/test/tvlstr.cpp
@@ -194,7 +194,7 @@ test_vlstrings_basic(void)
str_used+=HDstrlen(wdata[i])+1;
// Compare against the strings actually written.
- verify_val(vlsize,(hsize_t)str_used,"DataSet::getVlenBufSize", __LINE__, __FILE__);
+ verify_val((int)vlsize,str_used,"DataSet::getVlenBufSize", __LINE__, __FILE__);
// Read dataset from disk.
char *rdata[SPACE1_DIM1]; // Information read in
@@ -354,10 +354,6 @@ test_vlstrings_special(void)
****************************************************************/
static void test_vlstring_type(void)
{
- H5T_cset_t cset;
- H5T_str_t pad;
- herr_t ret;
-
// Output message about test being performed.
MESSAGE(5, ("Testing VL String type\n"));
@@ -371,7 +367,7 @@ static void test_vlstring_type(void)
// Change padding and verify it.
vlstr_type.setStrpad(H5T_STR_NULLPAD);
- pad = vlstr_type.getStrpad();
+ H5T_str_t pad = vlstr_type.getStrpad();
verify_val(pad, H5T_STR_NULLPAD, "StrType::getStrpad", __LINE__, __FILE__);
// Convert to variable-length string.
@@ -381,7 +377,7 @@ static void test_vlstring_type(void)
H5T_class_t type_class = vlstr_type.getClass();
verify_val(type_class, H5T_STRING, "DataType::getClass", __LINE__, __FILE__);
bool is_variable_str = vlstr_type.isVariableStr();
- verify_val(is_variable_str, TRUE, "DataType::isVariableStr", __LINE__, __FILE__);
+ verify_val(is_variable_str, true, "DataType::isVariableStr", __LINE__, __FILE__);
// Check default character set and padding.
H5T_cset_t cset = vlstr_type.getCset();
@@ -597,7 +593,6 @@ test_write_vl_string_attribute(void)
****************************************************************/
static void test_read_vl_string_attribute(void)
{
- herr_t ret;
char *string_att_check;
try {