From: mquinson Date: Tue, 22 Aug 2006 15:27:47 +0000 (+0000) Subject: Improve a bit the test on searching non-existant data X-Git-Tag: v3.3~2637 X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/e5ede44761143e51746afe0bd20ae29c0812549a Improve a bit the test on searching non-existant data git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@2722 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/xbt/dict.c b/src/xbt/dict.c index 6d788f0897..8f2a80f98d 100644 --- a/src/xbt/dict.c +++ b/src/xbt/dict.c @@ -517,18 +517,21 @@ static void traverse(xbt_dict_t head) { } static void search_not_found(xbt_dict_t head, const char *data) { + int ok=0; xbt_ex_t e; xbt_test_add1("Search %s (expected not to be found)",data); TRY { - data = xbt_dict_get(head,"Can't be found"); + data = xbt_dict_get(head, data); THROW1(unknown_error,0,"Found something which shouldn't be there (%s)",data); } CATCH(e) { if (e.category != not_found_error) xbt_test_exception(e); xbt_ex_free(e); + ok=1; } + xbt_test_assert0(ok,"Exception not raised"); } static void count(xbt_dict_t dict, int length) {