diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2020-09-30 14:27:10 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2020-09-30 14:27:10 (GMT) |
commit | b2d661b508a7fc7a2592c13bc6bdc175551f075d (patch) | |
tree | 13baeb0d83a7c2a4c6299993c182b1227c2f6114 /test/tgenprop.c | |
parent | 29ab58b58dce556639ea3154e262895773a8a8df (diff) | |
download | hdf5-b2d661b508a7fc7a2592c13bc6bdc175551f075d.zip hdf5-b2d661b508a7fc7a2592c13bc6bdc175551f075d.tar.gz hdf5-b2d661b508a7fc7a2592c13bc6bdc175551f075d.tar.bz2 |
Clang-format of source files
Diffstat (limited to 'test/tgenprop.c')
-rw-r--r-- | test/tgenprop.c | 783 |
1 files changed, 403 insertions, 380 deletions
diff --git a/test/tgenprop.c b/test/tgenprop.c index 7ca7dca..910153c 100644 --- a/test/tgenprop.c +++ b/test/tgenprop.c @@ -12,65 +12,64 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*********************************************************** -* -* Test program: tgenprop -* -* Test the Generic Property functionality -* -*************************************************************/ + * + * Test program: tgenprop + * + * Test the Generic Property functionality + * + *************************************************************/ -#define H5P_FRIEND /*suppress error about including H5Ppkg */ +#define H5P_FRIEND /*suppress error about including H5Ppkg */ /* Define this macro to indicate that the testing APIs should be available */ #define H5P_TESTING #include "testhdf5.h" -#include "H5Dprivate.h" /* For Dataset creation property list names */ -#include "H5Ppkg.h" /* Generic Properties */ +#include "H5Dprivate.h" /* For Dataset creation property list names */ +#include "H5Ppkg.h" /* Generic Properties */ -#define FILENAME "tgenprop.h5" +#define FILENAME "tgenprop.h5" /* Property definitions */ -#define CLASS1_NAME "Class 1" -#define CLASS1_PATH "root/Class 1" +#define CLASS1_NAME "Class 1" +#define CLASS1_PATH "root/Class 1" -#define CLASS2_NAME "Class 2" -#define CLASS2_PATH "root/Class 1/Class 2" +#define CLASS2_NAME "Class 2" +#define CLASS2_PATH "root/Class 1/Class 2" /* Property definitions */ -#define PROP1_NAME "Property 1" -int prop1_def=10; /* Property 1 default value */ +#define PROP1_NAME "Property 1" +int prop1_def = 10; /* Property 1 default value */ #define PROP1_SIZE sizeof(prop1_def) #define PROP1_DEF_VALUE (&prop1_def) -#define PROP2_NAME "Property 2" -float prop2_def=3.14F; /* Property 2 default value */ +#define PROP2_NAME "Property 2" +float prop2_def = 3.14F; /* Property 2 default value */ #define PROP2_SIZE sizeof(prop2_def) #define PROP2_DEF_VALUE (&prop2_def) -#define PROP3_NAME "Property 3" -char prop3_def[10]="Ten chars"; /* Property 3 default value */ +#define PROP3_NAME "Property 3" +char prop3_def[10] = "Ten chars"; /* Property 3 default value */ #define PROP3_SIZE sizeof(prop3_def) #define PROP3_DEF_VALUE (&prop3_def) -#define PROP4_NAME "Property 4" -double prop4_def=1.41F; /* Property 4 default value */ +#define PROP4_NAME "Property 4" +double prop4_def = 1.41F; /* Property 4 default value */ #define PROP4_SIZE sizeof(prop4_def) #define PROP4_DEF_VALUE (&prop4_def) /* Structs used during iteration */ typedef struct iter_data_t { - int iter_count; - char **names; + int iter_count; + char **names; } iter_data_t; typedef struct count_data_t { - int count; - hid_t id; + int count; + hid_t id; } count_data_t; - /**************************************************************** ** ** test_genprop_basic_class(): Test basic generic property list code. @@ -80,24 +79,24 @@ typedef struct count_data_t { static void test_genprop_basic_class(void) { - hid_t cid1; /* Generic Property class ID */ - hid_t cid2; /* Generic Property class ID */ - hid_t cid3; /* Generic Property class ID */ - char *name; /* Name of class */ - herr_t ret; /* Generic return value */ + hid_t cid1; /* Generic Property class ID */ + hid_t cid2; /* Generic Property class ID */ + hid_t cid3; /* Generic Property class ID */ + char * name; /* Name of class */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Generic Property List Class Creation Functionality\n")); /* Create a new generic class, derived from the root of the class hierarchy */ - cid1 = H5Pcreate_class(H5P_ROOT,CLASS1_NAME, NULL, NULL, NULL, NULL, NULL, NULL); + cid1 = H5Pcreate_class(H5P_ROOT, CLASS1_NAME, NULL, NULL, NULL, NULL, NULL, NULL); CHECK_I(cid1, "H5Pcreate_class"); /* Check class name */ name = H5Pget_class_name(cid1); CHECK_PTR(name, "H5Pget_class_name"); - if(HDstrcmp(name,CLASS1_NAME)!=0) - TestErrPrintf("Class names don't match!, name=%s, CLASS1_NAME=%s\n",name,CLASS1_NAME); + if (HDstrcmp(name, CLASS1_NAME) != 0) + TestErrPrintf("Class names don't match!, name=%s, CLASS1_NAME=%s\n", name, CLASS1_NAME); H5free_memory(name); /* Check class parent */ @@ -105,11 +104,11 @@ test_genprop_basic_class(void) CHECK_I(cid2, "H5Pget_class_parent"); /* Verify class parent correct */ - ret = H5Pequal(cid2,H5P_ROOT); + ret = H5Pequal(cid2, H5P_ROOT); VERIFY(ret, 1, "H5Pequal"); /* Make certain false postives aren't being returned */ - ret = H5Pequal(cid2,H5P_FILE_CREATE); + ret = H5Pequal(cid2, H5P_FILE_CREATE); VERIFY(ret, 0, "H5Pequal"); /* Close parent class */ @@ -121,14 +120,14 @@ test_genprop_basic_class(void) CHECK_I(ret, "H5Pclose_class"); /* Create another new generic class, derived from file creation class */ - cid1 = H5Pcreate_class(H5P_FILE_CREATE,CLASS2_NAME, NULL, NULL, NULL, NULL, NULL, NULL); + cid1 = H5Pcreate_class(H5P_FILE_CREATE, CLASS2_NAME, NULL, NULL, NULL, NULL, NULL, NULL); CHECK_I(cid1, "H5Pcreate_class"); /* Check class name */ name = H5Pget_class_name(cid1); CHECK_PTR(name, "H5Pget_class_name"); - if(HDstrcmp(name,CLASS2_NAME)!=0) - TestErrPrintf("Class names don't match!, name=%s, CLASS2_NAME=%s\n",name,CLASS2_NAME); + if (HDstrcmp(name, CLASS2_NAME) != 0) + TestErrPrintf("Class names don't match!, name=%s, CLASS2_NAME=%s\n", name, CLASS2_NAME); H5free_memory(name); /* Check class parent */ @@ -136,7 +135,7 @@ test_genprop_basic_class(void) CHECK_I(cid2, "H5Pget_class_parent"); /* Verify class parent correct */ - ret = H5Pequal(cid2,H5P_FILE_CREATE); + ret = H5Pequal(cid2, H5P_FILE_CREATE); VERIFY(ret, 1, "H5Pequal"); /* Check class parent's parent */ @@ -144,7 +143,7 @@ test_genprop_basic_class(void) CHECK_I(cid3, "H5Pget_class_parent"); /* Verify class parent's parent correct */ - ret = H5Pequal(cid3,H5P_GROUP_CREATE); + ret = H5Pequal(cid3, H5P_GROUP_CREATE); VERIFY(ret, 1, "H5Pequal"); /* Close parent class's parent */ @@ -169,10 +168,10 @@ test_genprop_basic_class(void) static void test_genprop_basic_class_prop(void) { - hid_t cid1; /* Generic Property class ID */ - size_t size; /* Size of property */ - size_t nprops; /* Number of properties in class */ - herr_t ret; /* Generic return value */ + hid_t cid1; /* Generic Property class ID */ + size_t size; /* Size of property */ + size_t nprops; /* Number of properties in class */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Generic Property List Class Properties Functionality\n")); @@ -191,11 +190,13 @@ test_genprop_basic_class_prop(void) VERIFY(ret, 0, "H5Pexist"); /* Insert first property into class (with no callbacks) */ - ret = H5Pregister2(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + ret = + H5Pregister2(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); CHECK_I(ret, "H5Pregister2"); /* Try to insert the first property again (should fail) */ - ret = H5Pregister2(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + ret = + H5Pregister2(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); VERIFY(ret, FAIL, "H5Pregister2"); /* Check the existance of the first property */ @@ -213,11 +214,13 @@ test_genprop_basic_class_prop(void) VERIFY(nprops, 1, "H5Pget_nprops"); /* Insert second property into class (with no callbacks) */ - ret = H5Pregister2(cid1, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + ret = + H5Pregister2(cid1, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); CHECK_I(ret, "H5Pregister2"); /* Try to insert the second property again (should fail) */ - ret = H5Pregister2(cid1, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + ret = + H5Pregister2(cid1, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); VERIFY(ret, FAIL, "H5Pregister2"); /* Check the existance of the second property */ @@ -235,7 +238,8 @@ test_genprop_basic_class_prop(void) VERIFY(nprops, 2, "H5Pget_nprops"); /* Insert third property into class (with no callbacks) */ - ret = H5Pregister2(cid1, PROP3_NAME, PROP3_SIZE, PROP3_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + ret = + H5Pregister2(cid1, PROP3_NAME, PROP3_SIZE, PROP3_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); CHECK_I(ret, "H5Pregister2"); /* Check the existance of the third property */ @@ -294,12 +298,11 @@ test_genprop_basic_class_prop(void) ** ****************************************************************/ static int -test_genprop_iter1(hid_t H5_ATTR_UNUSED id, const char *name, - void *iter_data) +test_genprop_iter1(hid_t H5_ATTR_UNUSED id, const char *name, void *iter_data) { iter_data_t *idata = (iter_data_t *)iter_data; - return HDstrcmp(name,idata->names[idata->iter_count++]); + return HDstrcmp(name, idata->names[idata->iter_count++]); } /**************************************************************** @@ -311,19 +314,16 @@ test_genprop_iter1(hid_t H5_ATTR_UNUSED id, const char *name, static void test_genprop_class_iter(void) { - hid_t cid1; /* Generic Property class ID */ - size_t nprops; /* Number of properties in class */ - int idx; /* Index to start iteration at */ - struct { /* Struct for iterations */ - int iter_count; + hid_t cid1; /* Generic Property class ID */ + size_t nprops; /* Number of properties in class */ + int idx; /* Index to start iteration at */ + struct { /* Struct for iterations */ + int iter_count; const char **names; } iter_struct; - const char *pnames[4]={ /* Names of properties for iterator */ - PROP1_NAME, - PROP2_NAME, - PROP3_NAME, - PROP4_NAME}; - herr_t ret; /* Generic return value */ + const char *pnames[4] = {/* Names of properties for iterator */ + PROP1_NAME, PROP2_NAME, PROP3_NAME, PROP4_NAME}; + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Generic Property List Class Property Iteration Functionality\n")); @@ -333,35 +333,39 @@ test_genprop_class_iter(void) CHECK_I(cid1, "H5Pcreate_class"); /* Insert first property into class (with no callbacks) */ - ret = H5Pregister2(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + ret = + H5Pregister2(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); CHECK_I(ret, "H5Pregister2"); /* Insert second property into class (with no callbacks) */ - ret = H5Pregister2(cid1, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + ret = + H5Pregister2(cid1, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); CHECK_I(ret, "H5Pregister2"); /* Insert third property into class (with no callbacks) */ - ret = H5Pregister2(cid1, PROP3_NAME, PROP3_SIZE, PROP3_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + ret = + H5Pregister2(cid1, PROP3_NAME, PROP3_SIZE, PROP3_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); CHECK_I(ret, "H5Pregister2"); /* Insert third property into class (with no callbacks) */ - ret = H5Pregister2(cid1, PROP4_NAME, PROP4_SIZE, PROP4_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + ret = + H5Pregister2(cid1, PROP4_NAME, PROP4_SIZE, PROP4_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); CHECK_I(ret, "H5Pregister2"); /* Check the number of properties in class */ - ret = H5Pget_nprops(cid1,&nprops); + ret = H5Pget_nprops(cid1, &nprops); CHECK_I(ret, "H5Pget_nprops"); VERIFY(nprops, 4, "H5Pget_nprops"); /* Iterate over all properties in class */ - iter_struct.iter_count=0; - iter_struct.names=pnames; - ret = H5Piterate(cid1,NULL,test_genprop_iter1,&iter_struct); + iter_struct.iter_count = 0; + iter_struct.names = pnames; + ret = H5Piterate(cid1, NULL, test_genprop_iter1, &iter_struct); VERIFY(ret, 0, "H5Piterate"); /* Iterate over last three properties in class */ - idx=iter_struct.iter_count=1; - ret = H5Piterate(cid1,&idx,test_genprop_iter1,&iter_struct); + idx = iter_struct.iter_count = 1; + ret = H5Piterate(cid1, &idx, test_genprop_iter1, &iter_struct); VERIFY(ret, 0, "H5Piterate"); VERIFY(idx, (int)nprops, "H5Piterate"); @@ -417,49 +421,54 @@ test_genprop_cls_cls_cb1(hid_t list_id, void *create_data) static void test_genprop_class_callback(void) { - hid_t cid1; /* Generic Property class ID */ - hid_t cid2; /* Generic Property class ID */ - hid_t lid1; /* Generic Property list ID */ - hid_t lid2; /* Generic Property list ID */ - hid_t lid3; /* Generic Property list ID */ - size_t nprops; /* Number of properties in class */ - struct { /* Struct for callbacks */ - int count; + hid_t cid1; /* Generic Property class ID */ + hid_t cid2; /* Generic Property class ID */ + hid_t lid1; /* Generic Property list ID */ + hid_t lid2; /* Generic Property list ID */ + hid_t lid3; /* Generic Property list ID */ + size_t nprops; /* Number of properties in class */ + struct { /* Struct for callbacks */ + int count; hid_t id; } crt_cb_struct, cpy_cb_struct, cls_cb_struct; - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Generic Property List Class Callback Functionality\n")); /* Create a new generic class, derived from the root of the class hierarchy */ - cid1 = H5Pcreate_class(H5P_ROOT, CLASS1_NAME, test_genprop_cls_crt_cb1, &crt_cb_struct, test_genprop_cls_cpy_cb1, &cpy_cb_struct, test_genprop_cls_cls_cb1, &cls_cb_struct); + cid1 = + H5Pcreate_class(H5P_ROOT, CLASS1_NAME, test_genprop_cls_crt_cb1, &crt_cb_struct, + test_genprop_cls_cpy_cb1, &cpy_cb_struct, test_genprop_cls_cls_cb1, &cls_cb_struct); CHECK_I(cid1, "H5Pcreate_class"); /* Insert first property into class (with no callbacks) */ - ret = H5Pregister2(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + ret = + H5Pregister2(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); CHECK_I(ret, "H5Pregister2"); /* Insert second property into class (with no callbacks) */ - ret = H5Pregister2(cid1, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + ret = + H5Pregister2(cid1, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); CHECK_I(ret, "H5Pregister2"); /* Insert third property into class (with no callbacks) */ - ret = H5Pregister2(cid1, PROP3_NAME, PROP3_SIZE, PROP3_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + ret = + H5Pregister2(cid1, PROP3_NAME, PROP3_SIZE, PROP3_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); CHECK_I(ret, "H5Pregister2"); /* Check the number of properties in class */ - ret = H5Pget_nprops(cid1,&nprops); + ret = H5Pget_nprops(cid1, &nprops); CHECK_I(ret, "H5Pget_nprops"); VERIFY(nprops, 3, "H5Pget_nprops"); /* Initialize class callback structs */ - crt_cb_struct.count=0; - crt_cb_struct.id=(-1); - cpy_cb_struct.count=0; - cpy_cb_struct.id=(-1); - cls_cb_struct.count=0; - cls_cb_struct.id=(-1); + crt_cb_struct.count = 0; + crt_cb_struct.id = (-1); + cpy_cb_struct.count = 0; + cpy_cb_struct.id = (-1); + cls_cb_struct.count = 0; + cls_cb_struct.id = (-1); /* Create a property list from the class */ lid1 = H5Pcreate(cid1); @@ -470,7 +479,7 @@ test_genprop_class_callback(void) VERIFY(crt_cb_struct.id, lid1, "H5Pcreate"); /* Check the number of properties in list */ - ret = H5Pget_nprops(lid1,&nprops); + ret = H5Pget_nprops(lid1, &nprops); CHECK_I(ret, "H5Pget_nprops"); VERIFY(nprops, 3, "H5Pget_nprops"); @@ -483,7 +492,7 @@ test_genprop_class_callback(void) VERIFY(crt_cb_struct.id, lid2, "H5Pcreate"); /* Check the number of properties in list */ - ret = H5Pget_nprops(lid2,&nprops); + ret = H5Pget_nprops(lid2, &nprops); CHECK_I(ret, "H5Pget_nprops"); VERIFY(nprops, 3, "H5Pget_nprops"); @@ -525,11 +534,14 @@ test_genprop_class_callback(void) VERIFY(cls_cb_struct.id, lid3, "H5Pclose"); /* Create another new generic class, derived from first class */ - cid2 = H5Pcreate_class(cid1, CLASS2_NAME, test_genprop_cls_crt_cb1, &crt_cb_struct, test_genprop_cls_cpy_cb1, &cpy_cb_struct, test_genprop_cls_cls_cb1, &cls_cb_struct); + cid2 = + H5Pcreate_class(cid1, CLASS2_NAME, test_genprop_cls_crt_cb1, &crt_cb_struct, test_genprop_cls_cpy_cb1, + &cpy_cb_struct, test_genprop_cls_cls_cb1, &cls_cb_struct); CHECK_I(cid2, "H5Pcreate_class"); /* Insert fourth property into class (with no callbacks) */ - ret = H5Pregister2(cid2, PROP4_NAME, PROP4_SIZE, PROP4_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + ret = + H5Pregister2(cid2, PROP4_NAME, PROP4_SIZE, PROP4_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); CHECK_I(ret, "H5Pregister2"); /* Check the number of properties in class */ @@ -596,34 +608,36 @@ test_genprop_class_callback(void) static void test_genprop_basic_list(void) { - hid_t cid1; /* Generic Property class ID */ - hid_t cid2; /* Generic Property class ID */ - hid_t lid1; /* Generic Property list ID */ - size_t nprops; /* Number of properties */ - size_t size; /* Size of property */ - int prop1_value; /* Value for property #1 */ - float prop2_value; /* Value for property #2 */ - herr_t ret; /* Generic return value */ + hid_t cid1; /* Generic Property class ID */ + hid_t cid2; /* Generic Property class ID */ + hid_t lid1; /* Generic Property list ID */ + size_t nprops; /* Number of properties */ + size_t size; /* Size of property */ + int prop1_value; /* Value for property #1 */ + float prop2_value; /* Value for property #2 */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Generic Property List Creation Functionality\n")); /* Create a new generic class, derived from the root of the class hierarchy */ - cid1 = H5Pcreate_class(H5P_ROOT,CLASS1_NAME, NULL, NULL, NULL, NULL, NULL, NULL); + cid1 = H5Pcreate_class(H5P_ROOT, CLASS1_NAME, NULL, NULL, NULL, NULL, NULL, NULL); CHECK_I(cid1, "H5Pcreate_class"); /* Add several properties (w/default values) */ /* Insert first property into class (with no callbacks) */ - ret = H5Pregister2(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + ret = + H5Pregister2(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); CHECK_I(ret, "H5Pregister2"); /* Insert second property into class (with no callbacks) */ - ret = H5Pregister2(cid1, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + ret = + H5Pregister2(cid1, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); CHECK_I(ret, "H5Pregister2"); /* Check the number of properties in class */ - ret = H5Pget_nprops(cid1,&nprops); + ret = H5Pget_nprops(cid1, &nprops); CHECK_I(ret, "H5Pget_nprops"); VERIFY(nprops, 2, "H5Pget_nprops"); @@ -636,15 +650,15 @@ test_genprop_basic_list(void) CHECK_I(cid2, "H5Pget_class"); /* Check that the list's class is correct */ - ret = H5Pequal(cid1,cid2); + ret = H5Pequal(cid1, cid2); VERIFY(ret, 1, "H5Pequal"); /* Check correct "is a" class/list relationship */ - ret = H5Pisa_class(lid1,cid1); + ret = H5Pisa_class(lid1, cid1); VERIFY(ret, 1, "H5Pisa_class"); /* Check "is a" class/list relationship another way */ - ret = H5Pisa_class(lid1,cid2); + ret = H5Pisa_class(lid1, cid2); VERIFY(ret, 1, "H5Pisa_class"); /* Close class */ @@ -652,7 +666,7 @@ test_genprop_basic_list(void) CHECK_I(ret, "H5Pclose_class"); /* Check the number of properties in list */ - ret = H5Pget_nprops(lid1,&nprops); + ret = H5Pget_nprops(lid1, &nprops); CHECK_I(ret, "H5Pget_nprops"); VERIFY(nprops, 2, "H5Pget_nprops"); @@ -663,24 +677,23 @@ test_genprop_basic_list(void) VERIFY(ret, 1, "H5Pexist"); /* Check the sizes of the properties */ - ret = H5Pget_size(lid1, PROP1_NAME,&size); + ret = H5Pget_size(lid1, PROP1_NAME, &size); CHECK_I(ret, "H5Pget_size"); VERIFY(size, PROP1_SIZE, "H5Pget_size"); - ret = H5Pget_size(lid1, PROP2_NAME,&size); + ret = H5Pget_size(lid1, PROP2_NAME, &size); CHECK_I(ret, "H5Pget_size"); VERIFY(size, PROP2_SIZE, "H5Pget_size"); /* Check values of properties (set with default values) */ - ret = H5Pget(lid1, PROP1_NAME,&prop1_value); + ret = H5Pget(lid1, PROP1_NAME, &prop1_value); CHECK_I(ret, "H5Pget"); VERIFY(prop1_value, *PROP1_DEF_VALUE, "H5Pget"); - ret = H5Pget(lid1, PROP2_NAME,&prop2_value); + ret = H5Pget(lid1, PROP2_NAME, &prop2_value); CHECK_I(ret, "H5Pget"); /* Verify the floating-poing value in this way to avoid compiler warning. */ - if(!H5_FLT_ABS_EQUAL(prop2_value,*PROP2_DEF_VALUE)) - HDprintf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", - "H5Pget", (double)*PROP2_DEF_VALUE, (double)prop2_value, (int)__LINE__, __FILE__); - + if (!H5_FLT_ABS_EQUAL(prop2_value, *PROP2_DEF_VALUE)) + HDprintf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", "H5Pget", + (double)*PROP2_DEF_VALUE, (double)prop2_value, (int)__LINE__, __FILE__); /* Close list */ ret = H5Pclose(lid1); @@ -702,30 +715,32 @@ test_genprop_basic_list(void) static void test_genprop_basic_list_prop(void) { - hid_t cid1; /* Generic Property class ID */ - hid_t lid1; /* Generic Property list ID */ - size_t nprops; /* Number of properties */ - int prop1_value; /* Value for property #1 */ - float prop2_value; /* Value for property #2 */ - char prop3_value[10];/* Property #3 value */ - double prop4_value; /* Property #4 value */ - herr_t ret; /* Generic return value */ + hid_t cid1; /* Generic Property class ID */ + hid_t lid1; /* Generic Property list ID */ + size_t nprops; /* Number of properties */ + int prop1_value; /* Value for property #1 */ + float prop2_value; /* Value for property #2 */ + char prop3_value[10]; /* Property #3 value */ + double prop4_value; /* Property #4 value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Generic Property List Property Functionality\n")); /* Create a new generic class, derived from the root of the class hierarchy */ - cid1 = H5Pcreate_class(H5P_ROOT,CLASS1_NAME, NULL, NULL, NULL, NULL, NULL, NULL); + cid1 = H5Pcreate_class(H5P_ROOT, CLASS1_NAME, NULL, NULL, NULL, NULL, NULL, NULL); CHECK_I(cid1, "H5Pcreate_class"); /* Add several properties (several w/default values) */ /* Insert first property into class (with no callbacks) */ - ret = H5Pregister2(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + ret = + H5Pregister2(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); CHECK_I(ret, "H5Pregister2"); /* Insert second property into class (with no callbacks) */ - ret = H5Pregister2(cid1, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + ret = + H5Pregister2(cid1, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); CHECK_I(ret, "H5Pregister2"); /* Create a property list from the class */ @@ -733,7 +748,7 @@ test_genprop_basic_list_prop(void) CHECK_I(lid1, "H5Pcreate"); /* Check the number of properties in list */ - ret = H5Pget_nprops(lid1,&nprops); + ret = H5Pget_nprops(lid1, &nprops); CHECK_I(ret, "H5Pget_nprops"); VERIFY(nprops, 2, "H5Pget_nprops"); @@ -748,7 +763,7 @@ test_genprop_basic_list_prop(void) CHECK_I(ret, "H5Pinsert2"); /* Check the number of properties in list */ - ret = H5Pget_nprops(lid1,&nprops); + ret = H5Pget_nprops(lid1, &nprops); CHECK_I(ret, "H5Pget_nprops"); VERIFY(nprops, 4, "H5Pget_nprops"); @@ -763,35 +778,34 @@ test_genprop_basic_list_prop(void) VERIFY(ret, 1, "H5Pexist"); /* Check values of permanent properties (set with default values) */ - ret = H5Pget(lid1, PROP1_NAME,&prop1_value); + ret = H5Pget(lid1, PROP1_NAME, &prop1_value); CHECK_I(ret, "H5Pget"); VERIFY(prop1_value, *PROP1_DEF_VALUE, "H5Pget"); - ret = H5Pget(lid1, PROP2_NAME,&prop2_value); + ret = H5Pget(lid1, PROP2_NAME, &prop2_value); CHECK_I(ret, "H5Pget"); /* Verify the floating-poing value in this way to avoid compiler warning. */ - if(!H5_FLT_ABS_EQUAL(prop2_value,*PROP2_DEF_VALUE)) - HDprintf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", - "H5Pget", (double)*PROP2_DEF_VALUE, (double)prop2_value, (int)__LINE__, __FILE__); - + if (!H5_FLT_ABS_EQUAL(prop2_value, *PROP2_DEF_VALUE)) + HDprintf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", "H5Pget", + (double)*PROP2_DEF_VALUE, (double)prop2_value, (int)__LINE__, __FILE__); /* Check values of temporary properties (set with regular values) */ - ret = H5Pget(lid1, PROP3_NAME,&prop3_value); + ret = H5Pget(lid1, PROP3_NAME, &prop3_value); CHECK_I(ret, "H5Pget"); - if(HDmemcmp(&prop3_value, PROP3_DEF_VALUE, PROP3_SIZE)!=0) - TestErrPrintf("Property #3 doesn't match!, line=%d\n",__LINE__); - ret = H5Pget(lid1, PROP4_NAME,&prop4_value); + if (HDmemcmp(&prop3_value, PROP3_DEF_VALUE, PROP3_SIZE) != 0) + TestErrPrintf("Property #3 doesn't match!, line=%d\n", __LINE__); + ret = H5Pget(lid1, PROP4_NAME, &prop4_value); CHECK_I(ret, "H5Pget"); /* Verify the floating-poing value in this way to avoid compiler warning. */ - if(!H5_DBL_ABS_EQUAL(prop4_value, *PROP4_DEF_VALUE)) - HDprintf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", - "H5Pget", *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__); + if (!H5_DBL_ABS_EQUAL(prop4_value, *PROP4_DEF_VALUE)) + HDprintf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", "H5Pget", + *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__); /* Delete permanent property */ ret = H5Premove(lid1, PROP2_NAME); CHECK_I(ret, "H5Premove"); /* Check number of properties */ - ret = H5Pget_nprops(lid1,&nprops); + ret = H5Pget_nprops(lid1, &nprops); CHECK_I(ret, "H5Pget_nprops"); VERIFY(nprops, 3, "H5Pget_nprops"); @@ -800,7 +814,7 @@ test_genprop_basic_list_prop(void) CHECK_I(ret, "H5Premove"); /* Check number of properties */ - ret = H5Pget_nprops(lid1,&nprops); + ret = H5Pget_nprops(lid1, &nprops); CHECK_I(ret, "H5Pget_nprops"); VERIFY(nprops, 2, "H5Pget_nprops"); @@ -811,17 +825,17 @@ test_genprop_basic_list_prop(void) VERIFY(ret, 1, "H5Pexist"); /* Check values of permanent properties (set with default values) */ - ret = H5Pget(lid1, PROP1_NAME,&prop1_value); + ret = H5Pget(lid1, PROP1_NAME, &prop1_value); CHECK_I(ret, "H5Pget"); VERIFY(prop1_value, *PROP1_DEF_VALUE, "H5Pget"); /* Check values of temporary properties (set with regular values) */ - ret = H5Pget(lid1, PROP4_NAME,&prop4_value); + ret = H5Pget(lid1, PROP4_NAME, &prop4_value); CHECK_I(ret, "H5Pget"); /* Verify the floating-poing value in this way to avoid compiler warning. */ - if(!H5_DBL_ABS_EQUAL(prop4_value, *PROP4_DEF_VALUE)) - HDprintf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", - "H5Pget", *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__); + if (!H5_DBL_ABS_EQUAL(prop4_value, *PROP4_DEF_VALUE)) + HDprintf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", "H5Pget", + *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__); /* Close list */ ret = H5Pclose(lid1); @@ -839,12 +853,11 @@ test_genprop_basic_list_prop(void) ** ****************************************************************/ static int -test_genprop_iter2(hid_t H5_ATTR_UNUSED id, const char *name, - void *iter_data) +test_genprop_iter2(hid_t H5_ATTR_UNUSED id, const char *name, void *iter_data) { iter_data_t *idata = (iter_data_t *)iter_data; - return HDstrcmp(name,idata->names[idata->iter_count++]); + return HDstrcmp(name, idata->names[idata->iter_count++]); } /**************************************************************** @@ -856,37 +869,35 @@ test_genprop_iter2(hid_t H5_ATTR_UNUSED id, const char *name, static void test_genprop_list_iter(void) { - hid_t cid1; /* Generic Property class ID */ - hid_t lid1; /* Generic Property list ID */ - size_t nprops; /* Number of properties */ - int idx; /* Index to start iteration at */ - struct { /* Struct for iterations */ - int iter_count; + hid_t cid1; /* Generic Property class ID */ + hid_t lid1; /* Generic Property list ID */ + size_t nprops; /* Number of properties */ + int idx; /* Index to start iteration at */ + struct { /* Struct for iterations */ + int iter_count; const char **names; } iter_struct; - const char *pnames[4]={ /* Names of properties for iterator */ - PROP3_NAME, - PROP4_NAME, - PROP1_NAME, - PROP2_NAME - }; - herr_t ret; /* Generic return value */ + const char *pnames[4] = {/* Names of properties for iterator */ + PROP3_NAME, PROP4_NAME, PROP1_NAME, PROP2_NAME}; + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Generic Property List Iteration Functionality\n")); /* Create a new generic class, derived from the root of the class hierarchy */ - cid1 = H5Pcreate_class(H5P_ROOT,CLASS1_NAME, NULL, NULL, NULL, NULL, NULL, NULL); + cid1 = H5Pcreate_class(H5P_ROOT, CLASS1_NAME, NULL, NULL, NULL, NULL, NULL, NULL); CHECK_I(cid1, "H5Pcreate_class"); /* Add several properties (several w/default values) */ /* Insert first property into class (with no callbacks) */ - ret = H5Pregister2(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + ret = + H5Pregister2(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); CHECK_I(ret, "H5Pregister2"); /* Insert second property into class (with no callbacks) */ - ret = H5Pregister2(cid1, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + ret = + H5Pregister2(cid1, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); CHECK_I(ret, "H5Pregister2"); /* Create a property list from the class */ @@ -894,7 +905,7 @@ test_genprop_list_iter(void) CHECK_I(lid1, "H5Pcreate"); /* Check the number of properties in list */ - ret = H5Pget_nprops(lid1,&nprops); + ret = H5Pget_nprops(lid1, &nprops); CHECK_I(ret, "H5Pget_nprops"); VERIFY(nprops, 2, "H5Pget_nprops"); @@ -909,19 +920,19 @@ test_genprop_list_iter(void) CHECK_I(ret, "H5Pinsert2"); /* Check the number of properties in list */ - ret = H5Pget_nprops(lid1,&nprops); + ret = H5Pget_nprops(lid1, &nprops); CHECK_I(ret, "H5Pget_nprops"); VERIFY(nprops, 4, "H5Pget_nprops"); /* Iterate over all properties in list */ - iter_struct.iter_count=0; - iter_struct.names=pnames; - ret = H5Piterate(lid1,NULL,test_genprop_iter2,&iter_struct); + iter_struct.iter_count = 0; + iter_struct.names = pnames; + ret = H5Piterate(lid1, NULL, test_genprop_iter2, &iter_struct); VERIFY(ret, 0, "H5Piterate"); /* Iterate over last three properties in list */ - idx=iter_struct.iter_count=1; - ret = H5Piterate(lid1,&idx,test_genprop_iter2,&iter_struct); + idx = iter_struct.iter_count = 1; + ret = H5Piterate(lid1, &idx, test_genprop_iter2, &iter_struct); VERIFY(ret, 0, "H5Piterate"); VERIFY(idx, (int)nprops, "H5Piterate"); @@ -937,30 +948,30 @@ test_genprop_list_iter(void) typedef struct { /* Creation information */ - int crt_count; + int crt_count; char *crt_name; void *crt_value; /* Set information */ - int set_count; + int set_count; hid_t set_plist_id; char *set_name; void *set_value; /* Get information */ - int get_count; + int get_count; hid_t get_plist_id; char *get_name; void *get_value; /* Delete information */ - int del_count; + int del_count; hid_t del_plist_id; char *del_name; void *del_value; /* Copy information */ - int cop_count; + int cop_count; char *cop_name; void *cop_value; @@ -968,15 +979,15 @@ typedef struct { int cmp_count; /* Close information */ - int cls_count; + int cls_count; char *cls_name; void *cls_value; } prop_cb_info; /* Global variables for Callback information */ -prop_cb_info prop1_cb_info; /* Callback statistics for property #1 */ -prop_cb_info prop2_cb_info; /* Callback statistics for property #2 */ -prop_cb_info prop3_cb_info; /* Callback statistics for property #3 */ +prop_cb_info prop1_cb_info; /* Callback statistics for property #1 */ +prop_cb_info prop2_cb_info; /* Callback statistics for property #2 */ +prop_cb_info prop3_cb_info; /* Callback statistics for property #3 */ /**************************************************************** ** @@ -1004,11 +1015,11 @@ test_genprop_prop_crt_cb1(const char *name, size_t size, void *def_value) { /* Set the information from the creation call */ prop1_cb_info.crt_count++; - prop1_cb_info.crt_name=HDstrdup(name); - prop1_cb_info.crt_value=HDmalloc(size); - HDmemcpy(prop1_cb_info.crt_value,def_value,size); + prop1_cb_info.crt_name = HDstrdup(name); + prop1_cb_info.crt_value = HDmalloc(size); + HDmemcpy(prop1_cb_info.crt_value, def_value, size); - return(SUCCEED); + return (SUCCEED); } /**************************************************************** @@ -1021,14 +1032,14 @@ test_genprop_prop_set_cb1(hid_t plist_id, const char *name, size_t size, void *v { /* Set the information from the set call */ prop1_cb_info.set_count++; - prop1_cb_info.set_plist_id=plist_id; - if(prop1_cb_info.set_name==NULL) - prop1_cb_info.set_name=HDstrdup(name); - if(prop1_cb_info.set_value==NULL) - prop1_cb_info.set_value=HDmalloc(size); - HDmemcpy(prop1_cb_info.set_value,value,size); - - return(SUCCEED); + prop1_cb_info.set_plist_id = plist_id; + if (prop1_cb_info.set_name == NULL) + prop1_cb_info.set_name = HDstrdup(name); + if (prop1_cb_info.set_value == NULL) + prop1_cb_info.set_value = HDmalloc(size); + HDmemcpy(prop1_cb_info.set_value, value, size); + + return (SUCCEED); } /**************************************************************** @@ -1041,14 +1052,14 @@ test_genprop_prop_get_cb1(hid_t plist_id, const char *name, size_t size, void *v { /* Set the information from the get call */ prop1_cb_info.get_count++; - prop1_cb_info.get_plist_id=plist_id; - if(prop1_cb_info.get_name==NULL) - prop1_cb_info.get_name=HDstrdup(name); - if(prop1_cb_info.get_value==NULL) - prop1_cb_info.get_value=HDmalloc(size); - HDmemcpy(prop1_cb_info.get_value,value,size); - - return(SUCCEED); + prop1_cb_info.get_plist_id = plist_id; + if (prop1_cb_info.get_name == NULL) + prop1_cb_info.get_name = HDstrdup(name); + if (prop1_cb_info.get_value == NULL) + prop1_cb_info.get_value = HDmalloc(size); + HDmemcpy(prop1_cb_info.get_value, value, size); + + return (SUCCEED); } /**************************************************************** @@ -1061,13 +1072,13 @@ test_genprop_prop_cop_cb1(const char *name, size_t size, void *value) { /* Set the information from the get call */ prop1_cb_info.cop_count++; - if(prop1_cb_info.cop_name==NULL) - prop1_cb_info.cop_name=HDstrdup(name); - if(prop1_cb_info.cop_value==NULL) - prop1_cb_info.cop_value=HDmalloc(size); - HDmemcpy(prop1_cb_info.cop_value,value,size); + if (prop1_cb_info.cop_name == NULL) + prop1_cb_info.cop_name = HDstrdup(name); + if (prop1_cb_info.cop_value == NULL) + prop1_cb_info.cop_value = HDmalloc(size); + HDmemcpy(prop1_cb_info.cop_value, value, size); - return(SUCCEED); + return (SUCCEED); } /**************************************************************** @@ -1081,7 +1092,7 @@ test_genprop_prop_cmp_cb1(const void *value1, const void *value2, size_t size) /* Set the information from the comparison call */ prop1_cb_info.cmp_count++; - return(HDmemcmp(value1, value2, size)); + return (HDmemcmp(value1, value2, size)); } /**************************************************************** @@ -1095,7 +1106,7 @@ test_genprop_prop_cmp_cb3(const void *value1, const void *value2, size_t size) /* Set the information from the comparison call */ prop3_cb_info.cmp_count++; - return(HDmemcmp(value1, value2, size)); + return (HDmemcmp(value1, value2, size)); } /**************************************************************** @@ -1108,13 +1119,13 @@ test_genprop_prop_cls_cb1(const char *name, size_t size, void *value) { /* Set the information from the close call */ prop1_cb_info.cls_count++; - if(prop1_cb_info.cls_name==NULL) - prop1_cb_info.cls_name=HDstrdup(name); - if(prop1_cb_info.cls_value==NULL) - prop1_cb_info.cls_value=HDmalloc(size); - HDmemcpy(prop1_cb_info.cls_value,value,size); + if (prop1_cb_info.cls_name == NULL) + prop1_cb_info.cls_name = HDstrdup(name); + if (prop1_cb_info.cls_value == NULL) + prop1_cb_info.cls_value = HDmalloc(size); + HDmemcpy(prop1_cb_info.cls_value, value, size); - return(SUCCEED); + return (SUCCEED); } /**************************************************************** @@ -1127,12 +1138,12 @@ test_genprop_prop_del_cb2(hid_t plist_id, const char *name, size_t size, void *v { /* Set the information from the delete call */ prop2_cb_info.del_count++; - prop2_cb_info.del_plist_id=plist_id; - prop2_cb_info.del_name=HDstrdup(name); - prop2_cb_info.del_value=HDmalloc(size); - HDmemcpy(prop2_cb_info.del_value,value,size); + prop2_cb_info.del_plist_id = plist_id; + prop2_cb_info.del_name = HDstrdup(name); + prop2_cb_info.del_value = HDmalloc(size); + HDmemcpy(prop2_cb_info.del_value, value, size); - return(SUCCEED); + return (SUCCEED); } /**************************************************************** @@ -1144,58 +1155,64 @@ test_genprop_prop_del_cb2(hid_t plist_id, const char *name, size_t size, void *v static void test_genprop_list_callback(void) { - hid_t cid1; /* Generic Property class ID */ - hid_t lid1; /* Generic Property list ID */ - hid_t lid2; /* 2nd Generic Property list ID */ - size_t nprops; /* Number of properties in class */ - int prop1_value; /* Value for property #1 */ - int prop1_new_value=20; /* Property #1 new value */ - float prop2_value; /* Value for property #2 */ - char prop3_value[10];/* Property #3 value */ - char prop3_new_value[10]="10 chairs"; /* Property #3 new value */ - double prop4_value; /* Property #4 value */ - struct { /* Struct for callbacks */ - int count; + hid_t cid1; /* Generic Property class ID */ + hid_t lid1; /* Generic Property list ID */ + hid_t lid2; /* 2nd Generic Property list ID */ + size_t nprops; /* Number of properties in class */ + int prop1_value; /* Value for property #1 */ + int prop1_new_value = 20; /* Property #1 new value */ + float prop2_value; /* Value for property #2 */ + char prop3_value[10]; /* Property #3 value */ + char prop3_new_value[10] = "10 chairs"; /* Property #3 new value */ + double prop4_value; /* Property #4 value */ + struct { /* Struct for callbacks */ + int count; hid_t id; } cop_cb_struct; - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Generic Property List Property Callback Functionality\n")); /* Create a new generic class, derived from the root of the class hierarchy */ - cid1 = H5Pcreate_class(H5P_ROOT,CLASS1_NAME, NULL, NULL,test_genprop_cls_cpy_cb2,&cop_cb_struct,NULL, NULL); + cid1 = H5Pcreate_class(H5P_ROOT, CLASS1_NAME, NULL, NULL, test_genprop_cls_cpy_cb2, &cop_cb_struct, NULL, + NULL); CHECK_I(cid1, "H5Pcreate_class"); /* Insert first property into class (with callbacks) */ - ret = H5Pregister2(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE,test_genprop_prop_crt_cb1,test_genprop_prop_set_cb1,test_genprop_prop_get_cb1,NULL,test_genprop_prop_cop_cb1,test_genprop_prop_cmp_cb1,test_genprop_prop_cls_cb1); + ret = H5Pregister2(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, test_genprop_prop_crt_cb1, + test_genprop_prop_set_cb1, test_genprop_prop_get_cb1, NULL, test_genprop_prop_cop_cb1, + test_genprop_prop_cmp_cb1, test_genprop_prop_cls_cb1); CHECK_I(ret, "H5Pregister2"); /* Insert second property into class (with only delete callback) */ - ret = H5Pregister2(cid1, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, NULL, NULL, NULL,test_genprop_prop_del_cb2,NULL, NULL, NULL); + ret = H5Pregister2(cid1, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, NULL, NULL, NULL, + test_genprop_prop_del_cb2, NULL, NULL, NULL); CHECK_I(ret, "H5Pregister2"); /* Insert third property into class (with only compare callback) */ - ret = H5Pregister2(cid1, PROP3_NAME, PROP3_SIZE, PROP3_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, test_genprop_prop_cmp_cb3, NULL); + ret = H5Pregister2(cid1, PROP3_NAME, PROP3_SIZE, PROP3_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, + test_genprop_prop_cmp_cb3, NULL); CHECK_I(ret, "H5Pregister2"); /* Insert fourth property into class (with no callbacks) */ - ret = H5Pregister2(cid1, PROP4_NAME, PROP4_SIZE, PROP4_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + ret = + H5Pregister2(cid1, PROP4_NAME, PROP4_SIZE, PROP4_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); CHECK_I(ret, "H5Pregister2"); /* Check the number of properties in class */ - ret = H5Pget_nprops(cid1,&nprops); + ret = H5Pget_nprops(cid1, &nprops); CHECK_I(ret, "H5Pget_nprops"); VERIFY(nprops, 4, "H5Pget_nprops"); /* Initialize class callback structs */ - cop_cb_struct.count=0; - cop_cb_struct.id=(-1); + cop_cb_struct.count = 0; + cop_cb_struct.id = (-1); /* Initialize callback information for properties tracked */ - HDmemset(&prop1_cb_info,0,sizeof(prop_cb_info)); - HDmemset(&prop2_cb_info,0,sizeof(prop_cb_info)); - HDmemset(&prop3_cb_info,0,sizeof(prop_cb_info)); + HDmemset(&prop1_cb_info, 0, sizeof(prop_cb_info)); + HDmemset(&prop2_cb_info, 0, sizeof(prop_cb_info)); + HDmemset(&prop3_cb_info, 0, sizeof(prop_cb_info)); /* Create a property list from the class */ lid1 = H5Pcreate(cid1); @@ -1210,81 +1227,81 @@ test_genprop_list_callback(void) /* Verify creation callback information for properties tracked */ VERIFY(prop1_cb_info.crt_count, 1, "H5Pcreate"); - if(HDstrcmp(prop1_cb_info.crt_name, PROP1_NAME)!=0) - TestErrPrintf("Property #1 name doesn't match!, line=%d\n",__LINE__); - if(HDmemcmp(prop1_cb_info.crt_value, PROP1_DEF_VALUE, PROP1_SIZE)!=0) - TestErrPrintf("Property #1 value doesn't match!, line=%d\n",__LINE__); + if (HDstrcmp(prop1_cb_info.crt_name, PROP1_NAME) != 0) + TestErrPrintf("Property #1 name doesn't match!, line=%d\n", __LINE__); + if (HDmemcmp(prop1_cb_info.crt_value, PROP1_DEF_VALUE, PROP1_SIZE) != 0) + TestErrPrintf("Property #1 value doesn't match!, line=%d\n", __LINE__); /* Check values of permanent properties (set with default values) */ - ret = H5Pget(lid1, PROP1_NAME,&prop1_value); + ret = H5Pget(lid1, PROP1_NAME, &prop1_value); CHECK_I(ret, "H5Pget"); VERIFY(prop1_value, *PROP1_DEF_VALUE, "H5Pget"); /* The compare callback should not have been called */ VERIFY(prop1_cb_info.cmp_count, 0, "H5Pget"); - ret = H5Pget(lid1, PROP2_NAME,&prop2_value); + ret = H5Pget(lid1, PROP2_NAME, &prop2_value); CHECK_I(ret, "H5Pget"); /* Verify the floating-poing value in this way to avoid compiler warning. */ - if(!H5_FLT_ABS_EQUAL(prop2_value,*PROP2_DEF_VALUE)) - HDprintf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", - "H5Pget", (double)*PROP2_DEF_VALUE, (double)prop2_value, (int)__LINE__, __FILE__); + if (!H5_FLT_ABS_EQUAL(prop2_value, *PROP2_DEF_VALUE)) + HDprintf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", "H5Pget", + (double)*PROP2_DEF_VALUE, (double)prop2_value, (int)__LINE__, __FILE__); /* Check values of temporary properties (set with regular values) */ - ret = H5Pget(lid1, PROP3_NAME,&prop3_value); + ret = H5Pget(lid1, PROP3_NAME, &prop3_value); CHECK_I(ret, "H5Pget"); - if(HDmemcmp(&prop3_value, PROP3_DEF_VALUE, PROP3_SIZE)!=0) - TestErrPrintf("Property #3 doesn't match!, line=%d\n",__LINE__); + if (HDmemcmp(&prop3_value, PROP3_DEF_VALUE, PROP3_SIZE) != 0) + TestErrPrintf("Property #3 doesn't match!, line=%d\n", __LINE__); /* The compare callback should not have been called, as there is no get * callback for this property */ VERIFY(prop3_cb_info.cmp_count, 0, "H5Pget"); - ret = H5Pget(lid1, PROP4_NAME,&prop4_value); + ret = H5Pget(lid1, PROP4_NAME, &prop4_value); CHECK_I(ret, "H5Pget"); /* Verify the floating-poing value in this way to avoid compiler warning. */ - if(!H5_DBL_ABS_EQUAL(prop4_value, *PROP4_DEF_VALUE)) - HDprintf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", - "H5Pget", *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__); + if (!H5_DBL_ABS_EQUAL(prop4_value, *PROP4_DEF_VALUE)) + HDprintf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", "H5Pget", + *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__); /* Verify get callback information for properties tracked */ VERIFY(prop1_cb_info.get_count, 1, "H5Pget"); VERIFY(prop1_cb_info.get_plist_id, lid1, "H5Pget"); - if(HDstrcmp(prop1_cb_info.get_name, PROP1_NAME)!=0) - TestErrPrintf("Property #1 name doesn't match!, line=%d\n",__LINE__); - if(HDmemcmp(prop1_cb_info.get_value, PROP1_DEF_VALUE, PROP1_SIZE)!=0) - TestErrPrintf("Property #1 value doesn't match!, line=%d\n",__LINE__); + if (HDstrcmp(prop1_cb_info.get_name, PROP1_NAME) != 0) + TestErrPrintf("Property #1 name doesn't match!, line=%d\n", __LINE__); + if (HDmemcmp(prop1_cb_info.get_value, PROP1_DEF_VALUE, PROP1_SIZE) != 0) + TestErrPrintf("Property #1 value doesn't match!, line=%d\n", __LINE__); /* Set value of property #1 to different value */ - ret = H5Pset(lid1, PROP1_NAME,&prop1_new_value); + ret = H5Pset(lid1, PROP1_NAME, &prop1_new_value); CHECK_I(ret, "H5Pset"); /* Verify set callback information for properties tracked */ VERIFY(prop1_cb_info.set_count, 1, "H5Pset"); VERIFY(prop1_cb_info.set_plist_id, lid1, "H5Pset"); - if(HDstrcmp(prop1_cb_info.set_name, PROP1_NAME)!=0) - TestErrPrintf("Property #1 name doesn't match!, line=%d\n",__LINE__); - if(HDmemcmp(prop1_cb_info.set_value,&prop1_new_value, PROP1_SIZE)!=0) - TestErrPrintf("Property #1 value doesn't match!, line=%d\n",__LINE__); + if (HDstrcmp(prop1_cb_info.set_name, PROP1_NAME) != 0) + TestErrPrintf("Property #1 name doesn't match!, line=%d\n", __LINE__); + if (HDmemcmp(prop1_cb_info.set_value, &prop1_new_value, PROP1_SIZE) != 0) + TestErrPrintf("Property #1 value doesn't match!, line=%d\n", __LINE__); /* The compare callback should not have been called */ VERIFY(prop1_cb_info.cmp_count, 0, "H5Pset"); /* Set value of property #3 to different value */ - ret = H5Pset(lid1, PROP3_NAME,prop3_new_value); + ret = H5Pset(lid1, PROP3_NAME, prop3_new_value); CHECK_I(ret, "H5Pset"); /* The compare callback should not have been called */ VERIFY(prop3_cb_info.cmp_count, 0, "H5Pset"); /* Check new value of tracked properties */ - ret = H5Pget(lid1, PROP1_NAME,&prop1_value); + ret = H5Pget(lid1, PROP1_NAME, &prop1_value); CHECK_I(ret, "H5Pget"); VERIFY(prop1_value, prop1_new_value, "H5Pget"); /* Verify get callback information again for properties tracked */ VERIFY(prop1_cb_info.get_count, 2, "H5Pget"); VERIFY(prop1_cb_info.get_plist_id, lid1, "H5Pget"); - if(HDstrcmp(prop1_cb_info.get_name, PROP1_NAME)!=0) - TestErrPrintf("Property #1 name doesn't match!, line=%d\n",__LINE__); - if(HDmemcmp(prop1_cb_info.get_value,&prop1_new_value, PROP1_SIZE)!=0) - TestErrPrintf("Property #1 value doesn't match!, line=%d\n",__LINE__); + if (HDstrcmp(prop1_cb_info.get_name, PROP1_NAME) != 0) + TestErrPrintf("Property #1 name doesn't match!, line=%d\n", __LINE__); + if (HDmemcmp(prop1_cb_info.get_value, &prop1_new_value, PROP1_SIZE) != 0) + TestErrPrintf("Property #1 value doesn't match!, line=%d\n", __LINE__); /* Delete property #2 */ ret = H5Premove(lid1, PROP2_NAME); @@ -1293,10 +1310,10 @@ test_genprop_list_callback(void) /* Verify delete callback information for properties tracked */ VERIFY(prop2_cb_info.del_count, 1, "H5Premove"); VERIFY(prop2_cb_info.del_plist_id, lid1, "H5Premove"); - if(HDstrcmp(prop2_cb_info.del_name, PROP2_NAME)!=0) - TestErrPrintf("Property #2 name doesn't match!, line=%d\n",__LINE__); - if(HDmemcmp(prop2_cb_info.del_value, PROP2_DEF_VALUE, PROP2_SIZE)!=0) - TestErrPrintf("Property #2 value doesn't match!, line=%d\n",__LINE__); + if (HDstrcmp(prop2_cb_info.del_name, PROP2_NAME) != 0) + TestErrPrintf("Property #2 name doesn't match!, line=%d\n", __LINE__); + if (HDmemcmp(prop2_cb_info.del_value, PROP2_DEF_VALUE, PROP2_SIZE) != 0) + TestErrPrintf("Property #2 value doesn't match!, line=%d\n", __LINE__); /* Copy first list */ lid2 = H5Pcopy(lid1); @@ -1304,17 +1321,17 @@ test_genprop_list_callback(void) /* Verify copy callback information for properties tracked */ VERIFY(prop1_cb_info.cop_count, 1, "H5Pcopy"); - if(HDstrcmp(prop1_cb_info.cop_name, PROP1_NAME)!=0) - TestErrPrintf("Property #1 name doesn't match!, line=%d\n",__LINE__); - if(HDmemcmp(prop1_cb_info.cop_value,&prop1_new_value, PROP1_SIZE)!=0) - TestErrPrintf("Property #1 value doesn't match!, line=%d\n",__LINE__); + if (HDstrcmp(prop1_cb_info.cop_name, PROP1_NAME) != 0) + TestErrPrintf("Property #1 name doesn't match!, line=%d\n", __LINE__); + if (HDmemcmp(prop1_cb_info.cop_value, &prop1_new_value, PROP1_SIZE) != 0) + TestErrPrintf("Property #1 value doesn't match!, line=%d\n", __LINE__); /* Verify that the class creation callback occurred */ VERIFY(cop_cb_struct.count, 1, "H5Pcopy"); VERIFY(cop_cb_struct.id, lid2, "H5Pcopy"); /* Compare the two lists */ - ret = H5Pequal(lid1,lid2); + ret = H5Pequal(lid1, lid2); VERIFY(ret, 1, "H5Pequal"); /* Verify compare callback information for properties tracked */ @@ -1327,10 +1344,10 @@ test_genprop_list_callback(void) /* Verify close callback information for properties tracked */ VERIFY(prop1_cb_info.cls_count, 1, "H5Pclose"); - if(HDstrcmp(prop1_cb_info.cls_name, PROP1_NAME)!=0) - TestErrPrintf("Property #1 name doesn't match!, line=%d\n",__LINE__); - if(HDmemcmp(prop1_cb_info.cls_value,&prop1_new_value, PROP1_SIZE)!=0) - TestErrPrintf("Property #1 value doesn't match!, line=%d\n",__LINE__); + if (HDstrcmp(prop1_cb_info.cls_name, PROP1_NAME) != 0) + TestErrPrintf("Property #1 name doesn't match!, line=%d\n", __LINE__); + if (HDmemcmp(prop1_cb_info.cls_value, &prop1_new_value, PROP1_SIZE) != 0) + TestErrPrintf("Property #1 value doesn't match!, line=%d\n", __LINE__); /* Close second list */ ret = H5Pclose(lid2); @@ -1368,12 +1385,12 @@ test_genprop_list_callback(void) static void test_genprop_list_addprop(void) { - hid_t fid; /* File ID */ - hid_t did; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t pid; /* Property List ID */ - int prop1_value; /* Value for property #1 */ - herr_t ret; /* Generic return value */ + hid_t fid; /* File ID */ + hid_t did; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t pid; /* Property List ID */ + int prop1_value; /* Value for property #1 */ + herr_t ret; /* Generic return value */ /* Create file */ fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -1396,7 +1413,7 @@ test_genprop_list_addprop(void) VERIFY(ret, 1, "H5Pexist"); /* Check values of property (set with default value) */ - ret = H5Pget(pid, PROP1_NAME,&prop1_value); + ret = H5Pget(pid, PROP1_NAME, &prop1_value); CHECK_I(ret, "H5Pget"); VERIFY(prop1_value, *PROP1_DEF_VALUE, "H5Pget"); @@ -1442,13 +1459,13 @@ test_genprop_list_addprop(void) static void test_genprop_class_addprop(void) { - hid_t fid; /* File ID */ - hid_t did; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t cid; /* Property Class ID */ - hid_t pid; /* Property List ID */ - int prop1_value; /* Value for property #1 */ - herr_t ret; /* Generic return value */ + hid_t fid; /* File ID */ + hid_t did; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t cid; /* Property Class ID */ + hid_t pid; /* Property List ID */ + int prop1_value; /* Value for property #1 */ + herr_t ret; /* Generic return value */ /* Create file */ fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -1467,7 +1484,8 @@ test_genprop_class_addprop(void) VERIFY(ret, 1, "H5Pexist"); /* Insert first property into class (with no callbacks) */ - ret = H5Pregister2(cid, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + ret = + H5Pregister2(cid, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); CHECK_I(ret, "H5Pregister2"); /* Check existence of an original property */ @@ -1496,7 +1514,8 @@ test_genprop_class_addprop(void) VERIFY(prop1_value, *PROP1_DEF_VALUE, "H5Pget"); /* Insert second property into class (with no callbacks) */ - ret = H5Pregister2(cid, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + ret = + H5Pregister2(cid, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); CHECK_I(ret, "H5Pregister2"); /* Check existence of an original property (in class) */ @@ -1569,8 +1588,8 @@ test_genprop_class_addprop(void) static void test_genprop_list_add_remove_prop(void) { - hid_t pid; /* Property List ID */ - herr_t ret; /* Generic return value */ + hid_t pid; /* Property List ID */ + herr_t ret; /* Generic return value */ /* Create a dataset creation property list */ pid = H5Pcreate(H5P_DATASET_CREATE); @@ -1607,25 +1626,27 @@ test_genprop_list_add_remove_prop(void) static void test_genprop_equal(void) { - hid_t cid1; /* Generic Property class ID */ - hid_t lid1; /* Generic Property list ID */ - hid_t lid2; /* Generic Property list ID */ - int prop1_new_value = 20; /* Property #1 new value */ - herr_t ret; /* Generic return value */ + hid_t cid1; /* Generic Property class ID */ + hid_t lid1; /* Generic Property list ID */ + hid_t lid2; /* Generic Property list ID */ + int prop1_new_value = 20; /* Property #1 new value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Generic Property List Equal Functionality\n")); /* Create a new generic class, derived from the root of the class hierarchy */ - cid1 = H5Pcreate_class(H5P_ROOT,CLASS1_NAME, NULL, NULL, NULL, NULL, NULL, NULL); + cid1 = H5Pcreate_class(H5P_ROOT, CLASS1_NAME, NULL, NULL, NULL, NULL, NULL, NULL); CHECK_I(cid1, "H5Pcreate_class"); /* Insert first property into class (with no callbacks) */ - ret = H5Pregister2(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + ret = + H5Pregister2(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); CHECK_I(ret, "H5Pregister2"); /* Insert second property into class (with no callbacks) */ - ret = H5Pregister2(cid1, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + ret = + H5Pregister2(cid1, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); CHECK_I(ret, "H5Pregister2"); /* Create a property list from the class */ @@ -1756,50 +1777,52 @@ test_genprop_equal(void) static void test_genprop_path(void) { - hid_t cid1; /* Generic Property class ID */ - hid_t cid2; /* Generic Property class ID */ - hid_t cid3; /* Generic Property class ID */ - char *path; /* Class path */ - herr_t ret; /* Generic return value */ + hid_t cid1; /* Generic Property class ID */ + hid_t cid2; /* Generic Property class ID */ + hid_t cid3; /* Generic Property class ID */ + char * path; /* Class path */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Generic Property List Class Path Functionality\n")); /* Create a new generic class, derived from the root of the class hierarchy */ - cid1 = H5Pcreate_class(H5P_ROOT,CLASS1_NAME, NULL, NULL, NULL, NULL, NULL, NULL); + cid1 = H5Pcreate_class(H5P_ROOT, CLASS1_NAME, NULL, NULL, NULL, NULL, NULL, NULL); CHECK_I(cid1, "H5Pcreate_class"); /* Insert first property into class (with no callbacks) */ - ret = H5Pregister2(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + ret = + H5Pregister2(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); CHECK_I(ret, "H5Pregister2"); /* Get full path for first class */ path = H5P__get_class_path_test(cid1); CHECK_PTR(path, "H5P__get_class_path_test"); - if(HDstrcmp(path,CLASS1_PATH)!=0) - TestErrPrintf("Class names don't match!, path=%s, CLASS1_PATH=%s\n",path,CLASS1_PATH); + if (HDstrcmp(path, CLASS1_PATH) != 0) + TestErrPrintf("Class names don't match!, path=%s, CLASS1_PATH=%s\n", path, CLASS1_PATH); H5free_memory(path); /* Create another new generic class, derived from first class */ - cid2 = H5Pcreate_class(cid1,CLASS2_NAME, NULL, NULL, NULL, NULL, NULL, NULL); + cid2 = H5Pcreate_class(cid1, CLASS2_NAME, NULL, NULL, NULL, NULL, NULL, NULL); CHECK_I(cid2, "H5Pcreate_class"); /* Insert second property into class (with no callbacks) */ - ret = H5Pregister2(cid2, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + ret = + H5Pregister2(cid2, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); CHECK_I(ret, "H5Pregister2"); /* Get full path for second class */ path = H5P__get_class_path_test(cid2); CHECK_PTR(path, "H5P__get_class_path_test"); - if(HDstrcmp(path,CLASS2_PATH)!=0) - TestErrPrintf("Class names don't match!, path=%s, CLASS2_PATH=%s\n",path,CLASS2_PATH); + if (HDstrcmp(path, CLASS2_PATH) != 0) + TestErrPrintf("Class names don't match!, path=%s, CLASS2_PATH=%s\n", path, CLASS2_PATH); /* Open a copy of the class with the path name */ cid3 = H5P__open_class_path_test(path); CHECK_I(cid3, "H5P__open_class_path_test"); /* Check that the classes are equal */ - ret = H5Pequal(cid2,cid3); + ret = H5Pequal(cid2, cid3); VERIFY(ret, 1, "H5Pequal"); /* Release the path string */ @@ -1828,20 +1851,21 @@ test_genprop_path(void) static void test_genprop_refcount(void) { - hid_t cid1; /* Generic Property class ID */ - hid_t lid1; /* Generic Property class ID */ - char *name; /* Name of class */ - herr_t ret; /* Generic return value */ + hid_t cid1; /* Generic Property class ID */ + hid_t lid1; /* Generic Property class ID */ + char * name; /* Name of class */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Generic Property List Reference Count Functionality\n")); /* Create a new generic class, derived from the root of the class hierarchy */ - cid1 = H5Pcreate_class(H5P_ROOT,CLASS1_NAME, NULL, NULL, NULL, NULL, NULL, NULL); + cid1 = H5Pcreate_class(H5P_ROOT, CLASS1_NAME, NULL, NULL, NULL, NULL, NULL, NULL); CHECK_I(cid1, "H5Pcreate_class"); /* Insert first property into class (with no callbacks) */ - ret = H5Pregister2(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + ret = + H5Pregister2(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL); CHECK_I(ret, "H5Pregister2"); /* Create a new generic list, derived from the root of the class hierarchy */ @@ -1851,8 +1875,8 @@ test_genprop_refcount(void) /* Check class name */ name = H5Pget_class_name(cid1); CHECK_PTR(name, "H5Pget_class_name"); - if(HDstrcmp(name,CLASS1_NAME)!=0) - TestErrPrintf("Class names don't match!, name=%s, CLASS1_NAME=%s\n",name,CLASS1_NAME); + if (HDstrcmp(name, CLASS1_NAME) != 0) + TestErrPrintf("Class names don't match!, name=%s, CLASS1_NAME=%s\n", name, CLASS1_NAME); H5free_memory(name); /* Close class */ @@ -1864,14 +1888,14 @@ test_genprop_refcount(void) CHECK_I(cid1, "H5Pget_class"); /* Check correct "is a" class/list relationship */ - ret = H5Pisa_class(lid1,cid1); + ret = H5Pisa_class(lid1, cid1); VERIFY(ret, 1, "H5Pisa_class"); /* Check class name */ name = H5Pget_class_name(cid1); CHECK_PTR(name, "H5Pget_class_name"); - if(HDstrcmp(name,CLASS1_NAME)!=0) - TestErrPrintf("Class names don't match!, name=%s, CLASS1_NAME=%s\n",name,CLASS1_NAME); + if (HDstrcmp(name, CLASS1_NAME) != 0) + TestErrPrintf("Class names don't match!, name=%s, CLASS1_NAME=%s\n", name, CLASS1_NAME); H5free_memory(name); /* Close list */ @@ -1881,8 +1905,8 @@ test_genprop_refcount(void) /* Check class name */ name = H5Pget_class_name(cid1); CHECK_PTR(name, "H5Pget_class_name"); - if(HDstrcmp(name,CLASS1_NAME)!=0) - TestErrPrintf("Class names don't match!, name=%s, CLASS1_NAME=%s\n",name,CLASS1_NAME); + if (HDstrcmp(name, CLASS1_NAME) != 0) + TestErrPrintf("Class names don't match!, name=%s, CLASS1_NAME=%s\n", name, CLASS1_NAME); H5free_memory(name); /* Close class */ @@ -1901,10 +1925,10 @@ test_genprop_refcount(void) static void test_genprop_deprec_class(void) { - hid_t cid1; /* Generic Property class ID */ - size_t size; /* Size of property */ - size_t nprops; /* Number of properties in class */ - herr_t ret; /* Generic return value */ + hid_t cid1; /* Generic Property class ID */ + size_t size; /* Size of property */ + size_t nprops; /* Number of properties in class */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Deprecated Generic Property List Functions\n")); @@ -2029,12 +2053,12 @@ test_genprop_deprec_class(void) static void test_genprop_deprec_list(void) { - hid_t fid; /* File ID */ - hid_t did; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t pid; /* Property List ID */ - int prop1_value; /* Value for property #1 */ - herr_t ret; /* Generic return value */ + hid_t fid; /* File ID */ + hid_t did; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t pid; /* Property List ID */ + int prop1_value; /* Value for property #1 */ + herr_t ret; /* Generic return value */ /* Create file */ fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -2057,7 +2081,7 @@ test_genprop_deprec_list(void) VERIFY(ret, 1, "H5Pexist"); /* Check values of property (set with default value) */ - ret = H5Pget(pid, PROP1_NAME,&prop1_value); + ret = H5Pget(pid, PROP1_NAME, &prop1_value); CHECK_I(ret, "H5Pget"); VERIFY(prop1_value, *PROP1_DEF_VALUE, "H5Pget"); @@ -2104,32 +2128,32 @@ test_genprop(void) MESSAGE(5, ("Testing Generic Properties\n")); /* These tests use the same file... */ - test_genprop_basic_class(); /* Test basic code for creating a generic class */ + test_genprop_basic_class(); /* Test basic code for creating a generic class */ test_genprop_basic_class_prop(); /* Test basic code for adding properties to a generic class */ - test_genprop_class_iter(); /* Test code for iterating over properties in a generic class */ - test_genprop_class_callback(); /* Test code for property class callbacks */ + test_genprop_class_iter(); /* Test code for iterating over properties in a generic class */ + test_genprop_class_callback(); /* Test code for property class callbacks */ - test_genprop_basic_list(); /* Test basic code for creating a generic property list */ + test_genprop_basic_list(); /* Test basic code for creating a generic property list */ test_genprop_basic_list_prop(); /* Test basic code for adding properties to a generic property list */ - test_genprop_list_iter(); /* Test basic code for iterating over properties in a generic property list */ - test_genprop_list_callback(); /* Test code for property list callbacks */ + test_genprop_list_iter(); /* Test basic code for iterating over properties in a generic property list */ + test_genprop_list_callback(); /* Test code for property list callbacks */ - test_genprop_list_addprop(); /* Test adding properties to HDF5 property list */ - test_genprop_class_addprop(); /* Test adding properties to HDF5 property class */ + test_genprop_list_addprop(); /* Test adding properties to HDF5 property list */ + test_genprop_class_addprop(); /* Test adding properties to HDF5 property class */ - test_genprop_list_add_remove_prop(); /* Test adding and removing the same property several times to HDF5 property list */ + test_genprop_list_add_remove_prop(); /* Test adding and removing the same property several times to HDF5 + property list */ - test_genprop_equal(); /* Tests for more H5Pequal verification */ - test_genprop_path(); /* Tests for class path verification */ - test_genprop_refcount(); /* Tests for class reference counting */ + test_genprop_equal(); /* Tests for more H5Pequal verification */ + test_genprop_path(); /* Tests for class path verification */ + test_genprop_refcount(); /* Tests for class reference counting */ #ifndef H5_NO_DEPRECATED_SYMBOLS - test_genprop_deprec_class(); /* Tests for deprecated routines */ - test_genprop_deprec_list(); /* Tests for deprecated routines */ -#endif /* H5_NO_DEPRECATED_SYMBOLS */ - -} /* test_genprop() */ + test_genprop_deprec_class(); /* Tests for deprecated routines */ + test_genprop_deprec_list(); /* Tests for deprecated routines */ +#endif /* H5_NO_DEPRECATED_SYMBOLS */ +} /* test_genprop() */ /*------------------------------------------------------------------------- * Function: cleanup_genprop @@ -2150,4 +2174,3 @@ cleanup_genprop(void) { remove(FILENAME); } - |