From: mquinson Date: Mon, 27 Jun 2005 22:03:20 +0000 (+0000) Subject: Update now that multidicts are reimplemented X-Git-Tag: v3.3~3932 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/2626ed754c524798c68e3878eadaf6a8d5fad4c2?hp=7f454fb05ec302546cd75ac0dc8f0f3784a17b30 Update now that multidicts are reimplemented git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@1423 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/testsuite/xbt/multidict_crash.c b/testsuite/xbt/multidict_crash.c index 0663563aec..720cbf7aec 100644 --- a/testsuite/xbt/multidict_crash.c +++ b/testsuite/xbt/multidict_crash.c @@ -2,88 +2,83 @@ /* multidict_crash - A crash test for multi-level dictionnaries */ -/* Copyright (c) 2003, 2004 Martin Quinson. All rights reserved. */ +/* Copyright (c) 2003-2005 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 -#include "gras.h" +#include "xbt.h" + +XBT_LOG_NEW_DEFAULT_CATEGORY(Test,"this test"); #define NB_ELM 10/*00*/ -#define MULTICACHE_DEPTH 5 -#define KEY_SIZE 12 /*512*/ +#define DEPTH 5 +#define KEY_SIZE 6 /*512*/ #define NB_TEST 20 -int verbose=0; +int verbose=1; -static xbt_error_t test1(); +static void str_free(void *s) { + char *c=*(char**)s; + free(c); +} -static xbt_error_t test1() { +int main(int argc, char *argv[]) { xbt_error_t errcode; - xbt_dict_t *head=NULL; + xbt_dict_t mdict=xbt_dict_new(); int i,j,k,l; - char **key = NULL; - char **val = NULL; + xbt_dynar_t keys = xbt_dynar_new(sizeof(char*),str_free); void *data; + char *key; + + xbt_init(&argc,argv); printf("\nGeneric multicache: CRASH test:\n"); - printf(" Fill the struct and frees it %d times, using %d elements, depth of multicache=%d\n",NB_TEST,NB_ELM,MULTICACHE_DEPTH); + printf(" Fill the struct and frees it %d times, using %d elements, depth of multicache=%d\n",NB_TEST,NB_ELM,DEPTH); printf(" with %d chars long randomized keys. (a point is a test)\n",KEY_SIZE); for (i=0;i