A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
continue the move gras->sg
[simgrid.git]
/
testsuite
/
xbt
/
multidict_crash.c
diff --git
a/testsuite/xbt/multidict_crash.c
b/testsuite/xbt/multidict_crash.c
index
5aec582
..
0663563
100644
(file)
--- 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 */
/* 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
/* 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 <stdio.h>
-#include <assert.h>
-#include
<gras.h>
+#include
"gras.h"
#define NB_ELM 10/*00*/
#define MULTICACHE_DEPTH 5
#define NB_ELM 10/*00*/
#define MULTICACHE_DEPTH 5
@@
-19,11
+17,11
@@
#define NB_TEST 20
int verbose=0;
#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;
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]);
}
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);
}
if (verbose) printf("in multitree %p.\n",head);
- TRYFAIL(
gras_multidict_inser
t(&head,MULTICACHE_DEPTH,key,
-
strdup(val[0]),&free));
+ TRYFAIL(
xbt_multidict_se
t(&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();
}
}
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<MULTICACHE_DEPTH ; l++)
if (val[l]) free(val[l]);
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[]) {
}
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());
TRYFAIL(test1());
-
gras
_exit();
+
xbt
_exit();
return 0;
}
return 0;
}