xref: /petsc/src/sys/tests/ex70.c (revision 6dd63270497ad23dcf16ae500a87ff2b2a0b7474)
1 static char help[] = "Error handling for destroying PETSC_VIEWER_STDOUT_SELF.\n";
2 
3 #include <petscsys.h>
4 #include <petscviewer.h>
5 
6 int main(int argc, char **argv)
7 {
8   PetscViewer viewer;
9 
10   PetscFunctionBeginUser;
11   PetscCall(PetscInitialize(&argc, &argv, NULL, help));
12   viewer = PETSC_VIEWER_STDOUT_SELF;
13   PetscCall(PetscViewerDestroy(&viewer));
14   PetscCall(PetscFinalize());
15   return 0;
16 }
17 
18 /*TEST
19 
20    test:
21      requires: !defined(PETSCTEST_VALGRIND) defined(PETSC_USE_DEBUG) !defined(PETSC_HAVE_SANITIZER)
22      args: -petsc_ci_portable_error_output -error_output_stdout
23      filter: grep -E -v "(memory block|leaked context|not freed before MPI_Finalize|Could be the program crashed|PETSc Option Table entries|source: environment)"
24 
25 TEST*/
26