Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Reduce the size of partial shared malloc tests.
[simgrid.git] / teshsuite / smpi / mpich3-test / datatype / struct-no-real-types.c
index a1bded0..a0e21cb 100644 (file)
@@ -12,7 +12,7 @@
 #include <string.h>
 #endif
 
-/* 
+/*
    The default behavior of the test routines should be to briefly indicate
    the cause of any errors - in this test, that means that verbose needs
    to be set. Verbose should turn on output that is independent of error
@@ -34,16 +34,16 @@ int main(int argc, char **argv)
     parse_args(argc, argv);
 
     /* To improve reporting of problems about operations, we
-       change the error handler to errors return */
-    MPI_Comm_set_errhandler( MPI_COMM_WORLD, MPI_ERRORS_RETURN );
+     * change the error handler to errors return */
+    MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
 
     /* perform some tests */
     err = no_real_types_test();
-    if (err && verbose) fprintf(stderr, "%d errors in blockindexed test.\n",
-                               err);
+    if (err && verbose)
+        fprintf(stderr, "%d errors in blockindexed test.\n", err);
     errs += err;
 
-    MTest_Finalize( errs );
+    MTest_Finalize(errs);
     MPI_Finalize();
     return 0;
 }
@@ -67,60 +67,51 @@ int no_real_types_test(void)
     int size;
     MPI_Aint extent;
 
-    err = MPI_Type_create_struct(count,
-                                &len,
-                                &disp,
-                                &type,
-                                &newtype);
+    err = MPI_Type_create_struct(count, &len, &disp, &type, &newtype);
     if (err != MPI_SUCCESS) {
-       if (verbose) {
-           fprintf(stderr,
-                   "error creating struct type no_real_types_test()\n");
-       }
-       MTestPrintError( err );
-       errs++;
+        if (verbose) {
+            fprintf(stderr, "error creating struct type no_real_types_test()\n");
+        }
+        MTestPrintError(err);
+        errs++;
     }
 
     err = MPI_Type_size(newtype, &size);
     if (err != MPI_SUCCESS) {
-       if (verbose) {
-           fprintf(stderr,
-                   "error obtaining type size in no_real_types_test()\n");
-       }
-       MTestPrintError( err );
-       errs++;
+        if (verbose) {
+            fprintf(stderr, "error obtaining type size in no_real_types_test()\n");
+        }
+        MTestPrintError(err);
+        errs++;
     }
-    
+
     if (size != 0) {
-       if (verbose) {
-           fprintf(stderr,
-                   "error: size != 0 in no_real_types_test()\n");
-       }
-       errs++;
-    }    
+        if (verbose) {
+            fprintf(stderr, "error: size != 0 in no_real_types_test()\n");
+        }
+        errs++;
+    }
 
     err = MPI_Type_extent(newtype, &extent);
     if (err != MPI_SUCCESS) {
-       if (verbose) {
-           fprintf(stderr,
-                   "error obtaining type extent in no_real_types_test()\n");
-       }
-       MTestPrintError( err );
-       errs++;
+        if (verbose) {
+            fprintf(stderr, "error obtaining type extent in no_real_types_test()\n");
+        }
+        MTestPrintError(err);
+        errs++;
     }
-    
+
     if (extent != -10) {
-       if (verbose) {
-           fprintf(stderr,
-                   "error: extent is %ld but should be -10 in no_real_types_test()\n", 
-                   (long) extent );
-           fprintf( stderr, 
-            "type map is { (LB,10) }, so UB is 0 and extent is ub-lb\n" );
-       }
-       errs++;
-    }    
-
-    MPI_Type_free( &newtype );
+        if (verbose) {
+            fprintf(stderr,
+                    "error: extent is %ld but should be -10 in no_real_types_test()\n",
+                    (long) extent);
+            fprintf(stderr, "type map is { (LB,10) }, so UB is 0 and extent is ub-lb\n");
+        }
+        errs++;
+    }
+
+    MPI_Type_free(&newtype);
 
     return errs;
 }
@@ -129,19 +120,18 @@ int no_real_types_test(void)
 int parse_args(int argc, char **argv)
 {
     /*
-    int ret;
-
-    while ((ret = getopt(argc, argv, "v")) >= 0)
-    {
-       switch (ret) {
-           case 'v':
-               verbose = 1;
-               break;
-       }
-    }
-    */
+     * int ret;
+     *
+     * while ((ret = getopt(argc, argv, "v")) >= 0)
+     * {
+     * switch (ret) {
+     * case 'v':
+     * verbose = 1;
+     * break;
+     * }
+     * }
+     */
     if (argc > 1 && strcmp(argv[1], "-v") == 0)
-       verbose = 1;
+        verbose = 1;
     return 0;
 }
-