diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2014-10-26 12:33:50 +0400 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2014-10-26 12:33:50 +0400 |
commit | 47e6e7c84f008a53061e661f31ae96629bc694ef (patch) | |
tree | 648a07f3b5b9d67ce19b0fd72e8caa1175c98f1a /qa/src/tabort.c | |
download | pcp-debian.tar.gz |
Debian 3.9.10debian/3.9.10debian
Diffstat (limited to 'qa/src/tabort.c')
-rw-r--r-- | qa/src/tabort.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/qa/src/tabort.c b/qa/src/tabort.c new file mode 100644 index 0000000..a99b5e1 --- /dev/null +++ b/qa/src/tabort.c @@ -0,0 +1,31 @@ +#include <pcp/trace.h> +#include <stdio.h> +#include <stdlib.h> + +int +main(int argc, char *argv[]) +{ + int sts; + + if ((sts = pmtracebegin("foo")) < 0) { + fprintf(stderr, "pmtracebegin failed: %s\n", pmtraceerrstr(sts)); + exit(1); + } + + if ((sts = pmtraceabort("foo")) < 0) { + fprintf(stderr, "pmtraceabort failed: %s\n", pmtraceerrstr(sts)); + exit(1); + } + + if ((sts = pmtracebegin("foo")) < 0) { + fprintf(stderr, "pmtraceabort isn't working properly!\n"); + exit(1); + } + + if ((sts = pmtraceend("foo")) < 0) { + fprintf(stderr, "pmtraceend failed: %s\n", pmtraceerrstr(sts)); + exit(1); + } + + exit(0); +} |