[1/2] gdi32: Added PolyDraw tests to tests/path.c [try2]

Evan Stade estade at gmail.com
Wed Jun 27 17:34:59 CDT 2007


Hi,

[try2] The patch I sent yesterday was not properly todo_wined.  Also,
this test is a bit more extensive (about twice as many points drawn).
It uses various point-type combination (even non-sensical ones such as
PT_LINETO | PT_MOVETO) to test the exact logic of PolyDraw with an
open path.

changelog:
* added polydraw test to path testing (5 more todo_wines)

 dlls/gdi32/tests/path.c |   70 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 70 insertions(+), 0 deletions(-)

-- 
Evan Stade
-------------- next part --------------
diff --git a/dlls/gdi32/tests/path.c b/dlls/gdi32/tests/path.c
index e9b8e2f..ebbb73a 100644
--- a/dlls/gdi32/tests/path.c
+++ b/dlls/gdi32/tests/path.c
@@ -291,9 +291,79 @@ done:
     ReleaseDC(0, hdc);
 }
 
+static const path_test_t polydraw_path[] = {
+    {300, 300, 6, 0, 0}, /*0*/
+    {150, 200, 2, 0, 0}, /*1*/
+    {200, 150, 3, 0, 0}, /*2*/
+    {300, 300, 6, 0, 1}, /*3*/
+    {300, 300, 2, 0, 0}, /*4*/
+    {400, 300, 2, 0, 0}, /*5*/
+    {400, 350, 2, 0, 0}, /*6*/
+    {50, 100, 6, 0, 0}, /*7*/
+    {100, 50, 2, 0, 0}, /*8*/
+    {400, 250, 2, 0, 0}, /*9*/
+    {500, 300, 2, 0, 0}, /*10*/
+    {500, 350, 2, 0, 0}, /*11*/
+    {350, 400, 6, 0, 1}, /*12*/
+    {600, 200, 2, 0, 1}, /*13*/
+    {500, 150, 2, 0, 1}, /*14*/
+    {500, 350, 6, 0, 0}, /*15*/
+    {500, 150, 2, 0, 0}, /*16*/
+    {100, 200, 2, 0, 0}, /*17*/
+    {400, 150, 2, 0, 0}, /*18*/
+    {400, 350, 2, 0, 0} /*19*/
+    };
+
+static const POINT polydraw_pts[] = {
+    {150, 200}, {200, 150},
+    {300, 300}, {400, 300}, {400, 350},
+    { 50, 100}, {100,  50},
+    {400, 250}, {500, 300}, {500, 350},
+    {350, 400}, {600, 200},
+    {500, 150}, {100, 200}, {400, 150},
+    {400, 350}, {200, 600}
+    };
+
+BYTE polydraw_tps[] =
+    {PT_LINETO, PT_CLOSEFIGURE | PT_LINETO, PT_MOVETO | PT_LINETO, PT_LINETO,
+     PT_MOVETO | PT_LINETO, PT_LINETO, PT_LINETO, PT_BEZIERTO, PT_BEZIERTO | PT_LINETO};
+
+static void test_polydraw(void)
+{
+    BOOL retb;
+    HDC hdc = GetDC(0);
+    BeginPath(hdc);
+    MoveToEx(hdc, 300, 300, NULL);
+
+    if (!(retb = PolyDraw(hdc, polydraw_pts, polydraw_tps, 2)) &&
+        GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
+    {
+        /* PolyDraw is only available on Win2k and later */
+        skip("PolyDraw is not available\n");
+        goto done;
+    }
+
+    ok(retb == TRUE, "Expected %d, got %d\n", TRUE, retb);
+    PolylineTo(hdc, &(polydraw_pts[2]), 3);
+    retb = PolyDraw(hdc, &(polydraw_pts[5]), &(polydraw_tps[2]), 2);
+    ok(retb == TRUE, "Expected %d, got %d\n", TRUE, retb);
+    PolylineTo(hdc, &(polydraw_pts[7]), 3);
+    retb = PolyDraw(hdc, &(polydraw_pts[10]), &(polydraw_tps[4]), 4);
+    ok(retb == FALSE, "Expected %d, got %d\n", FALSE, retb);
+    PolylineTo(hdc, &(polydraw_pts[12]), 3);
+    retb = PolyDraw(hdc, &(polydraw_pts[15]), &(polydraw_tps[6]), 2);
+    ok(retb == FALSE, "Expected %d, got %d\n", FALSE, retb);
+
+    EndPath(hdc);
+    ok_path(hdc, "polydraw_path", polydraw_path, sizeof(polydraw_path)/sizeof(path_test_t), 1);
+done:
+    ReleaseDC(0, hdc);
+}
+
 START_TEST(path)
 {
     test_widenpath();
     test_arcto();
     test_anglearc();
+    test_polydraw();
 }
-- 
1.4.1


More information about the wine-patches mailing list