test/alloc: make test data const

We should never mutate the test data.
This commit is contained in:
Simon Ser 2022-01-31 13:27:17 +01:00
parent 2e1dd93b60
commit 3ced3be25a

View file

@ -74,7 +74,7 @@ static const size_t test_setup_len = sizeof(test_setup) / sizeof(test_setup[0]);
#define FIRST_3_SECONDARY_PLANES { &test_setup[1], &test_setup[2], \ #define FIRST_3_SECONDARY_PLANES { &test_setup[1], &test_setup[2], \
&test_setup[3] } &test_setup[3] }
static struct test_case tests[] = { static const struct test_case tests[] = {
{ {
.name = "empty", .name = "empty",
}, },
@ -646,7 +646,7 @@ static struct test_case tests[] = {
}; };
static bool static bool
test_needs_composition(struct test_layer *test_layers) test_needs_composition(const struct test_layer *test_layers)
{ {
size_t i; size_t i;
@ -660,13 +660,13 @@ test_needs_composition(struct test_layer *test_layers)
} }
static void static void
run_test(struct test_layer *test_layers) run_test(const struct test_layer *test_layers)
{ {
size_t i, j; size_t i, j;
ssize_t plane_index_got, plane_index_want; ssize_t plane_index_got, plane_index_want;
struct liftoff_mock_plane *mock_planes[64]; struct liftoff_mock_plane *mock_planes[64];
struct liftoff_mock_plane *mock_plane; struct liftoff_mock_plane *mock_plane;
struct test_layer *test_layer; const struct test_layer *test_layer;
int drm_fd; int drm_fd;
struct liftoff_device *device; struct liftoff_device *device;
struct liftoff_output *output; struct liftoff_output *output;