summaryrefslogtreecommitdiff
path: root/test/api-special-cases.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2010-07-06 00:20:36 +0200
committerBenjamin Otte <otte@redhat.com>2010-07-06 00:20:36 +0200
commitfa070704966f10e7264778a3ffb401054a68e8f7 (patch)
tree1b6a4c370cab44f97375ac822a2a0a7b97b24180 /test/api-special-cases.c
parentc4068fe9414bad663f77c030ac96fa4b4cba87ba (diff)
downloadcairo-fa070704966f10e7264778a3ffb401054a68e8f7.tar.gz
test: Add xcb and xlib functions to api-special-cases test
Diffstat (limited to 'test/api-special-cases.c')
-rw-r--r--test/api-special-cases.c91
1 files changed, 91 insertions, 0 deletions
diff --git a/test/api-special-cases.c b/test/api-special-cases.c
index 85dc9a4b6..d5f619892 100644
--- a/test/api-special-cases.c
+++ b/test/api-special-cases.c
@@ -494,6 +494,83 @@ test_cairo_svg_surface_restrict_to_version (cairo_surface_t *surface)
#endif /* CAIRO_HAS_SVG_SURFACE */
+#if CAIRO_HAS_XCB_SURFACE
+
+static cairo_test_status_t
+test_cairo_xcb_surface_set_size (cairo_surface_t *surface)
+{
+ cairo_xcb_surface_set_size (surface, 5, 5);
+ return CAIRO_TEST_SUCCESS;
+}
+
+#endif
+
+#if CAIRO_HAS_XLIB_SURFACE
+
+static cairo_test_status_t
+test_cairo_xlib_surface_set_size (cairo_surface_t *surface)
+{
+ cairo_xlib_surface_set_size (surface, 5, 5);
+ return CAIRO_TEST_SUCCESS;
+}
+
+static cairo_test_status_t
+test_cairo_xlib_surface_set_drawable (cairo_surface_t *surface)
+{
+ cairo_xlib_surface_set_drawable (surface, 0, 5, 5);
+ return CAIRO_TEST_SUCCESS;
+}
+
+static cairo_test_status_t
+test_cairo_xlib_surface_get_display (cairo_surface_t *surface)
+{
+ Display *display = cairo_xlib_surface_get_display (surface);
+ return display == NULL || surface_has_type (surface, CAIRO_SURFACE_TYPE_XLIB) ? CAIRO_TEST_SUCCESS : CAIRO_TEST_ERROR;
+}
+
+static cairo_test_status_t
+test_cairo_xlib_surface_get_screen (cairo_surface_t *surface)
+{
+ Screen *screen = cairo_xlib_surface_get_screen (surface);
+ return screen == NULL || surface_has_type (surface, CAIRO_SURFACE_TYPE_XLIB) ? CAIRO_TEST_SUCCESS : CAIRO_TEST_ERROR;
+}
+
+static cairo_test_status_t
+test_cairo_xlib_surface_get_visual (cairo_surface_t *surface)
+{
+ Visual *visual = cairo_xlib_surface_get_visual (surface);
+ return visual == NULL || surface_has_type (surface, CAIRO_SURFACE_TYPE_XLIB) ? CAIRO_TEST_SUCCESS : CAIRO_TEST_ERROR;
+}
+
+static cairo_test_status_t
+test_cairo_xlib_surface_get_drawable (cairo_surface_t *surface)
+{
+ Drawable drawable = cairo_xlib_surface_get_drawable (surface);
+ return drawable == 0 || surface_has_type (surface, CAIRO_SURFACE_TYPE_XLIB) ? CAIRO_TEST_SUCCESS : CAIRO_TEST_ERROR;
+}
+
+static cairo_test_status_t
+test_cairo_xlib_surface_get_depth (cairo_surface_t *surface)
+{
+ int depth = cairo_xlib_surface_get_depth (surface);
+ return depth == 0 || surface_has_type (surface, CAIRO_SURFACE_TYPE_XLIB) ? CAIRO_TEST_SUCCESS : CAIRO_TEST_ERROR;
+}
+
+static cairo_test_status_t
+test_cairo_xlib_surface_get_width (cairo_surface_t *surface)
+{
+ int width = cairo_xlib_surface_get_width (surface);
+ return width == 0 || surface_has_type (surface, CAIRO_SURFACE_TYPE_XLIB) ? CAIRO_TEST_SUCCESS : CAIRO_TEST_ERROR;
+}
+
+static cairo_test_status_t
+test_cairo_xlib_surface_get_height (cairo_surface_t *surface)
+{
+ int height = cairo_xlib_surface_get_height (surface);
+ return height == 0 || surface_has_type (surface, CAIRO_SURFACE_TYPE_XLIB) ? CAIRO_TEST_SUCCESS : CAIRO_TEST_ERROR;
+}
+
+#endif
#define TEST(name, surface_type, sets_status) { #name, test_ ## name, surface_type, sets_status }
@@ -562,6 +639,20 @@ struct {
#if CAIRO_HAS_SVG_SURFACE
TEST (cairo_svg_surface_restrict_to_version, CAIRO_SURFACE_TYPE_SVG, TRUE),
#endif
+#if CAIRO_HAS_XCB_SURFACE
+ TEST (cairo_xcb_surface_set_size, CAIRO_SURFACE_TYPE_XCB, TRUE),
+#endif
+#if CAIRO_HAS_XLIB_SURFACE
+ TEST (cairo_xlib_surface_set_size, CAIRO_SURFACE_TYPE_XLIB, TRUE),
+ TEST (cairo_xlib_surface_set_drawable, CAIRO_SURFACE_TYPE_XLIB, TRUE),
+ TEST (cairo_xlib_surface_get_display, CAIRO_SURFACE_TYPE_XLIB, FALSE),
+ TEST (cairo_xlib_surface_get_drawable, CAIRO_SURFACE_TYPE_XLIB, FALSE),
+ TEST (cairo_xlib_surface_get_screen, CAIRO_SURFACE_TYPE_XLIB, FALSE),
+ TEST (cairo_xlib_surface_get_visual, CAIRO_SURFACE_TYPE_XLIB, FALSE),
+ TEST (cairo_xlib_surface_get_depth, CAIRO_SURFACE_TYPE_XLIB, FALSE),
+ TEST (cairo_xlib_surface_get_width, CAIRO_SURFACE_TYPE_XLIB, FALSE),
+ TEST (cairo_xlib_surface_get_height, CAIRO_SURFACE_TYPE_XLIB, FALSE),
+#endif
};
static cairo_test_status_t