Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Compile pas avec les warnings, sinon
[simgrid.git] / testsuite / xbt / multidict_crash.c
index c1bcac8..0663563 100644 (file)
@@ -2,16 +2,14 @@
 
 /* multidict_crash - A crash test for multi-level dictionnaries             */
 
-/* Authors: Martin Quinson                                                  */
-/* Copyright (C) 2003 the OURAGAN project.                                  */
+/* 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. */
* under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include <stdio.h>
-#include <assert.h>
 
-#include <gras.h>
+#include "gras.h"
 
 #define NB_ELM 10/*00*/
 #define MULTICACHE_DEPTH 5
 #define NB_TEST 20
 int verbose=0;
 
-static gras_error_t test1();
+static xbt_error_t test1();
 
-static gras_error_t test1() {
-  gras_error_t errcode;
-  gras_dict_t *head=NULL;
+static xbt_error_t test1() {
+  xbt_error_t errcode;
+  xbt_dict_t *head=NULL;
   int i,j,k,l;
   char **key = NULL;
   char **val = NULL;
@@ -54,10 +52,10 @@ static gras_error_t test1() {
        key[l]=val[l];/*  NOWADAYS, no need to strdup the key. */
       }
       if (verbose) printf("in multitree %p.\n",head);
-      TRYFAIL(gras_multidict_set(&head,MULTICACHE_DEPTH,key,
+      TRYFAIL(xbt_multidict_set(&head,MULTICACHE_DEPTH,key,
                                 strdup(val[0]),&free));
 
-      TRYFAIL(gras_multidict_get(head,
+      TRYFAIL(xbt_multidict_get(head,
                                 MULTICACHE_DEPTH,(const char **)val,
                                 &data));
       if (!data || strcmp((char*)data,val[0])) {
@@ -66,8 +64,8 @@ static gras_error_t test1() {
        abort();
       }
     }
-    gras_dict_dump(head,&gras_dict_print);
-    gras_dict_free(&head);
+    xbt_dict_dump(head,&xbt_dict_print);
+    xbt_dict_free(&head);
 
     for (l=0 ; l<MULTICACHE_DEPTH ; l++)
       if (val[l]) free(val[l]);
@@ -81,11 +79,11 @@ static gras_error_t test1() {
 }
 
 int main(int argc, char *argv[]) {
-  gras_error_t errcode;
+  xbt_error_t errcode;
 
-  gras_init(argc,argv,"root.thresh=debug"));
+  xbt_init(argc,argv,"root.thresh=debug"));
   TRYFAIL(test1());
    
-  gras_exit();
+  xbt_exit();
   return 0;
 }