From: mquinson Date: Sun, 7 Aug 2005 14:11:09 +0000 (+0000) Subject: change mismatch_error to not_found_error where appropriate X-Git-Tag: v3.3~3754 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/fba664482175a3b24521a7b748b221549b8004f2 change mismatch_error to not_found_error where appropriate git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@1602 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/testsuite/xbt/config_usage.c b/testsuite/xbt/config_usage.c index f4e1eae2c0..47736a0be9 100644 --- a/testsuite/xbt/config_usage.c +++ b/testsuite/xbt/config_usage.c @@ -99,9 +99,9 @@ int main(int argc, char **argv) { xbt_cfg_t myset=make_set(); TRY { xbt_cfg_set_parse(myset,"color:blue"); - THROW1(unknown_error,0,"Found an option which shouldn't be there (%s)","color:blue"); + THROW1(mismatch_error,0,"Found an option which shouldn't be there (%s)","color:blue"); } CATCH(e) { - if (e.category != mismatch_error) + if (e.category != not_found_error) RETHROW; xbt_ex_free(e); } diff --git a/testsuite/xbt/dict_crash.c b/testsuite/xbt/dict_crash.c index 5315b195bf..47533999f3 100644 --- a/testsuite/xbt/dict_crash.c +++ b/testsuite/xbt/dict_crash.c @@ -140,7 +140,7 @@ int main(int argc,char **argv) { if (!(j%10000)) printf("."); fflush(stdout); sprintf(key,"%d",j); - TRYFAIL(xbt_dict_remove(head,key)); + xbt_dict_remove(head,key); } printf("\n"); free(key); diff --git a/testsuite/xbt/dict_usage.c b/testsuite/xbt/dict_usage.c index 04f4680747..c71e52482e 100644 --- a/testsuite/xbt/dict_usage.c +++ b/testsuite/xbt/dict_usage.c @@ -91,11 +91,9 @@ static void search_not_found(xbt_dict_t head, const char *data) { data = xbt_dict_get(head,"Can't be found"); THROW1(unknown_error,0,"Found something which shouldn't be there (%s)",data); } CATCH(e) { - if (e.category == mismatch_error) { - xbt_ex_free(e); - } else { + if (e.category != not_found_error) RETHROW; - } + xbt_ex_free(e); } } @@ -192,7 +190,7 @@ xbt_dict_dump(head,(void (*)(void*))&printf); TRY { debuged_remove(head,"Does not exist"); } CATCH(e) { - if (e.category != mismatch_error) + if (e.category != not_found_error) RETHROW; xbt_ex_free(e); } @@ -218,7 +216,7 @@ xbt_dict_dump(head,(void (*)(void*))&printf); TRY { debuged_remove(head,"12346"); } CATCH(e) { - if (e.category != mismatch_error) + if (e.category != not_found_error) RETHROW; xbt_ex_free(e); traverse(head); } @@ -228,7 +226,7 @@ xbt_dict_dump(head,(void (*)(void*))&printf); TRY { debuged_remove(head,"12346"); } CATCH(e) { - if (e.category != mismatch_error) + if (e.category != not_found_error) RETHROW; xbt_ex_free(e); traverse(head); }