- gras_socket_t sock=NULL;
- int direction =WRITE ; /* RW; */
- int cpt;
- char r_arch_char = gras_arch_selfid();
-
- gras_init(&argc,argv);
-
- for (cpt=1; cpt<argc; cpt++)
- {
- if (!strcmp(argv[cpt], "--read"))
- {
- direction = READ;
- }
- else if (!strcmp(argv[cpt], "--write"))
- {
- direction = WRITE;
- }
- else if (!strcmp(argv[cpt], "--copy"))
- {
- direction = COPY;
- }
- else
- {
- filename=argv[cpt];
- }
- }
-
- if (direction == WRITE)
- {
- sock = gras_socket_client_from_file(filename);
- gras_datadesc_send(sock, gras_datadesc_by_name("char"),&r_arch_char);
- }
- if (direction == READ)
- {
- sock = gras_socket_server_from_file(filename);
- gras_datadesc_recv(sock, gras_datadesc_by_name("char"),gras_arch_selfid(), &r_arch_char);
- INFO3("This datafile was generated on %s (%d), I'm %s.",gras_datadesc_arch_name(r_arch_char),(int)r_arch_char,gras_datadesc_arch_name(gras_arch_selfid()));
- }
- r_arch = (int)r_arch_char;
-
- test_int(sock,direction);
-
- test_float(sock,direction);
-
- test_double(sock,direction);
-
- test_array(sock,direction);
-
- test_intref(sock,direction);
-
- test_string(sock,direction);
-
- test_dynar_scal(sock,direction);
-
- test_structures(sock,direction);
-
- test_homostruct(sock,direction);
-
- test_hetestruct(sock,direction);
-
- test_nestedstruct(sock,direction);
-
- declare_chained_list_type();
-
- test_chain_list(sock,direction);
-
- test_graph(sock,direction);
-
- test_dynar_ref(sock,direction);
-
- test_pbio(sock,direction);
-
- test_clause(sock,direction);
-
- if (direction != RW && direction != COPY)
- gras_socket_close(sock);
-
- gras_exit();
-
- return 0;
-}
+ gras_socket_t sock = NULL;
+ int direction = WRITE; /* RW; */
+ int cpt;
+ char r_arch_char = gras_arch_selfid();
+
+ gras_init(&argc, argv);
+
+ for (cpt = 1; cpt < argc; cpt++) {
+ if (!strcmp(argv[cpt], "--read")) {
+ direction = READ;
+ } else if (!strcmp(argv[cpt], "--write")) {
+ direction = WRITE;
+ } else if (!strcmp(argv[cpt], "--copy")) {
+ direction = COPY;
+ } else {
+ filename = argv[cpt];
+ }
+ }
+
+ if (direction == WRITE) {
+ sock = gras_socket_client_from_file(filename);
+ gras_datadesc_send(sock, gras_datadesc_by_name("char"), &r_arch_char);
+ }
+ if (direction == READ) {
+ sock = gras_socket_server_from_file(filename);
+ gras_datadesc_recv(sock, gras_datadesc_by_name("char"),
+ gras_arch_selfid(), &r_arch_char);
+ INFO3("This datafile was generated on %s (%d), I'm %s.",
+ gras_datadesc_arch_name(r_arch_char), (int) r_arch_char,
+ gras_datadesc_arch_name(gras_arch_selfid()));
+ }
+ r_arch = (int) r_arch_char;
+
+ test_int(sock, direction);
+
+ test_float(sock, direction);
+
+ test_double(sock, direction);
+
+ test_array(sock, direction);
+
+ test_intref(sock, direction);