test: add an alloc test with 3 layers

This commit is contained in:
Simon Ser 2019-09-13 22:35:23 +03:00
parent 060023c6f1
commit de8175c998
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
2 changed files with 30 additions and 6 deletions

View file

@ -23,8 +23,9 @@ test_alloc_exe = executable(
alloc_tests = [ alloc_tests = [
'basic', 'basic',
'primary-nomatch', 'simple-1x',
'primary-match', 'simple-1x-fail',
'simple-3x',
] ]
foreach name : alloc_tests foreach name : alloc_tests

View file

@ -43,16 +43,16 @@ struct test_case {
static struct test_plane test_setup[] = { static struct test_plane test_setup[] = {
{ .type = DRM_PLANE_TYPE_PRIMARY }, { .type = DRM_PLANE_TYPE_PRIMARY },
{ .type = DRM_PLANE_TYPE_OVERLAY },
{ .type = DRM_PLANE_TYPE_OVERLAY },
{ .type = DRM_PLANE_TYPE_CURSOR }, { .type = DRM_PLANE_TYPE_CURSOR },
{ .type = DRM_PLANE_TYPE_OVERLAY },
{ .type = DRM_PLANE_TYPE_OVERLAY },
}; };
static const size_t test_setup_len = sizeof(test_setup) / sizeof(test_setup[0]); static const size_t test_setup_len = sizeof(test_setup) / sizeof(test_setup[0]);
static struct test_case tests[] = { static struct test_case tests[] = {
{ {
.name = "primary-nomatch", .name = "simple-1x-fail",
.layers = { .layers = {
{ {
.width = 1920, .width = 1920,
@ -63,7 +63,7 @@ static struct test_case tests[] = {
}, },
}, },
{ {
.name = "primary-match", .name = "simple-1x",
.layers = { .layers = {
{ {
.width = 1920, .width = 1920,
@ -73,6 +73,29 @@ static struct test_case tests[] = {
}, },
}, },
}, },
{
.name = "simple-3x",
.layers = {
{
.width = 1920,
.height = 1080,
.compat = { &test_setup[0] },
.result = &test_setup[0],
},
{
.width = 100,
.height = 100,
.compat = { &test_setup[1] },
.result = &test_setup[1],
},
{
.width = 100,
.height = 100,
.compat = { &test_setup[2] },
.result = &test_setup[2],
},
},
},
}; };
static void run_test(struct test_layer *test_layers) static void run_test(struct test_layer *test_layers)