From: Bartosz Kosiorek gang65@poczta.onet.pl
--- dlls/gdiplus/tests/customlinecap.c | 37 +++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-)
diff --git a/dlls/gdiplus/tests/customlinecap.c b/dlls/gdiplus/tests/customlinecap.c index a8bb5cf371b..a31934d137a 100644 --- a/dlls/gdiplus/tests/customlinecap.c +++ b/dlls/gdiplus/tests/customlinecap.c @@ -75,13 +75,44 @@ static void test_constructor_destructor(void) expect(InvalidParameter, stat);
/* valid args */ - stat = GdipCreateCustomLineCap(NULL, path2, LineCapFlat, 0.0, &custom); + custom = NULL; + stat = GdipCreateCustomLineCap(NULL, path2, LineCapTriangle, 0.0, &custom); + expect(Ok, stat); + ok(custom != NULL, "Custom line cap was not created\n"); + stat = GdipDeleteCustomLineCap(custom); + expect(Ok, stat); + + custom = NULL; + stat = GdipCreateCustomLineCap(path, path2, LineCapTriangle, 0.0, &custom); + expect(Ok, stat); + ok(custom != NULL, "Custom line cap was not created\n"); + stat = GdipDeleteCustomLineCap(custom); + expect(Ok, stat); + + /* if baseInset is too large compared to Cap size, then it returns NotImplemented */ + custom = NULL; + stat = GdipCreateCustomLineCap(path, path2, LineCapTriangle, 10.0, &custom); expect(Ok, stat); + ok(custom != NULL, "Custom line cap was not created\n"); stat = GdipDeleteCustomLineCap(custom); expect(Ok, stat); - /* it's strange but native returns NotImplemented on stroke == NULL */ + + custom = NULL; + stat = GdipCreateCustomLineCap(path, NULL, LineCapFlat, 0.0, &custom); + expect(InvalidParameter, stat); + ok(custom == NULL, "Expected a failure on creation\n"); + stat = GdipDeleteCustomLineCap(custom); + expect(Ok, stat); + + custom = NULL; + stat = GdipCreateCustomLineCap(path, NULL, LineCapFlat, 1.0, &custom); + todo_wine expect(NotImplemented, stat); + todo_wine ok(custom == NULL, "Expected a failure on creation\n"); + if(stat == Ok) GdipDeleteCustomLineCap(custom); + + /* if baseInset is too large compared to Cap size, then it returns NotImplemented */ custom = NULL; - stat = GdipCreateCustomLineCap(path, NULL, LineCapFlat, 10.0, &custom); + stat = GdipCreateCustomLineCap(path, NULL, LineCapFlat, 2.0, &custom); todo_wine expect(NotImplemented, stat); todo_wine ok(custom == NULL, "Expected a failure on creation\n"); if(stat == Ok) GdipDeleteCustomLineCap(custom);