diff options
author | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2017-03-17 16:03:18 (GMT) |
---|---|---|
committer | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2017-03-17 16:03:18 (GMT) |
commit | 50ac3cd6ecc37bb2196bcebe8a202711e315759d (patch) | |
tree | 134ecb2af24498012a72473e1335e77af008d104 /c++/test | |
parent | f7711df680f2ccd07f23223deccb217440ec3788 (diff) | |
download | hdf5-50ac3cd6ecc37bb2196bcebe8a202711e315759d.zip hdf5-50ac3cd6ecc37bb2196bcebe8a202711e315759d.tar.gz hdf5-50ac3cd6ecc37bb2196bcebe8a202711e315759d.tar.bz2 |
Description:
Miscellaneous clean-up: format and comments
Platforms tested:
Linux/64 (jelly)
Darwin (osx1010test)
Diffstat (limited to 'c++/test')
-rw-r--r-- | c++/test/titerate.cpp | 6 | ||||
-rw-r--r-- | c++/test/trefer.cpp | 24 | ||||
-rw-r--r-- | c++/test/tvlstr.cpp | 41 |
3 files changed, 37 insertions, 34 deletions
diff --git a/c++/test/titerate.cpp b/c++/test/titerate.cpp index fce42fa..34e6892 100644 --- a/c++/test/titerate.cpp +++ b/c++/test/titerate.cpp @@ -503,9 +503,9 @@ void test_iterate() FileAccPropList fapl; fapl.setLibverBounds(H5F_LIBVER_LATEST, H5F_LIBVER_LATEST); - test_iter_group(fapl); // Test iterating groups - test_HDFFV_9920(); // Test the fix of HDFFV-9920 - //test_iter_attr(fapl); // Test iterating attributes + test_iter_group(fapl); // Test iterating groups + test_HDFFV_9920(); // Test the fix of HDFFV-9920 + //test_iter_attr(fapl); // Test iterating attributes } // test_iterate diff --git a/c++/test/trefer.cpp b/c++/test/trefer.cpp index d8a0d5f..c232809 100644 --- a/c++/test/trefer.cpp +++ b/c++/test/trefer.cpp @@ -16,7 +16,7 @@ /***************************************************************************** FILE trefer.cpp - HDF5 C++ testing the functionalities associated with the C - Reference interface (H5R) + Reference interface (H5R) ***************************************************************************/ #ifdef OLD_HEADER_FILENAME @@ -93,7 +93,7 @@ test_reference_params(void) file1 = new H5File (FILE1, H5F_ACC_TRUNC); // Create dataspace for datasets - hsize_t dims1[] = {SPACE1_DIM1}; + hsize_t dims1[] = {SPACE1_DIM1}; DataSpace sid1(SPACE1_RANK, dims1); // Create a group @@ -172,7 +172,7 @@ test_reference_params(void) catch (Exception& E) { issue_fail_msg("test_reference_param()",__LINE__,__FILE__, - E.getCFuncName(), E.getCDetailMsg()); + E.getCFuncName(), E.getCDetailMsg()); } if(file1) @@ -209,7 +209,7 @@ static void test_reference_obj(void) file1 = new H5File (FILE1, H5F_ACC_TRUNC); // Create dataspace for datasets - hsize_t dims1[] = {SPACE1_DIM1}; + hsize_t dims1[] = {SPACE1_DIM1}; DataSpace sid1(SPACE1_RANK, dims1); // Create dataset access property list @@ -364,7 +364,7 @@ static void test_reference_obj(void) catch (Exception& E) { issue_fail_msg("test_reference_obj()",__LINE__,__FILE__, - E.getCFuncName(), E.getCDetailMsg()); + E.getCFuncName(), E.getCDetailMsg()); } if(file1) @@ -493,7 +493,7 @@ test_reference_group(void) catch (Exception& E) { issue_fail_msg("test_reference_group()",__LINE__,__FILE__, - E.getCFuncName(), E.getCDetailMsg()); + E.getCFuncName(), E.getCDetailMsg()); } if(file1) @@ -523,10 +523,10 @@ test_reference_region_1D(void) SUBTEST("1-D Dataset Region Reference Functions"); try { - hdset_reg_ref_t *wbuf, // buffer to write to disk + hdset_reg_ref_t *wbuf, // buffer to write to disk *rbuf; // buffer read from disk - uint8_t *dwbuf, // Buffer for writing numeric data to disk - *drbuf; // Buffer for reading numeric data from disk + uint8_t *dwbuf, // Buffer for writing numeric data to disk + *drbuf; // Buffer for reading numeric data from disk // Allocate write & read buffers wbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), (size_t)SPACE1_DIM1); @@ -538,7 +538,7 @@ test_reference_region_1D(void) H5File file1(FILE2, H5F_ACC_TRUNC); // Create dataspace for datasets - hsize_t dims3[] = {SPACE3_DIM1}; + hsize_t dims3[] = {SPACE3_DIM1}; DataSpace sid3(SPACE3_RANK, dims3); // Create dataset access property list @@ -558,7 +558,7 @@ test_reference_region_1D(void) dset3.close(); // Create dataspace for datasets - hsize_t dims1[] = {SPACE1_DIM1}; + hsize_t dims1[] = {SPACE1_DIM1}; DataSpace sid1(SPACE1_RANK, dims1); // Create a dataset @@ -785,7 +785,7 @@ test_reference_region_1D(void) catch (Exception& E) { issue_fail_msg("test_reference_region_1D()",__LINE__,__FILE__, - E.getCFuncName(), E.getCDetailMsg()); + E.getCFuncName(), E.getCDetailMsg()); } } /* test_reference_region_1D() */ diff --git a/c++/test/tvlstr.cpp b/c++/test/tvlstr.cpp index 5dee1a2..859867b 100644 --- a/c++/test/tvlstr.cpp +++ b/c++/test/tvlstr.cpp @@ -57,7 +57,7 @@ static void *test_vlstr_alloc_custom(size_t size, void *info) { void *ret_value=NULL; // Pointer to return size_t *mem_used=(size_t *)info; // Get the pointer to the memory used - size_t extra; // Extra space needed + size_t extra; // Extra space needed /* * This weird contortion is required on the DEC Alpha to keep the @@ -91,7 +91,7 @@ static void test_vlstr_free_custom(void *_mem, void *info) { unsigned char *mem; size_t *mem_used=(size_t *)info; // Get the pointer to the memory used - size_t extra; // Extra space needed + size_t extra; // Extra space needed /* * This weird contortion is required on the DEC Alpha to keep the @@ -257,7 +257,7 @@ static void test_vlstring_array_dataset() for (ii = 0; ii < SPACE1_DIM1; ii++) { if(HDstrcmp(string_ds_check[ii], string_ds_array[ii])!=0) - TestErrPrintf("Line %d: Dataset data different: written=%s,read=%s\n",__LINE__, string_ds_array[ii], string_ds_check[ii]); + TestErrPrintf("Line %d: Dataset data different: written=%s,read=%s\n",__LINE__, string_ds_array[ii], string_ds_check[ii]); HDfree(string_ds_check[ii]); } @@ -351,23 +351,26 @@ static void test_vlstrings_special() hsize_t ii; // counting variable for (ii=0; ii<SPACE1_DIM1; ii++) if(rdata[ii]!=NULL) - TestErrPrintf("VL doesn't match!, rdata[%d]=%p\n",(int)ii,rdata[ii]); + TestErrPrintf("VL doesn't match!, rdata[%d]=%p\n",(int)ii,rdata[ii]); // Write dataset to disk, then read it back. dataset.write(wdata, vlst); dataset.read(rdata, vlst); // Compare data read in. - for (ii = 0; ii < SPACE1_DIM1; ii++) { + for (ii = 0; ii < SPACE1_DIM1; ii++) + { size_t wlen = HDstrlen(wdata[ii]); size_t rlen = HDstrlen(rdata[ii]); - if(wlen != rlen) { - TestErrPrintf("VL data lengths don't match!, strlen(wdata[%d])=%u, strlen(rdata[%d])=%u\n", (int)ii, (unsigned)wlen, (int)ii, (unsigned)rlen); - continue; + if(wlen != rlen) + { + TestErrPrintf("VL data lengths don't match!, strlen(wdata[%d])=%u, strlen(rdata[%d])=%u\n", (int)ii, (unsigned)wlen, (int)ii, (unsigned)rlen); + continue; } // end if - if(HDstrcmp(wdata[ii],rdata[ii]) != 0) { - TestErrPrintf("VL data values don't match!, wdata[%d]=%s, rdata[%d]=%s\n", (int)ii, wdata[ii], (int)ii, rdata[ii]); - continue; + if(HDstrcmp(wdata[ii],rdata[ii]) != 0) + { + TestErrPrintf("VL data values don't match!, wdata[%d]=%s, rdata[%d]=%s\n", (int)ii, wdata[ii], (int)ii, rdata[ii]); + continue; } // end if } // end for @@ -384,7 +387,7 @@ static void test_vlstrings_special() // Create the property list and set the fill value for the second // dataset. DSetCreatPropList dcpl; - char *fill = NULL; // Fill value + char *fill = NULL; // Fill value dcpl.setFillValue(vlst, &fill); dataset = file1.createDataSet("Dataset4", vlst, sid1, dcpl); @@ -566,12 +569,12 @@ static void test_compact_vlstring() hsize_t i; for (i=0; i<SPACE1_DIM1; i++) { if (HDstrlen(wdata[i])!=strlen(rdata[i])) { - TestErrPrintf("VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n",(int)i,(int)strlen(wdata[i]),(int)i,(int)strlen(rdata[i])); - continue; + TestErrPrintf("VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n",(int)i,(int)strlen(wdata[i]),(int)i,(int)strlen(rdata[i])); + continue; } // end if if (HDstrcmp(wdata[i],rdata[i]) != 0) { - TestErrPrintf("VL data values don't match!, wdata[%d]=%s, rdata[%d]=%s\n",(int)i,wdata[i],(int)i,rdata[i]); - continue; + TestErrPrintf("VL data values don't match!, wdata[%d]=%s, rdata[%d]=%s\n",(int)i,wdata[i],(int)i,rdata[i]); + continue; } // end if } // end for @@ -800,7 +803,7 @@ static void test_vlstring_array_attribute() for (ii = 0; ii < SPACE1_DIM1; ii++) { if(HDstrcmp(string_att_check[ii], string_att_array[ii])!=0) - TestErrPrintf("Line %d: Attribute data different: written=%s,read=%s\n",__LINE__, string_att_check[ii], string_att_check[ii]); + TestErrPrintf("Line %d: Attribute data different: written=%s,read=%s\n",__LINE__, string_att_check[ii], string_att_check[ii]); HDfree(string_att_check[ii]); // note: no need for std::string test } @@ -821,7 +824,7 @@ static void test_vlstring_array_attribute() /* Helper routine for test_vl_rewrite() */ static void write_scalar_dset(H5File& file, DataType& type, DataSpace& space, - char *name, char *data) + char *name, char *data) { DataSet dset; try { @@ -839,7 +842,7 @@ static void write_scalar_dset(H5File& file, DataType& type, DataSpace& space, /* Helper routine for test_vl_rewrite() */ static void read_scalar_dset(H5File& file, DataType& type, DataSpace& space, - char *name, char *data) + char *name, char *data) { char *data_read; DataSet dset; |