summaryrefslogtreecommitdiff
path: root/qa/src/tabort.c
diff options
context:
space:
mode:
Diffstat (limited to 'qa/src/tabort.c')
-rw-r--r--qa/src/tabort.c31
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);
+}