Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
basic support for automatic testing easing problem support from the users
[simgrid.git] / testsuite / xbt / dynar_string.c
index 6b82126..7fea46b 100644 (file)
@@ -17,13 +17,26 @@ void free_string(void *d){
   free(*(void**)d);
 }
 
+void parse_log_opt(int argc, char **argv,const char *deft);
+
 int main(int argc,char *argv[]) {
    gras_dynar_t *d;
    gras_error_t errcode;
-   int cpt;
+   int cpt,i;
    char buf[1024];
    char *s1,*s2;
    
+   parse_log_opt(argc,argv,"dynar.thresh=debug");
+   
+   fprintf(stderr,"==== Traverse the empty dynar\n");
+   TRYFAIL(gras_dynar_new(&d,sizeof(int),NULL));
+   gras_dynar_foreach(d,cpt,i){
+     fprintf(stderr,
+            "Damnit, there is something in the empty dynar\n");
+     abort();
+   }
+   gras_dynar_free(d);
+
    fprintf(stderr,"==== Push 5000 strings, set them again 3 times, shift them\n");
    TRYFAIL(gras_dynar_new(&d,sizeof(char*),&free_string));
    for (cpt=0; cpt< 5000; cpt++) {