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(0); 13 } 14 15 PetscErrorCode correctu() 16 { 17 PetscFunctionBeginUser; 18 PetscFunctionReturn(0); 19 } 20 21 PetscErrorCode foo() 22 { 23 PetscFunctionReturn(0); 24 } 25 26 PetscErrorCode bar() 27 { 28 PetscFunctionBegin; 29 return 0; 30 } 31 32 PetscErrorCode baru() 33 { 34 PetscFunctionBeginUser; 35 return 0; 36 } 37 38 int main(int argc,char **argv) 39 { 40 PetscCall(PetscInitialize(&argc,&argv,(char*)0,help)); 41 for (PetscInt i = 0; i < PETSCSTACKSIZE+1; i++) PetscCall(correct()); 42 for (PetscInt i = 0; i < PETSCSTACKSIZE+1; i++) PetscCall(foo()); 43 for (PetscInt i = 0; i < PETSCSTACKSIZE+1; i++) PetscCall(bar()); 44 for (PetscInt i = 0; i < PETSCSTACKSIZE+1; i++) PetscCall(foo()); 45 for (PetscInt i = 0; i < PETSCSTACKSIZE+1; i++) PetscCall(baru()); 46 for (PetscInt i = 0; i < PETSCSTACKSIZE+1; i++) PetscCall(foo()); 47 PetscCall(PetscFinalize()); 48 return 0; 49 } 50 51 /*TEST 52 53 test: 54 TODO: Since this now errors out the test harness can chock on the output 55 56 TEST*/ 57