diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2004-01-10 01:41:13 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2004-01-10 01:41:13 (GMT) |
commit | 987f5d5e4de41c02b682464fa8e94252553ed57c (patch) | |
tree | 2bf74eb88dee718490af7b7dda0e585b0d1b8a95 /test/ttst.c | |
parent | 12dca9ab3c362fc190feb330232bec4bd552df3c (diff) | |
download | hdf5-987f5d5e4de41c02b682464fa8e94252553ed57c.zip hdf5-987f5d5e4de41c02b682464fa8e94252553ed57c.tar.gz hdf5-987f5d5e4de41c02b682464fa8e94252553ed57c.tar.bz2 |
[svn-r8048] Purpose:
Code cleanup & reorganization
Description:
Move further in the testing framework cleanup, eliminating all the
global variables (moving them into testframe.c as static variables) from the
testing framework code and moving it into the libh5test.a.
Platforms tested:
FreeBSD 4.9 (sleipnir) w & w/o thread-safety, c++ & parallel
h5committested
Diffstat (limited to 'test/ttst.c')
-rw-r--r-- | test/ttst.c | 30 |
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); |