From 319970c3805d233c2c94e7a309870ae8aaa76c80 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 8 Jan 2023 13:30:58 +0100 Subject: m MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- libfonts_get_output_dpi.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/libfonts_get_output_dpi.c b/libfonts_get_output_dpi.c index 03f73cc..6377fb9 100644 --- a/libfonts_get_output_dpi.c +++ b/libfonts_get_output_dpi.c @@ -402,6 +402,22 @@ main(void) ASSERT(eq(output.dpi_y, 2.54 * 400 / 0x99)); ASSERT(eq(output.dpi_x, 2.54 * 500 / 0x88)); + output.unrotated_output_width = 400; + output.unrotated_output_height = 500; + output.dpi_x = 100; + output.dpi_y = 150; + memset(edid, '0', sizeof(edid)); + memcpy(edid, "00""FF""FF""FF""FF""FF""FF""00", 8 * 2); + edid[21 * 2 + 0] = '9'; + edid[21 * 2 + 1] = '9'; + edid[22 * 2 + 0] = '8'; + edid[22 * 2 + 1] = '8'; + edid[400] = '\0'; + memcpy(&output.output_transformation, &rot90cw_matrix, sizeof(struct libfonts_transformation)); + ASSERT(libfonts_get_output_dpi(&output, edid) == 1); + ASSERT(eq(output.dpi_y, 2.54 * 400 / 0x99)); + ASSERT(eq(output.dpi_x, 2.54 * 500 / 0x88)); + return 0; } -- cgit v1.2.3-70-g09d2