X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/ff021a73f0cd26b2f27ca729783aa486393f9b3a..6871d60846e21a811a079fb17970f7e09d79a5cd:/testsuite/xbt/multidict_crash.c diff --git a/testsuite/xbt/multidict_crash.c b/testsuite/xbt/multidict_crash.c index 0f7e5f0d11..0663563aec 100644 --- a/testsuite/xbt/multidict_crash.c +++ b/testsuite/xbt/multidict_crash.c @@ -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 -#include -#include +#include "gras.h" #define NB_ELM 10/*00*/ #define MULTICACHE_DEPTH 5 @@ -19,11 +17,11 @@ #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; @@ -51,23 +49,23 @@ static gras_error_t test1() { } val[l][k]='\0'; if (verbose) printf("%s ; ",val[l]); - key[l]=val[l];// NOWADAYS, no need to strdup the key. + key[l]=val[l];/* NOWADAYS, no need to strdup the key. */ } if (verbose) printf("in multitree %p.\n",head); - TRYFAIL(gras_multidict_insert(&head,MULTICACHE_DEPTH,key, - strdup(val[0]),&free)); + TRYFAIL(xbt_multidict_set(&head,MULTICACHE_DEPTH,key, + strdup(val[0]),&free)); - TRYFAIL(gras_multidict_retrieve(head, - MULTICACHE_DEPTH,(const char **)val, - &data)); + TRYFAIL(xbt_multidict_get(head, + MULTICACHE_DEPTH,(const char **)val, + &data)); if (!data || strcmp((char*)data,val[0])) { fprintf(stderr,"Retrieved value (%s) does not match the entrered one (%s)\n", (char*)data,val[0]); 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