From def00a32bec41307c4b7a421eaf5a22c72879a19 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Mon, 2 Dec 2024 19:33:32 +0100 Subject: [PATCH] [core,settings] add testcases --- libfreerdp/core/test/TestSettings.c | 74 +++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/libfreerdp/core/test/TestSettings.c b/libfreerdp/core/test/TestSettings.c index 5dc9b2467..1f102b7b2 100644 --- a/libfreerdp/core/test/TestSettings.c +++ b/libfreerdp/core/test/TestSettings.c @@ -1269,6 +1269,78 @@ static BOOL test_validity_check(void) .deviceScaleFactor = 100 } } }; + const rdpMonitor multi_monitor_valid_2[] = { + { .x = 0, + .y = 0, + .width = 1920, + .height = 1080, + .is_primary = TRUE, + .orig_screen = 0, + .attributes = { .physicalWidth = 100, + .physicalHeight = 100, + .orientation = ORIENTATION_PREFERENCE_LANDSCAPE, + .desktopScaleFactor = 100, + .deviceScaleFactor = 100 } }, + { .x = 3840, + .y = 0, + .width = 1920, + .height = 1080, + .is_primary = FALSE, + .orig_screen = 0, + .attributes = { .physicalWidth = 100, + .physicalHeight = 100, + .orientation = ORIENTATION_PREFERENCE_LANDSCAPE, + .desktopScaleFactor = 100, + .deviceScaleFactor = 100 } }, + { .x = 1920, + .y = 0, + .width = 1920, + .height = 1080, + .is_primary = FALSE, + .orig_screen = 0, + .attributes = { .physicalWidth = 100, + .physicalHeight = 100, + .orientation = ORIENTATION_PREFERENCE_LANDSCAPE, + .desktopScaleFactor = 100, + .deviceScaleFactor = 100 } } + }; + + const rdpMonitor multi_monitor_valid_3[] = { + { .x = 1920, + .y = 0, + .width = 1920, + .height = 1080, + .is_primary = TRUE, + .orig_screen = 0, + .attributes = { .physicalWidth = 100, + .physicalHeight = 100, + .orientation = ORIENTATION_PREFERENCE_LANDSCAPE, + .desktopScaleFactor = 100, + .deviceScaleFactor = 100 } }, + { .x = 3840, + .y = 0, + .width = 1920, + .height = 1080, + .is_primary = FALSE, + .orig_screen = 0, + .attributes = { .physicalWidth = 100, + .physicalHeight = 100, + .orientation = ORIENTATION_PREFERENCE_LANDSCAPE, + .desktopScaleFactor = 100, + .deviceScaleFactor = 100 } }, + { .x = 0, + .y = 0, + .width = 1920, + .height = 1080, + .is_primary = FALSE, + .orig_screen = 0, + .attributes = { .physicalWidth = 100, + .physicalHeight = 100, + .orientation = ORIENTATION_PREFERENCE_LANDSCAPE, + .desktopScaleFactor = 100, + .deviceScaleFactor = 100 } } + }; + const struct validity_test_case tests[] = { { TRUE, ARRAYSIZE(single_monitor_valid), single_monitor_valid }, { FALSE, ARRAYSIZE(single_monitor_invalid_1), single_monitor_invalid_1 }, @@ -1280,6 +1352,8 @@ static BOOL test_validity_check(void) { FALSE, ARRAYSIZE(multi_monitor_invalid_2), multi_monitor_invalid_2 }, { FALSE, ARRAYSIZE(multi_monitor_invalid_3), multi_monitor_invalid_3 }, { FALSE, ARRAYSIZE(multi_monitor_invalid_4), multi_monitor_invalid_4 }, + { TRUE, ARRAYSIZE(multi_monitor_valid_2), multi_monitor_valid_2 }, + { TRUE, ARRAYSIZE(multi_monitor_valid_3), multi_monitor_valid_3 } }; rc = TRUE;