summaryrefslogtreecommitdiff
path: root/test/xlib-surface.c
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2005-05-14 13:51:59 +0000
committerCarl Worth <cworth@cworth.org>2005-05-14 13:51:59 +0000
commit6a1af1999dfb79f05341ea6c4bf0e23795db01bc (patch)
tree286f0cb3b543f468ddb4de4af6b56778455575e1 /test/xlib-surface.c
parent53e6fdb8855ad7bc54ec40ebf6609cccb6eac54c (diff)
Cleanup output a bit, move verbose messages to test-specific log file.
Diffstat (limited to 'test/xlib-surface.c')
-rw-r--r--test/xlib-surface.c31
1 files changed, 18 insertions, 13 deletions
diff --git a/test/xlib-surface.c b/test/xlib-surface.c
index 75b65713..47cc0538 100644
--- a/test/xlib-surface.c
+++ b/test/xlib-surface.c
@@ -33,9 +33,9 @@
#define SIZE 100
#define OFFSCREEN_OFFSET 50
-#define VERBOSE 0
cairo_bool_t result = 0;
+FILE *log_file = NULL;
static void
draw_pattern (cairo_surface_t *surface)
@@ -166,16 +166,14 @@ do_test (Display *dpy,
4 * SIZE);
}
- if (VERBOSE || !result) {
- fprintf (stderr, "xlib-surface: %s, %s, %s%s: %s\n",
- use_render ? " render" : "no-render",
- set_size ? " size" : "no-size",
- use_pixmap ? "pixmap" : "window",
- use_pixmap ?
- " " :
- (offscreen ? ", offscreen" : ", onscreen"),
- result ? "PASS" : "FAIL");
- }
+ fprintf (log_file, "xlib-surface: %s, %s, %s%s: %s\n",
+ use_render ? " render" : "no-render",
+ set_size ? " size" : "no-size",
+ use_pixmap ? "pixmap" : "window",
+ use_pixmap ?
+ " " :
+ (offscreen ? ", offscreen" : ", onscreen"),
+ result ? "PASS" : "FAIL");
return result;
}
@@ -209,14 +207,21 @@ main (void)
cairo_bool_t offscreen;
result = 0;
+ printf("\n");
+ log_file = fopen ("xlib-surface.log", "w");
+ if (log_file == NULL) {
+ fprintf (stderr, "Error opening log file: %s\n", "xlib-surface.log");
+ log_file = stderr;
+ }
+
dpy = XOpenDisplay (NULL);
if (!dpy) {
- fprintf (stderr, "xlib-surface: Cannot open display, skipping\n");
+ fprintf (log_file, "xlib-surface: Cannot open display, skipping\n");
return 0;
}
if (!check_visual (dpy)) {
- fprintf (stderr, "xlib-surface: default visual is not RGB24 or BGR24, skipping\n");
+ fprintf (log_file, "xlib-surface: default visual is not RGB24 or BGR24, skipping\n");
return 0;
}