2 * Copyright (c) 2011 Ken McDonell. All Rights Reserved.
4 * Exercise fault injection infrastructure.
18 for (i
= 1; i
<= 10; i
++) {
19 __pmFaultInject("QA:1", PM_FAULT_ALLOC
);
22 fprintf(stderr
, "malloc:1[%d] %s\n", i
, strerror(errno
));
25 __pmFaultInject("QA:2", PM_FAULT_ALLOC
);
28 fprintf(stderr
, "malloc:2[%d] %s\n", i
, strerror(errno
));
31 __pmFaultInject("QA:3", PM_FAULT_ALLOC
);
34 fprintf(stderr
, "malloc:3[%d] %s\n", i
, strerror(errno
));
41 main(int argc
, char *argv
[])
46 char *usage
= "[-D debug]";
48 __pmSetProgname(argv
[0]);
50 while ((c
= getopt(argc
, argv
, "D:")) != EOF
) {
53 case 'D': /* debug flag */
54 sts
= __pmParseDebug(optarg
);
56 fprintf(stderr
, "%s: unrecognized debug flag specification (%s)\n",
71 if (errflag
|| optind
!= argc
) {
72 fprintf(stderr
, "Usage: %s %s\n", pmProgname
, usage
);