diff options
author | Mattias Andrée <maandree@kth.se> | 2023-01-08 13:30:58 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2023-01-08 13:30:58 +0100 |
commit | 319970c3805d233c2c94e7a309870ae8aaa76c80 (patch) | |
tree | 699602764615a94e65d530338741b078145eba2f | |
parent | Fix and test libfonts_get_output_dpi (diff) | |
download | libfonts-319970c3805d233c2c94e7a309870ae8aaa76c80.tar.gz libfonts-319970c3805d233c2c94e7a309870ae8aaa76c80.tar.bz2 libfonts-319970c3805d233c2c94e7a309870ae8aaa76c80.tar.xz |
m
Signed-off-by: Mattias Andrée <maandree@kth.se>
-rw-r--r-- | libfonts_get_output_dpi.c | 16 |
1 files changed, 16 insertions, 0 deletions
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; } |