[PATCH 2/2] gdiplus/tests: Add tests for GdipSetCustomLineCapWidthScale

Detlef Riekenberg wine.dev at web.de
Wed Apr 17 15:41:42 CDT 2013


--
By by ... Detlef
---
 dlls/gdiplus/tests/customlinecap.c |   35 ++++++++++++++++++++++++++++++++++-
 1 files changed, 34 insertions(+), 1 deletions(-)

diff --git a/dlls/gdiplus/tests/customlinecap.c b/dlls/gdiplus/tests/customlinecap.c
index 218e46d..604589e 100644
--- a/dlls/gdiplus/tests/customlinecap.c
+++ b/dlls/gdiplus/tests/customlinecap.c
@@ -174,12 +174,45 @@ static void test_scale(void)
     expect(InvalidParameter, stat);
     stat = GdipGetCustomLineCapWidthScale(custom, NULL);
     expect(InvalidParameter, stat);
-    /* valid args */
+
+    stat = GdipSetCustomLineCapWidthScale(NULL, 2.0);
+    expect(InvalidParameter, stat);
+
+    /* valid args: read default */
     scale = (REAL)0xdeadbeef;
     stat = GdipGetCustomLineCapWidthScale(custom, &scale);
     expect(Ok, stat);
     expectf(1.0, scale);
 
+    /* set and read back some scale values: there is no limit for the scale */
+    stat = GdipSetCustomLineCapWidthScale(custom, 2.5);
+    expect(Ok, stat);
+    scale = (REAL)0xdeadbeef;
+    stat = GdipGetCustomLineCapWidthScale(custom, &scale);
+    expect(Ok, stat);
+    expectf(2.5, scale);
+
+    stat = GdipSetCustomLineCapWidthScale(custom, 42.0);
+    expect(Ok, stat);
+    scale = (REAL)0xdeadbeef;
+    stat = GdipGetCustomLineCapWidthScale(custom, &scale);
+    expect(Ok, stat);
+    expectf(42.0, scale);
+
+    stat = GdipSetCustomLineCapWidthScale(custom, 3000.0);
+    expect(Ok, stat);
+    scale = (REAL)0xdeadbeef;
+    stat = GdipGetCustomLineCapWidthScale(custom, &scale);
+    expect(Ok, stat);
+    expectf(3000.0, scale);
+
+    stat = GdipSetCustomLineCapWidthScale(custom, 0.0);
+    expect(Ok, stat);
+    scale = (REAL)0xdeadbeef;
+    stat = GdipGetCustomLineCapWidthScale(custom, &scale);
+    expect(Ok, stat);
+    expectf(0.0, scale);
+
     GdipDeleteCustomLineCap(custom);
     GdipDeletePath(path);
 }
-- 
1.7.5.4




More information about the wine-patches mailing list