diff mbox

[U-Boot,v2,13/14] dm: video: test: Add tests for rotated consoles

Message ID 1453171948-16022-14-git-send-email-sjg@chromium.org
State Accepted
Delegated to: Anatolij Gustschin
Headers show

Commit Message

Simon Glass Jan. 19, 2016, 2:52 a.m. UTC
Test that text is displayed correctly when the console is rotated.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Anatolij Gustschin <agust@denx.de>
---

Changes in v2: None

 configs/sandbox_defconfig |  1 +
 test/dm/video.c           | 27 +++++++++++++++++++++++++++
 2 files changed, 28 insertions(+)

Comments

Simon Glass Jan. 21, 2016, 3:26 p.m. UTC | #1
On 18 January 2016 at 19:52, Simon Glass <sjg@chromium.org> wrote:
> Test that text is displayed correctly when the console is rotated.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> Acked-by: Anatolij Gustschin <agust@denx.de>
> ---
>
> Changes in v2: None
>
>  configs/sandbox_defconfig |  1 +
>  test/dm/video.c           | 27 +++++++++++++++++++++++++++
>  2 files changed, 28 insertions(+)

Applied to u-boot-dm
diff mbox

Patch

diff --git a/configs/sandbox_defconfig b/configs/sandbox_defconfig
index 3b6017f..b55d5e5 100644
--- a/configs/sandbox_defconfig
+++ b/configs/sandbox_defconfig
@@ -77,6 +77,7 @@  CONFIG_USB_STORAGE=y
 CONFIG_USB_KEYBOARD=y
 CONFIG_SYS_USB_EVENT_POLL=y
 CONFIG_DM_VIDEO=y
+CONFIG_VIDEO_ROTATION=y
 CONFIG_VIDEO_SANDBOX_SDL=y
 CONFIG_SYS_VSNPRINTF=y
 CONFIG_CMD_DHRYSTONE=y
diff --git a/test/dm/video.c b/test/dm/video.c
index b197b01..65db216 100644
--- a/test/dm/video.c
+++ b/test/dm/video.c
@@ -188,3 +188,30 @@  static int dm_test_video_context(struct unit_test_state *uts)
 	return check_vidconsole_output(uts, 0, 788, 453);
 }
 DM_TEST(dm_test_video_context, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
+
+/* Test rotated text output through the console uclass */
+static int dm_test_video_rotation1(struct unit_test_state *uts)
+{
+	ut_assertok(check_vidconsole_output(uts, 1, 1112, 680));
+
+	return 0;
+}
+DM_TEST(dm_test_video_rotation1, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
+
+/* Test rotated text output through the console uclass */
+static int dm_test_video_rotation2(struct unit_test_state *uts)
+{
+	ut_assertok(check_vidconsole_output(uts, 2, 785, 446));
+
+	return 0;
+}
+DM_TEST(dm_test_video_rotation2, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
+
+/* Test rotated text output through the console uclass */
+static int dm_test_video_rotation3(struct unit_test_state *uts)
+{
+	ut_assertok(check_vidconsole_output(uts, 3, 1134, 681));
+
+	return 0;
+}
+DM_TEST(dm_test_video_rotation3, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);