Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Replace an exception by an assertion
[simgrid.git] / src / xbt / dict.c
index e69810a..3561e8a 100644 (file)
@@ -304,8 +304,7 @@ void xbt_dict_remove_ext(xbt_dict_t  dict,
  */
 void xbt_dict_remove(xbt_dict_t  dict,
                     const char  *key) {
-  if (!dict)
-    THROW1(arg_error, 0, "Asked to remove key %s from NULL dict", key);
+  xbt_assert(dict);
 
   xbt_dict_remove_ext(dict, key, strlen(key));
 }
@@ -518,15 +517,6 @@ XBT_TEST_UNIT("remove",test_dict_remove,"Removing some values"){
 
   xbt_dict_free(&head);
 
-  xbt_test_add0("Remove data from the NULL dict");
-  TRY {
-    debuged_remove(head,"12345");
-  } CATCH(e) {
-    if (e.category != arg_error) 
-      xbt_test_exception(e);
-    xbt_ex_free(e);
-  } 
-
   xbt_test_add0("Remove each data manually (traversing the resulting dictionnary each time)");
   fill(&head);
   debuged_remove(head,"12a");    traverse(head);