Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
adapt to the new syntax of socket_close
[simgrid.git] / testsuite / gras / datadesc_usage.c
index f09b5d9..45884e8 100644 (file)
@@ -33,7 +33,7 @@ write_read(gras_datadesc_type_t *type,void *src, void *dst,
   if (direction == WRITE || direction == RW)
     TRY(gras_datadesc_send(sock, type, src));
   if (direction == RW) 
   if (direction == WRITE || direction == RW)
     TRY(gras_datadesc_send(sock, type, src));
   if (direction == RW) 
-    gras_socket_close(&sock);
+    gras_socket_close(sock);
    
   /* read */
   if (direction == RW) 
    
   /* read */
   if (direction == RW) 
@@ -43,7 +43,7 @@ write_read(gras_datadesc_type_t *type,void *src, void *dst,
     TRY(gras_datadesc_recv(sock, type, gras_arch_selfid(), dst));
 
   if (direction == RW) 
     TRY(gras_datadesc_recv(sock, type, gras_arch_selfid(), dst));
 
   if (direction == RW) 
-    gras_socket_close(&sock);
+    gras_socket_close(sock);
   
   return no_error;
 }
   
   return no_error;
 }
@@ -136,20 +136,14 @@ gras_error_t test_intref(gras_socket_t *sock, int direction) {
  ***/ 
 gras_error_t test_string(gras_socket_t *sock, int direction) {
   gras_error_t errcode;
  ***/ 
 gras_error_t test_string(gras_socket_t *sock, int direction) {
   gras_error_t errcode;
-  gras_datadesc_type_t *my_type;
   char *i=strdup("Some data"), *j=NULL;
   int cpt;
   
   char *i=strdup("Some data"), *j=NULL;
   int cpt;
   
-  INFO0("==== Test on string (dynamic array) ====");
-  TRY(gras_datadesc_declare_ref("string*",
-                               gras_datadesc_by_name("string"),
-                               &my_type));
-
-  TRY(write_read(gras_datadesc_by_name("string*"), &i,&j,
+  INFO0("==== Test on string (ref to dynamic array) ====");
+  TRY(write_read(gras_datadesc_by_name("string"), &i,&j,
                 sock,direction));
   if (direction == READ || direction == RW) {
     for (cpt=0; cpt<strlen(i); cpt++) {
                 sock,direction));
   if (direction == READ || direction == RW) {
     for (cpt=0; cpt<strlen(i); cpt++) {
-      fprintf(stderr,"%d ", cpt);
       gras_assert4(i[cpt] == j[cpt],"i[%d]=%c  !=  j[%d]=%c",
                   cpt,i[cpt],cpt,j[cpt]);
     } 
       gras_assert4(i[cpt] == j[cpt],"i[%d]=%c  !=  j[%d]=%c",
                   cpt,i[cpt],cpt,j[cpt]);
     } 
@@ -440,12 +434,12 @@ int main(int argc,char *argv[]) {
     TRYFAIL(gras_socket_client_from_file("datadesc_usage.out",&sock));
   if (direction == READ) 
     TRYFAIL(gras_socket_server_from_file("datadesc_usage.out",&sock));
     TRYFAIL(gras_socket_client_from_file("datadesc_usage.out",&sock));
   if (direction == READ) 
     TRYFAIL(gras_socket_server_from_file("datadesc_usage.out",&sock));
-
+  
   TRYFAIL(test_int(sock,direction));    
   TRYFAIL(test_float(sock,direction));  
   TRYFAIL(test_array(sock,direction));  
   TRYFAIL(test_intref(sock,direction)); 
   TRYFAIL(test_int(sock,direction));    
   TRYFAIL(test_float(sock,direction));  
   TRYFAIL(test_array(sock,direction));  
   TRYFAIL(test_intref(sock,direction)); 
-
+  
   TRYFAIL(test_string(sock,direction)); 
 
   TRYFAIL(test_homostruct(sock,direction));
   TRYFAIL(test_string(sock,direction)); 
 
   TRYFAIL(test_homostruct(sock,direction));
@@ -457,7 +451,7 @@ int main(int argc,char *argv[]) {
   TRYFAIL(test_graph(sock,direction));
 
   if (direction != RW) 
   TRYFAIL(test_graph(sock,direction));
 
   if (direction != RW) 
-    gras_socket_close(&sock);
+    gras_socket_close(sock);
   gras_exit();
   return 0;
 }
   gras_exit();
   return 0;
 }