summaryrefslogtreecommitdiffstats
path: root/test/ttst.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/ttst.c')
-rw-r--r--test/ttst.c30
1 files changed, 10 insertions, 20 deletions
diff --git a/test/ttst.c b/test/ttst.c
index 9632cb7..10eb017 100644
--- a/test/ttst.c
+++ b/test/ttst.c
@@ -208,18 +208,14 @@ test_tst_insert(void)
found=H5ST_find(tree,uniq_words[u]);
CHECK(found, NULL, "H5ST_find");
- if(HDstrcmp((const char *)found->eqkid,uniq_words[u])) {
- num_errs++;
- printf("%d: TST node values don't match!, found->eqkid=%s, uniq_words[%u]=%s\n",__LINE__,(char *)found->eqkid,(unsigned)u,uniq_words[u]);
- } /* end if */
+ if(HDstrcmp((const char *)found->eqkid,uniq_words[u]))
+ TestErrPrintf("%d: TST node values don't match!, found->eqkid=%s, uniq_words[%u]=%s\n",__LINE__,(char *)found->eqkid,(unsigned)u,uniq_words[u]);
obj=H5ST_locate(tree,uniq_words[u]);
CHECK(obj, NULL, "H5ST_locate");
- if(HDstrcmp((const char *)obj,uniq_words[u])) {
- num_errs++;
- printf("%d: TST objects don't match!, obj=%s, uniq_words[%u]=%s\n",__LINE__,(char *)obj,(unsigned)u,uniq_words[u]);
- } /* end if */
+ if(HDstrcmp((const char *)obj,uniq_words[u]))
+ TestErrPrintf("%d: TST objects don't match!, obj=%s, uniq_words[%u]=%s\n",__LINE__,(char *)obj,(unsigned)u,uniq_words[u]);
} /* end for */
/* Verify that words not in the TST aren't found */
@@ -268,10 +264,8 @@ test_tst_iterate(void)
u=0;
do {
/* Check that the strings in the TST are in the correct order */
- if(HDstrcmp((const char *)found->eqkid,sort_uniq_words[u])) {
- num_errs++;
- printf("%d: TST node values don't match!, found->eqkid=%s, sort_uniq_words[%u]=%s\n",__LINE__,(char *)found->eqkid,(unsigned)u,sort_uniq_words[u]);
- } /* end if */
+ if(HDstrcmp((const char *)found->eqkid,sort_uniq_words[u]))
+ TestErrPrintf("%d: TST node values don't match!, found->eqkid=%s, sort_uniq_words[%u]=%s\n",__LINE__,(char *)found->eqkid,(unsigned)u,sort_uniq_words[u]);
/* Advance to next string in TST */
found=H5ST_findnext(found);
@@ -318,10 +312,8 @@ test_tst_remove(void)
CHECK(obj, NULL, "H5ST_remove");
/* Check that the correct string was removed from TST */
- if(HDstrcmp((const char *)obj,rand_uniq_words[u])) {
- num_errs++;
- printf("%d: TST node values don't match!, obj=%s, rand_uniq_words[%u]=%s\n",__LINE__,(char *)obj,(unsigned)u,rand_uniq_words[u]);
- } /* end if */
+ if(HDstrcmp((const char *)obj,rand_uniq_words[u]))
+ TestErrPrintf("%d: TST node values don't match!, obj=%s, rand_uniq_words[%u]=%s\n",__LINE__,(char *)obj,(unsigned)u,rand_uniq_words[u]);
/* Check that the string can't be found in the TST any longer */
check=H5ST_search(tree,rand_uniq_words[u]);
@@ -341,10 +333,8 @@ test_tst_remove(void)
CHECK(found, NULL, "H5ST_find");
/* Check that the correct object will be removed from TST */
- if(HDstrcmp((const char *)found->eqkid,rand_uniq_words[u])) {
- num_errs++;
- printf("%d: TST node values don't match!, found->eqkid=%s, rand_uniq_words[%u]=%s\n",__LINE__,(char *)found->eqkid,(unsigned)u,rand_uniq_words[u]);
- } /* end if */
+ if(HDstrcmp((const char *)found->eqkid,rand_uniq_words[u]))
+ TestErrPrintf("%d: TST node values don't match!, found->eqkid=%s, rand_uniq_words[%u]=%s\n",__LINE__,(char *)found->eqkid,(unsigned)u,rand_uniq_words[u]);
/* Remove the node */
ret=H5ST_delete(tree,found);