Nikolay Sivov : user32/tests: Some tests for EqualRect()/SetRect().
Alexandre Julliard
julliard at winehq.org
Fri Jun 3 10:03:44 CDT 2016
Module: wine
Branch: master
Commit: 54f41ae3ebc58a43aad5efdcecbad3fa7ba65236
URL: http://source.winehq.org/git/wine.git/?a=commit;h=54f41ae3ebc58a43aad5efdcecbad3fa7ba65236
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Thu Jun 2 20:40:33 2016 +0300
user32/tests: Some tests for EqualRect()/SetRect().
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/user32/tests/uitools.c | 55 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 55 insertions(+)
diff --git a/dlls/user32/tests/uitools.c b/dlls/user32/tests/uitools.c
index 1be709c..0f1cc58 100644
--- a/dlls/user32/tests/uitools.c
+++ b/dlls/user32/tests/uitools.c
@@ -112,8 +112,63 @@ static void test_SubtractRect(void)
"(dest rect={%d, %d, %d, %d})\n", rect2.left, rect2.top, rect2.right, rect2.bottom);
}
+static void test_EqualRect(void)
+{
+ RECT rect1, rect2;
+ BOOL ret;
+
+ SetRect(&rect1, 0, 0, 0, 0);
+ SetRect(&rect2, 1, 1, 1, 1);
+
+ ret = EqualRect(NULL, NULL);
+ ok(!ret, "got %d\n", ret);
+
+ ret = EqualRect(&rect1, NULL);
+ ok(!ret, "got %d\n", ret);
+
+ ret = EqualRect(NULL, &rect2);
+ ok(!ret, "got %d\n", ret);
+
+ ret = EqualRect(&rect1, &rect2);
+ ok(!ret, "got %d\n", ret);
+
+ SetRect(&rect1, 0, 0, 10, 10);
+ SetRect(&rect2, 10, 10, 0, 0);
+
+ ret = EqualRect(&rect1, &rect2);
+ ok(!ret, "got %d\n", ret);
+
+ ret = EqualRect(&rect1, &rect1);
+ ok(ret, "got %d\n", ret);
+
+ rect2 = rect1;
+ ret = EqualRect(&rect1, &rect2);
+ ok(ret, "got %d\n", ret);
+}
+
+static void test_SetRect(void)
+{
+ RECT rect;
+ BOOL ret;
+
+ ret = SetRect(NULL, 0, 0, 0, 0);
+ ok(!ret, "got %d\n", ret);
+
+ ret = SetRect(&rect, 1, 2, 3, 4);
+ ok(ret, "got %d\n", ret);
+ ok(rect.left == 1 && rect.top == 2 && rect.right == 3 && rect.bottom == 4,
+ "got wrong rectangle\n");
+
+ ret = SetRect(&rect, 10, 10, 5, 5);
+ ok(ret, "got %d\n", ret);
+ ok(rect.left == 10 && rect.top == 10 && rect.right == 5 && rect.bottom == 5,
+ "got wrong rectangle\n");
+}
+
START_TEST(uitools)
{
test_FillRect();
test_SubtractRect();
+ test_EqualRect();
+ test_SetRect();
}
More information about the wine-cvs
mailing list