Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' into CRTP
[simgrid.git] / teshsuite / smpi / mpich3-test / errhan / dynamic_errcode_predefined_errclass.c
1 /*
2  *  (C) 2006 by Argonne National Laboratory.
3  *      See COPYRIGHT in top-level directory.
4  *
5  *  Portions of this code were written by Intel Corporation.
6  *  Copyright (C) 2011-2012 Intel Corporation.  Intel provides this material
7  *  to Argonne National Laboratory subject to Software Grant and Corporate
8  *  Contributor License Agreement dated February 8, 2012.
9  */
10
11 #include <stdio.h>
12 #include <mpi.h>
13 #include "mpitest.h"
14
15 int main(int argc, char **argv)
16 {
17     int errcode, errclass, errs = 0;
18
19     MTest_Init(&argc, &argv);
20
21     MPI_Add_error_code(MPI_ERR_ARG, &errcode);
22     MPI_Error_class(errcode, &errclass);
23
24     if (errclass != MPI_ERR_ARG) {
25         printf("ERROR: Got 0x%d, expected 0x%d\n", errclass, MPI_ERR_ARG);
26         errs++;
27     }
28
29     MTest_Finalize(errs);
30     return MTestReturnValue(errs);
31 }