diff options
Diffstat (limited to 'test/titerate.c')
-rw-r--r-- | test/titerate.c | 59 |
1 files changed, 21 insertions, 38 deletions
diff --git a/test/titerate.c b/test/titerate.c index aea951e..18a7246 100644 --- a/test/titerate.c +++ b/test/titerate.c @@ -178,7 +178,7 @@ static void test_iter_group(void) CHECK(ret, FAIL, "H5Fclose"); /* Sort the dataset names */ - qsort(dnames,NDATASETS,sizeof(char *),iter_strcmp); + HDqsort(dnames,NDATASETS,sizeof(char *),iter_strcmp); /* Iterate through the datasets in the root group in various ways */ @@ -267,9 +267,8 @@ static void test_iter_group(void) /* Test all objects in group, when callback always returns 0 */ info.command=RET_ZERO; idx=0; - if((ret=H5Giterate(file,"/",&idx,giter_cb,&info))>0) { + if((ret=H5Giterate(file,"/",&idx,giter_cb,&info))>0) TestErrPrintf("Group iteration function didn't return zero correctly!\n"); - } /* Test all objects in group, when callback always returns 1 */ /* This also tests the "restarting" ability, because the index changes */ @@ -287,29 +286,24 @@ static void test_iter_group(void) /* Verify that the correct name is retrieved */ if(idx<=NDATASETS) { - if(strcmp(info.name,dnames[idx-1])!=0) { + if(HDstrcmp(info.name,dnames[idx-1])!=0) TestErrPrintf("Group iteration function didn't return one correctly for dataset #%d!\n",idx); - } /* end if */ } /* end if */ else if(idx==(NDATASETS+1)) { - if(strcmp(info.name,"dtype")!=0) { + if(HDstrcmp(info.name,"dtype")!=0) TestErrPrintf("Group iteration function didn't return one correctly for group!\n"); - } /* end if */ } /* end if */ else if(idx==(NDATASETS+2)) { - if(strcmp(info.name,"grp")!=0) { + if(HDstrcmp(info.name,"grp")!=0) TestErrPrintf("Group iteration function didn't return one correctly for group!\n"); - } /* end if */ } /* end if */ - else { + else TestErrPrintf("Group iteration function walked too far!\n"); - } /* end else */ } VERIFY(ret,-1,"H5Giterate"); - if(i!=(NDATASETS+2)) { + if(i!=(NDATASETS+2)) TestErrPrintf("Group iteration function didn't perform multiple iterations correctly!\n"); - } /* end if */ /* Test all objects in group, when callback changes return value */ /* This also tests the "restarting" ability, because the index changes */ @@ -327,36 +321,31 @@ static void test_iter_group(void) /* Verify that the correct name is retrieved */ if(idx<=NDATASETS) { - if(strcmp(info.name,dnames[idx-1])!=0) { + if(HDstrcmp(info.name,dnames[idx-1])!=0) TestErrPrintf("Group iteration function didn't return one correctly for dataset #%d!\n",idx); - } /* end if */ } /* end if */ else if(idx==(NDATASETS+1)) { - if(strcmp(info.name,"dtype")!=0) { + if(HDstrcmp(info.name,"dtype")!=0) TestErrPrintf("Group iteration function didn't return one correctly for group!\n"); - } /* end if */ } /* end if */ else if(idx==(NDATASETS+2)) { - if(strcmp(info.name,"grp")!=0) { + if(HDstrcmp(info.name,"grp")!=0) TestErrPrintf("Group iteration function didn't return one correctly for group!\n"); - } /* end if */ } /* end if */ - else { + else TestErrPrintf("Group iteration function walked too far!\n"); - } /* end else */ } VERIFY(ret,-1,"H5Giterate"); - if(i!=42 || idx!=52) { + if(i!=42 || idx!=52) TestErrPrintf("Group iteration function didn't perform multiple iterations correctly!\n"); - } /* end if */ ret=H5Fclose(file); CHECK(ret, FAIL, "H5Fclose"); /* Free the dataset names */ for(i=0; i< NDATASETS; i++) - free(dnames[i]); + HDfree(dnames[i]); } /* test_iter_group() */ @@ -477,9 +466,8 @@ static void test_iter_attr(void) /* Test all attributes on dataset, when callback always returns 0 */ info.command=RET_ZERO; idx=0; - if((ret=H5Aiterate(dataset,&idx,aiter_cb,&info))>0) { + if((ret=H5Aiterate(dataset,&idx,aiter_cb,&info))>0) TestErrPrintf("Attribute iteration function didn't return zero correctly!\n"); - } /* Test all attributes on dataset, when callback always returns 1 */ /* This also tests the "restarting" ability, because the index changes */ @@ -496,14 +484,12 @@ static void test_iter_attr(void) VERIFY(idx,(unsigned)i,"H5Aiterate"); /* Verify that the correct name is retrieved */ - if(strcmp(info.name,anames[idx-1])!=0) { + if(HDstrcmp(info.name,anames[idx-1])!=0) TestErrPrintf("Attribute iteration function didn't return one correctly!\n"); - } /* end if */ } VERIFY(ret,-1,"H5Aiterate"); - if(i!=50 || idx!=50) { + if(i!=50 || idx!=50) TestErrPrintf("Group iteration function didn't perform multiple iterations correctly!\n"); - } /* end if */ /* Test all attributes on dataset, when callback changes return value */ @@ -521,14 +507,12 @@ static void test_iter_attr(void) VERIFY(idx,(unsigned)i+10,"H5Aiterate"); /* Verify that the correct name is retrieved */ - if(strcmp(info.name,anames[idx-1])!=0) { + if(HDstrcmp(info.name,anames[idx-1])!=0) TestErrPrintf("Attribute iteration function didn't return changing correctly!\n"); - } /* end if */ } VERIFY(ret,-1,"H5Aiterate"); - if(i!=40 || idx!=50) { + if(i!=40 || idx!=50) TestErrPrintf("Group iteration function didn't perform multiple iterations correctly!\n"); - } /* end if */ ret=H5Fclose(file); CHECK(ret, FAIL, "H5Fclose"); @@ -538,7 +522,7 @@ static void test_iter_attr(void) /* Free the attribute names */ for(i=0; i< NATTR; i++) - free(anames[i]); + HDfree(anames[i]); } /* test_iter_attr() */ @@ -563,7 +547,7 @@ herr_t giter_cb2(hid_t loc_id, const char *name, void *opdata) herr_t ret; /* Generic return value */ H5G_stat_t statbuf; - if(strcmp(name,test_info->name)) { + if(HDstrcmp(name,test_info->name)) { TestErrPrintf("name=%s, test_info=%s\n",name,test_info->name); return(-1); } /* end if */ @@ -774,8 +758,7 @@ static void test_grp_memb_funcs(void) CHECK(ret, FAIL, "H5Fclose"); /* Sort the dataset names */ - qsort(dnames,NDATASETS+2,sizeof(char *),iter_strcmp); - + HDqsort(dnames,NDATASETS+2,sizeof(char *),iter_strcmp); /* Iterate through the datasets in the root group in various ways */ file=H5Fopen(DATAFILE, H5F_ACC_RDONLY, H5P_DEFAULT); |