Valgrind suppression for OS X 10.9
[alexxy/gromacs.git] / src / contrib / test_fatal.c
1 #include "gmx_fatal.h"
2
3 void my_func(char *msg)
4 {
5   fprintf(stderr,"Welcome to my_func\n%s\n",msg);
6   exit(1);
7 }
8
9 int main(int argc,char *argv[])
10 {
11   int n = -3;
12   int choice;
13   char *end;
14   
15   /* set_gmx_error_handler(my_func);*/
16   
17   if (argc <= 1)
18     gmx_fatal(FARGS,"Expected an integer argument to %s",argv[0]);
19   choice = strtol(argv[1], &end, 10); 
20   if (end!='\0')
21     gmx_fatal(FARGS,"Expected an integer argument to %s",argv[0]);
22   
23   
24   switch (choice) {
25   case 1:
26     gmx_error("pme","oooo");
27     break;
28   case 2:
29     gmx_fatal(FARGS,"Passing string %s to you %f  %d %x","lll",8.3,34,34);
30     break;
31   case 3:
32     range_check(n,1,5);
33     break;
34   default:
35     range_check(choice,1,3);
36   }
37   return 0;
38 }