summaryrefslogtreecommitdiff
path: root/test/api-special-cases.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2010-07-05 22:50:18 +0200
committerBenjamin Otte <otte@redhat.com>2010-07-05 22:50:18 +0200
commitb87be76bdfcbd329c79a9f11b24d22010ad15dde (patch)
tree95d7f370927281a2f709b9585f40d40cecdc4508 /test/api-special-cases.c
parent448653e7b9938100c3f2e30e026fbc4d9de7d0d5 (diff)
downloadcairo-b87be76bdfcbd329c79a9f11b24d22010ad15dde.tar.gz
test: Add gl functions to the tests
Diffstat (limited to 'test/api-special-cases.c')
-rw-r--r--test/api-special-cases.c39
1 files changed, 38 insertions, 1 deletions
diff --git a/test/api-special-cases.c b/test/api-special-cases.c
index a72f86ae1..92685c491 100644
--- a/test/api-special-cases.c
+++ b/test/api-special-cases.c
@@ -334,7 +334,7 @@ test_cairo_surface_write_to_png_stream (cairo_surface_t *surface)
return status && status != CAIRO_STATUS_WRITE_ERROR ? CAIRO_TEST_SUCCESS : CAIRO_TEST_ERROR;
}
-#endif
+#endif /* CAIRO_HAS_PNG_FUNCTIONS */
static cairo_test_status_t
test_cairo_recording_surface_ink_extents (cairo_surface_t *surface)
@@ -377,6 +377,37 @@ test_cairo_tee_surface_index (cairo_surface_t *surface)
return status ? CAIRO_TEST_SUCCESS : CAIRO_TEST_ERROR;
}
+#if CAIRO_HAS_GL_SURFACE
+
+static cairo_test_status_t
+test_cairo_gl_surface_set_size (cairo_surface_t *surface)
+{
+ cairo_gl_surface_set_size (surface, 5, 5);
+ return CAIRO_TEST_SUCCESS;
+}
+
+static cairo_test_status_t
+test_cairo_gl_surface_get_width (cairo_surface_t *surface)
+{
+ unsigned int width = cairo_gl_surface_get_width (surface);
+ return width == 0 || surface_has_type (surface, CAIRO_SURFACE_TYPE_GL) ? CAIRO_TEST_SUCCESS : CAIRO_TEST_ERROR;
+}
+
+static cairo_test_status_t
+test_cairo_gl_surface_get_height (cairo_surface_t *surface)
+{
+ unsigned int height = cairo_gl_surface_get_height (surface);
+ return height == 0 || surface_has_type (surface, CAIRO_SURFACE_TYPE_GL) ? CAIRO_TEST_SUCCESS : CAIRO_TEST_ERROR;
+}
+
+static cairo_test_status_t
+test_cairo_gl_surface_swapbuffers (cairo_surface_t *surface)
+{
+ cairo_gl_surface_swapbuffers (surface);
+ return CAIRO_TEST_SUCCESS;
+}
+
+#endif /* CAIRO_HAS_GL_SURFACE */
#define TEST(name, surface_type, sets_status) { #name, test_ ## name, surface_type, sets_status }
@@ -422,6 +453,12 @@ struct {
TEST (cairo_tee_surface_add, CAIRO_SURFACE_TYPE_TEE, TRUE),
TEST (cairo_tee_surface_remove, CAIRO_SURFACE_TYPE_TEE, TRUE),
TEST (cairo_tee_surface_index, CAIRO_SURFACE_TYPE_TEE, FALSE),
+#if CAIRO_HAS_GL_SURFACE
+ TEST (cairo_gl_surface_set_size, CAIRO_SURFACE_TYPE_GL, TRUE),
+ TEST (cairo_gl_surface_get_width, CAIRO_SURFACE_TYPE_GL, FALSE),
+ TEST (cairo_gl_surface_get_height, CAIRO_SURFACE_TYPE_GL, FALSE),
+ TEST (cairo_gl_surface_swapbuffers, CAIRO_SURFACE_TYPE_GL, TRUE),
+#endif
};
static cairo_test_status_t