Commit 696560d4 authored by José Expósito's avatar José Expósito

drm/format-helper: Rename test cases to make them more generic

The tests available at the moment only check the conversion from
XRGB8888 to RGB332. However, more conversions will be tested in the
future.

In order to make the struct and functions present in the tests more
generic, rename xrgb8888_to_rgb332_* to convert_xrgb8888_*.
Tested-by: default avatarTales L. Aparecida <tales.aparecida@gmail.com>
Acked-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: default avatarDavid Gow <davidgow@google.com>
Signed-off-by: default avatarJosé Expósito <jose.exposito89@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220726230916.390575-3-jose.exposito89@gmail.com
parent 18c84852
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#define TEST_BUF_SIZE 50 #define TEST_BUF_SIZE 50
struct xrgb8888_to_rgb332_case { struct convert_xrgb8888_case {
const char *name; const char *name;
unsigned int pitch; unsigned int pitch;
unsigned int dst_pitch; unsigned int dst_pitch;
...@@ -25,7 +25,7 @@ struct xrgb8888_to_rgb332_case { ...@@ -25,7 +25,7 @@ struct xrgb8888_to_rgb332_case {
const u8 expected[4 * TEST_BUF_SIZE]; const u8 expected[4 * TEST_BUF_SIZE];
}; };
static struct xrgb8888_to_rgb332_case xrgb8888_to_rgb332_cases[] = { static struct convert_xrgb8888_case convert_xrgb8888_cases[] = {
{ {
.name = "single_pixel_source_buffer", .name = "single_pixel_source_buffer",
.pitch = 1 * 4, .pitch = 1 * 4,
...@@ -126,18 +126,18 @@ static u32 *le32buf_to_cpu(struct kunit *test, const u32 *buf, size_t buf_size) ...@@ -126,18 +126,18 @@ static u32 *le32buf_to_cpu(struct kunit *test, const u32 *buf, size_t buf_size)
return dst; return dst;
} }
static void xrgb8888_to_rgb332_case_desc(struct xrgb8888_to_rgb332_case *t, static void convert_xrgb8888_case_desc(struct convert_xrgb8888_case *t,
char *desc) char *desc)
{ {
strscpy(desc, t->name, KUNIT_PARAM_DESC_SIZE); strscpy(desc, t->name, KUNIT_PARAM_DESC_SIZE);
} }
KUNIT_ARRAY_PARAM(xrgb8888_to_rgb332, xrgb8888_to_rgb332_cases, KUNIT_ARRAY_PARAM(convert_xrgb8888, convert_xrgb8888_cases,
xrgb8888_to_rgb332_case_desc); convert_xrgb8888_case_desc);
static void xrgb8888_to_rgb332_test(struct kunit *test) static void xrgb8888_to_rgb332_test(struct kunit *test)
{ {
const struct xrgb8888_to_rgb332_case *params = test->param_value; const struct convert_xrgb8888_case *params = test->param_value;
size_t dst_size; size_t dst_size;
__u8 *dst = NULL; __u8 *dst = NULL;
__u32 *src = NULL; __u32 *src = NULL;
...@@ -163,8 +163,7 @@ static void xrgb8888_to_rgb332_test(struct kunit *test) ...@@ -163,8 +163,7 @@ static void xrgb8888_to_rgb332_test(struct kunit *test)
} }
static struct kunit_case drm_format_helper_test_cases[] = { static struct kunit_case drm_format_helper_test_cases[] = {
KUNIT_CASE_PARAM(xrgb8888_to_rgb332_test, KUNIT_CASE_PARAM(xrgb8888_to_rgb332_test, convert_xrgb8888_gen_params),
xrgb8888_to_rgb332_gen_params),
{} {}
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment