xref: /petsc/src/sys/tests/linter/testTypes.c (revision 4ab547ceb31cf8c1287f5da2fc6aa6a54e2c08bd)
1 #include <petsc/private/petscimpl.h>
2 
testTypes(PetscRandom r,PetscViewer v,PetscObject o,PetscFunctionList f)3 PetscErrorCode testTypes(PetscRandom r, PetscViewer v, PetscObject o, PetscFunctionList f)
4 {
5   /* incorrect */
6   PetscValidType(r, -1);
7   PetscCheckSameType(r, -1, v, -1);
8   PetscCheckSameComm(o, -2, f, -2);
9   PetscCheckSameTypeAndComm(r, -3, f, -3);
10 
11   /* correct */
12   PetscValidType(r, 1);
13   PetscCheckSameType(r, 1, v, 2);
14   PetscCheckSameComm(o, 3, f, 4);
15   PetscCheckSameTypeAndComm(r, 1, f, 4);
16   return 0;
17 }
18