summaryrefslogtreecommitdiff
path: root/test/cairo-test.h
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2007-03-02 11:31:13 -0800
committerCarl Worth <cworth@cworth.org>2007-03-02 11:31:13 -0800
commitb52dda62fea0745cc28d6149dc4688ade524b4df (patch)
treee39fea2b93b977ad0b232b8cda4f732c3d972764 /test/cairo-test.h
parent7d6e21c7e298e1795f36fdf021d61ef4ed0ca0fa (diff)
Augment cairo_test_init with cairo_test_fini to avoid leak
Without this, any tests that were using cairo_test_init rather than cairo_test would end up leaking a FILE* for the log file. So this keeps valgrind much more happy with the test suite.
Diffstat (limited to 'test/cairo-test.h')
-rwxr-xr-xtest/cairo-test.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/test/cairo-test.h b/test/cairo-test.h
index a2d0285b..d3612ba4 100755
--- a/test/cairo-test.h
+++ b/test/cairo-test.h
@@ -101,17 +101,21 @@ typedef struct _cairo_test {
cairo_test_status_t
cairo_test (cairo_test_t *test);
-/* cairo_test_init() and cairo_test_log() exist to help in writing
- * tests for which cairo_test() is not appropriate for one reason or
- * another. For example, some tests might not be doing any drawing at
- * all, or may need to create their own cairo_t rather than be handed
- * one by cairo_test.
+/* cairo_test_init(), cairo_test_log(), and cairo_test_fini() exist to
+ * help in writing tests for which cairo_test() is not appropriate for
+ * one reason or another. For example, some tests might not be doing
+ * any drawing at all, or may need to create their own cairo_t rather
+ * than be handed one by cairo_test.
*/
/* Initialize test-specific resources, (log files, etc.) */
void
cairo_test_init (const char *test_name);
+/* Finalize test-specific resource. */
+void
+cairo_test_fini (void);
+
/* Print a message to the log file, ala printf. */
void
cairo_test_log (const char *fmt, ...) CAIRO_PRINTF_FORMAT(1, 2);