tests: Add surface checks
Introduce helper routines for testing surfaces against specific
conditions. These allow tests to validate screen captures as displaying
the correct rendering results.
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
diff --git a/tests/weston-test-client-helper.h b/tests/weston-test-client-helper.h
index 43a5aa7..2564044 100644
--- a/tests/weston-test-client-helper.h
+++ b/tests/weston-test-client-helper.h
@@ -27,6 +27,7 @@
#include <assert.h>
#include <stdbool.h>
+
#include "weston-test-runner.h"
#include "weston-test-client-protocol.h"
@@ -132,6 +133,13 @@
void *data;
};
+struct rectangle {
+ int x;
+ int y;
+ int width;
+ int height;
+};
+
void *
fail_on_null(void *p);
@@ -190,4 +198,10 @@
char*
screenshot_reference_filename(const char *basename, uint32_t seq);
+bool
+check_surfaces_equal(const struct surface *a, const struct surface *b);
+
+bool
+check_surfaces_match_in_clip(const struct surface *a, const struct surface *b, const struct rectangle *clip);
+
#endif