1 #ifndef _CAIRO_COMMON_H_
2 #define _CAIRO_COMMON_H_
4 //#include "cairo-boilerplate.h"
10 #define MIN(a, b) ((a) < (b) ? (a) : (b))
11 #define MAX(a, b) ((a) > (b) ? (a) : (b))
12 #define ARRAY_LENGTH(__array) ((int) (sizeof (__array) / sizeof (__array[0])))
14 #define CAIRO_TEST_OUTPUT_DIR "output"
15 #define CAIRO_TEST_LOG_SUFFIX ".log"
16 #define CAIRO_TEST_FONT_FAMILY "DejaVu"
18 /* What is a fail and what isn't?
19 * When running the test suite we want to detect unexpected output. This
20 * can be caused by a change we have made to cairo itself, or a change
21 * in our environment. To capture this we classify the expected output into 3
24 * REF -- Perfect output.
25 * Might be different for each backend, due to slight implementation
28 * NEW -- A new failure. We have uncovered a bug within cairo and have
29 * recorded the current failure (along with the expected output
30 * if possible!) so we can detect any changes in our attempt to
33 * XFAIL -- An external failure. We believe the cairo output is perfect,
34 * but an external renderer is causing gross failure.
35 * (We also use this to capture current WONTFIX issues within cairo,
36 * such as overflow in internal coordinates, so as not to distract
37 * us when regression testing.)
39 * If no REF is given for a test, then it is assumed to be XFAIL.
41 #define CAIRO_TEST_REF_SUFFIX ".ref"
42 #define CAIRO_TEST_XFAIL_SUFFIX ".xfail"
43 #define CAIRO_TEST_NEW_SUFFIX ".new"
45 #define CAIRO_TEST_OUT_SUFFIX ".out"
46 #define CAIRO_TEST_DIFF_SUFFIX ".diff"
48 #define CAIRO_TEST_PNG_EXTENSION ".png"
49 #define CAIRO_TEST_OUT_PNG CAIRO_TEST_OUT_SUFFIX CAIRO_TEST_PNG_EXTENSION
50 #define CAIRO_TEST_REF_PNG CAIRO_TEST_REF_SUFFIX CAIRO_TEST_PNG_EXTENSION
51 #define CAIRO_TEST_DIFF_PNG CAIRO_TEST_DIFF_SUFFIX CAIRO_TEST_PNG_EXTENSION
53 typedef enum cairo_test_status {
54 CAIRO_TEST_SUCCESS = 0,
61 CAIRO_TEST_UNTESTED = 77 /* match automake's skipped exit status */
62 } cairo_test_status_t;
64 #define CAIRO_TEST_DOUBLE_EQUALS(a,b) (fabs((a)-(b)) < 0.00001)