Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
change mismatch_error to not_found_error where appropriate
[simgrid.git] / testsuite / xbt / dict_crash.c
index 792e422..4753399 100644 (file)
@@ -2,12 +2,12 @@
 
 /* dict_crash - A crash test for dictionnaries                              */
 
-/* Copyright (c) 2004 Martin Quinson. All rights reserved.                  */
+/* Copyright (c) 2003, 2004 Martin Quinson. All rights reserved.            */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include <gras.h>
+#include "gras.h"
 #include <time.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -54,7 +54,7 @@ int main(int argc,char **argv) {
   char *key;
   void *data;
 
-  xbt_init_defaultlog(&argc,argv,"dict.thresh=verbose");
+  xbt_init(&argc,argv);
   srand((unsigned int)time(NULL));
 
   printf("Dictionnary: CRASH test:\n");
@@ -122,7 +122,7 @@ int main(int argc,char **argv) {
     for (j=0;j<NB_ELM;j++) {
       
       sprintf(key,"%d",j);
-      TRYFAIL(xbt_dict_get(head,key,&data));
+      data = xbt_dict_get(head,key);
       if (strcmp(key,(char*)data)) {
        printf("key=%s != data=%s\n",key,(char*)data);
        abort();
@@ -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);