summaryrefslogtreecommitdiff
path: root/tests/common/test_contracts.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/common/test_contracts.c')
-rw-r--r--tests/common/test_contracts.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/common/test_contracts.c b/tests/common/test_contracts.c
index ac0065c..ee6fe61 100644
--- a/tests/common/test_contracts.c
+++ b/tests/common/test_contracts.c
@@ -25,6 +25,14 @@ static void test_timing_clock(void)
assert(stats.max_us == 500.0);
}
+static void test_surface_state(void)
+{
+ /* Reading reported flags does not require a backend query or display. */
+ struct yasl_surface surface = {.state = YASL_STATE_FULLSCREEN | YASL_STATE_ACTIVATED};
+ assert(!yasl_surface_state(NULL));
+ assert(yasl_surface_state(&surface) == (YASL_STATE_FULLSCREEN | YASL_STATE_ACTIVATED));
+}
+
static void test_queue(void)
{
struct input_queue q = {0};
@@ -326,6 +334,7 @@ static void test_errors(void)
int main(void)
{
test_timing_clock();
+ test_surface_state();
test_queue();
test_validation();
test_native();