1 static char help[] = "Tests PetscStack.\n\n"; 2 3 #include <petscsys.h> 4 5 #if !defined(PETSCSTACKSIZE) 6 #define PETSCSTACKSIZE 64 7 #endif 8 9 PetscErrorCode correct() 10 { 11 PetscFunctionBegin; 12 PetscFunctionReturn(PETSC_SUCCESS); 13 } 14 15 PetscErrorCode correctu() 16 { 17 PetscFunctionBeginUser; 18 PetscFunctionReturn(PETSC_SUCCESS); 19 } 20 21 PetscErrorCode foo() 22 { 23 PetscFunctionReturn(PETSC_SUCCESS); 24 } 25 26 PetscErrorCode bar() 27 { 28 PetscFunctionBegin; 29 return PETSC_SUCCESS; 30 } 31 32 PetscErrorCode baru() 33 { 34 PetscFunctionBeginUser; 35 return PETSC_SUCCESS; 36 } 37 38 int main(int argc, char **argv) 39 { 40 PetscFunctionBeginUser; 41 PetscCall(PetscInitialize(&argc, &argv, (char *)0, help)); 42 for (PetscInt i = 0; i < PETSCSTACKSIZE + 1; i++) PetscCall(correct()); 43 for (PetscInt i = 0; i < PETSCSTACKSIZE + 1; i++) PetscCall(foo()); 44 for (PetscInt i = 0; i < PETSCSTACKSIZE + 1; i++) PetscCall(bar()); 45 for (PetscInt i = 0; i < PETSCSTACKSIZE + 1; i++) PetscCall(foo()); 46 for (PetscInt i = 0; i < PETSCSTACKSIZE + 1; i++) PetscCall(baru()); 47 for (PetscInt i = 0; i < PETSCSTACKSIZE + 1; i++) PetscCall(foo()); 48 PetscCall(PetscFinalize()); 49 return 0; 50 } 51 52 /*TEST 53 54 test: 55 TODO: Since this now errors out the test harness can chock on the output 56 57 TEST*/ 58