Signed-off-by: Jeff Smith whydoubt@gmail.com --- dlls/gdiplus/tests/font.c | 43 ++++++++++++++++------------------- dlls/gdiplus/tests/graphics.c | 15 ++++-------- 2 files changed, 24 insertions(+), 34 deletions(-)
diff --git a/dlls/gdiplus/tests/font.c b/dlls/gdiplus/tests/font.c index af90152aa26..2fcdb3a37da 100644 --- a/dlls/gdiplus/tests/font.c +++ b/dlls/gdiplus/tests/font.c @@ -30,11 +30,6 @@ #define expectf_(expected, got, precision) ok(fabs((expected) - (got)) <= (precision), "Expected %f, got %f\n", (expected), (got)) #define expectf(expected, got) expectf_((expected), (got), 0.001)
-static const WCHAR nonexistent[] = {'T','h','i','s','F','o','n','t','s','h','o','u','l','d','N','o','t','E','x','i','s','t','\0'}; -static const WCHAR MSSansSerif[] = {'M','S',' ','S','a','n','s',' ','S','e','r','i','f','\0'}; -static const WCHAR TimesNewRoman[] = {'T','i','m','e','s',' ','N','e','w',' ','R','o','m','a','n','\0'}; -static const WCHAR Tahoma[] = {'T','a','h','o','m','a',0}; - static void set_rect_empty(RectF *rc) { rc->X = 0.0; @@ -125,11 +120,11 @@ static void test_createfont(void) REAL size; WCHAR familyname[LF_FACESIZE];
- stat = GdipCreateFontFamilyFromName(nonexistent, NULL, &fontfamily); + stat = GdipCreateFontFamilyFromName(L"ThisFontShouldNotExist", NULL, &fontfamily); expect (FontFamilyNotFound, stat); stat = GdipDeleteFont(font); expect (InvalidParameter, stat); - stat = GdipCreateFontFamilyFromName(Tahoma, NULL, &fontfamily); + stat = GdipCreateFontFamilyFromName(L"Tahoma", NULL, &fontfamily); expect (Ok, stat); stat = GdipCreateFont(fontfamily, 12, FontStyleRegular, UnitPoint, &font); expect (Ok, stat); @@ -142,7 +137,7 @@ static void test_createfont(void) stat = GdipGetFamilyName(fontfamily2, familyname, 0); expect(Ok, stat); ok (fontfamily == fontfamily2, "Unexpected family instance.\n"); - ok (lstrcmpiW(Tahoma, familyname) == 0, "Expected Tahoma, got %s\n", + ok (lstrcmpiW(L"Tahoma", familyname) == 0, "Expected Tahoma, got %s\n", wine_dbgstr_w(familyname)); stat = GdipDeleteFontFamily(fontfamily2); expect(Ok, stat); @@ -362,26 +357,26 @@ static void test_fontfamily (void) GpStatus stat;
/* FontFamily cannot be NULL */ - stat = GdipCreateFontFamilyFromName (Tahoma , NULL, NULL); + stat = GdipCreateFontFamilyFromName (L"Tahoma" , NULL, NULL); expect (InvalidParameter, stat);
/* FontFamily must be able to actually find the family. * If it can't, any subsequent calls should fail. */ - stat = GdipCreateFontFamilyFromName (nonexistent, NULL, &family); + stat = GdipCreateFontFamilyFromName (L"ThisFontShouldNotExist", NULL, &family); expect (FontFamilyNotFound, stat);
/* Bitmap fonts are not found */ - stat = GdipCreateFontFamilyFromName (MSSansSerif, NULL, &family); + stat = GdipCreateFontFamilyFromName (L"MS Sans Serif", NULL, &family); expect (FontFamilyNotFound, stat); if(stat == Ok) GdipDeleteFontFamily(family);
- stat = GdipCreateFontFamilyFromName (Tahoma, NULL, &family); + stat = GdipCreateFontFamilyFromName (L"Tahoma", NULL, &family); expect (Ok, stat);
stat = GdipGetFamilyName (family, itsName, LANG_NEUTRAL); expect (Ok, stat); - expect (0, lstrcmpiW(itsName, Tahoma)); + expect (0, lstrcmpiW(itsName, L"Tahoma"));
if (0) { @@ -398,7 +393,7 @@ static void test_fontfamily (void) GdipDeleteFontFamily(family); stat = GdipGetFamilyName(clonedFontFamily, itsName, LANG_NEUTRAL); expect(Ok, stat); - expect(0, lstrcmpiW(itsName, Tahoma)); + expect(0, lstrcmpiW(itsName, L"Tahoma"));
GdipDeleteFontFamily(clonedFontFamily); } @@ -409,7 +404,7 @@ static void test_fontfamily_properties (void) GpStatus stat; UINT16 result = 0;
- stat = GdipCreateFontFamilyFromName(Tahoma, NULL, &FontFamily); + stat = GdipCreateFontFamilyFromName(L"Tahoma", NULL, &FontFamily); expect(Ok, stat);
stat = GdipGetLineSpacing(FontFamily, FontStyleRegular, &result); @@ -429,7 +424,7 @@ static void test_fontfamily_properties (void) ok(result == 423, "Expected 423, got %d\n", result); GdipDeleteFontFamily(FontFamily);
- stat = GdipCreateFontFamilyFromName(TimesNewRoman, NULL, &FontFamily); + stat = GdipCreateFontFamilyFromName(L"Times New Roman", NULL, &FontFamily); if(stat == FontFamilyNotFound) skip("Times New Roman not installed\n"); else @@ -533,7 +528,7 @@ static void test_heightgivendpi(void) REAL height; Unit unit;
- stat = GdipCreateFontFamilyFromName(Tahoma, NULL, &fontfamily); + stat = GdipCreateFontFamilyFromName(L"Tahoma", NULL, &fontfamily); expect(Ok, stat);
stat = GdipCreateFont(fontfamily, 30, FontStyleRegular, UnitPixel, &font); @@ -734,7 +729,7 @@ static void test_font_metrics(void) memset(&lf, 0, sizeof(lf));
/* Tahoma,-13 */ - lstrcpyW(lf.lfFaceName, Tahoma); + lstrcpyW(lf.lfFaceName, L"Tahoma"); lf.lfHeight = -13; stat = GdipCreateFontFromLogfontW(hdc, &lf, &font); expect(Ok, stat); @@ -775,7 +770,7 @@ static void test_font_metrics(void) GdipDeleteFont(font);
/* Tahoma,13 */ - lstrcpyW(lf.lfFaceName, Tahoma); + lstrcpyW(lf.lfFaceName, L"Tahoma"); lf.lfHeight = 13; stat = GdipCreateFontFromLogfontW(hdc, &lf, &font); expect(Ok, stat); @@ -815,7 +810,7 @@ static void test_font_metrics(void)
GdipDeleteFont(font);
- stat = GdipCreateFontFamilyFromName(Tahoma, NULL, &family); + stat = GdipCreateFontFamilyFromName(L"Tahoma", NULL, &family); expect(Ok, stat);
/* Tahoma,13 */ @@ -892,7 +887,7 @@ static void test_font_substitution(void) GdipDeleteFont(font); GdipDeleteFontFamily(family);
- status = GdipCreateFontFamilyFromName(nonexistent, NULL, &family); + status = GdipCreateFontFamilyFromName(L"ThisFontShouldNotExist", NULL, &family); ok(status == FontFamilyNotFound, "expected FontFamilyNotFound, got %d\n", status);
/* nonexistent fonts fallback to Arial, or something else if it's missing */ @@ -1364,13 +1359,13 @@ static void test_CloneFont(void) expect(Ok, status); ok(collection == collection2, "got %p\n", collection2);
- status = GdipCreateFontFamilyFromName(nonexistent, NULL, &family); + status = GdipCreateFontFamilyFromName(L"ThisFontShouldNotExist", NULL, &family); expect(FontFamilyNotFound, status);
- status = GdipCreateFontFamilyFromName(nonexistent, collection, &family); + status = GdipCreateFontFamilyFromName(L"ThisFontShouldNotExist", collection, &family); expect(FontFamilyNotFound, status);
- status = GdipCreateFontFamilyFromName(Tahoma, NULL, &family); + status = GdipCreateFontFamilyFromName(L"Tahoma", NULL, &family); expect(Ok, status);
ret = is_family_in_collection(collection, family); diff --git a/dlls/gdiplus/tests/graphics.c b/dlls/gdiplus/tests/graphics.c index d1022b1af5b..9a09abcfc8b 100644 --- a/dlls/gdiplus/tests/graphics.c +++ b/dlls/gdiplus/tests/graphics.c @@ -3195,7 +3195,6 @@ static void test_string_functions(void) GpBrush *brush; ARGB color = 0xff000000; HDC hdc = GetDC( hwnd ); - const WCHAR fontname[] = {'T','a','h','o','m','a',0}; const WCHAR teststring[] = {'M','M',' ','M','\n','M',0}; const WCHAR teststring2[] = {'j',0}; REAL char_width, char_height; @@ -3213,7 +3212,7 @@ static void test_string_functions(void) expect(Ok, status); ok(graphics != NULL, "Expected graphics to be initialized\n");
- status = GdipCreateFontFamilyFromName(fontname, NULL, &family); + status = GdipCreateFontFamilyFromName(L"Tahoma", NULL, &family); expect(Ok, status);
status = GdipCreateFont(family, 10.0, FontStyleRegular, UnitPixel, &font); @@ -3744,7 +3743,6 @@ static void test_GdipMeasureString(void) { 200.0, 600.0, 1.0, UnitPixel }, { 200.0, 600.0, 2.0, UnitPixel }, }; - static const WCHAR tahomaW[] = { 'T','a','h','o','m','a',0 }; static const WCHAR string[] = { '1','2','3','4','5','6','7',0 }; GpStatus status; GpGraphics *graphics; @@ -3761,7 +3759,7 @@ static void test_GdipMeasureString(void)
status = GdipCreateStringFormat(0, LANG_NEUTRAL, &format); expect(Ok, status); - status = GdipCreateFontFamilyFromName(tahomaW, NULL, &family); + status = GdipCreateFontFamilyFromName(L"Tahoma", NULL, &family); expect(Ok, status);
/* font size in pixels */ @@ -4259,7 +4257,6 @@ static void test_pen_thickness(void) */ static void test_font_height_scaling(void) { - static const WCHAR tahomaW[] = { 'T','a','h','o','m','a',0 }; static const WCHAR string[] = { '1','2','3','4','5','6','7',0 }; HDC hdc; GpStringFormat *format; @@ -4281,7 +4278,7 @@ static void test_font_height_scaling(void) status = GdipCreateRegion(®ion); expect(Ok, status);
- status = GdipCreateFontFamilyFromName(tahomaW, NULL, &family); + status = GdipCreateFontFamilyFromName(L"Tahoma", NULL, &family); expect(Ok, status);
hdc = CreateCompatibleDC(0); @@ -4447,7 +4444,6 @@ cleanup:
static void test_measure_string(void) { - static const WCHAR tahomaW[] = { 'T','a','h','o','m','a',0 }; static const WCHAR string[] = { 'A','0','1',0 }; static const WCHAR string2[] = { 'M',' ','M','M',0 }; HDC hdc; @@ -4470,7 +4466,7 @@ static void test_measure_string(void) status = GdipCreateRegion(®ion); expect(Ok, status);
- status = GdipCreateFontFamilyFromName(tahomaW, NULL, &family); + status = GdipCreateFontFamilyFromName(L"Tahoma", NULL, &family); expect(Ok, status);
hdc = CreateCompatibleDC(0); @@ -4919,7 +4915,6 @@ todo_wine
static void test_measured_extra_space(void) { - static const WCHAR tahomaW[] = { 'T','a','h','o','m','a',0 }; static const WCHAR string[2] = { 'W','W' }; GpStringFormat *format; HDC hdc; @@ -4934,7 +4929,7 @@ static void test_measured_extra_space(void) status = GdipCreateStringFormat(0, LANG_NEUTRAL, &format); expect(Ok, status);
- status = GdipCreateFontFamilyFromName(tahomaW, NULL, &family); + status = GdipCreateFontFamilyFromName(L"Tahoma", NULL, &family); expect(Ok, status); hdc = CreateCompatibleDC(0); status = GdipCreateFromHDC(hdc, &graphics);
Signed-off-by: Jeff Smith whydoubt@gmail.com --- dlls/gdiplus/tests/font.c | 3 +-- dlls/gdiplus/tests/image.c | 13 ++++++------- dlls/gdiplus/tests/metafile.c | 9 ++++----- 3 files changed, 11 insertions(+), 14 deletions(-)
diff --git a/dlls/gdiplus/tests/font.c b/dlls/gdiplus/tests/font.c index 2fcdb3a37da..0d7254f255e 100644 --- a/dlls/gdiplus/tests/font.c +++ b/dlls/gdiplus/tests/font.c @@ -69,7 +69,6 @@ static void _delete_testfontfile(const WCHAR *filename, int line) static void test_long_name(void) { WCHAR path[MAX_PATH]; - static const WCHAR path_longname[] = {'w','i','n','e','_','l','o','n','g','n','a','m','e','.','t','t','f',0}; GpStatus stat; GpFontCollection *fonts; INT num_families; @@ -80,7 +79,7 @@ static void test_long_name(void) stat = GdipNewPrivateFontCollection(&fonts); ok(stat == Ok, "GdipNewPrivateFontCollection failed: %d\n", stat);
- create_testfontfile(path_longname, 1, path); + create_testfontfile(L"wine_longname.ttf", 1, path);
stat = GdipPrivateAddFontFile(fonts, path); ok(stat == Ok, "GdipPrivateAddFontFile failed: %d\n", stat); diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c index 93729650de8..c1f3b126a79 100644 --- a/dlls/gdiplus/tests/image.c +++ b/dlls/gdiplus/tests/image.c @@ -417,7 +417,6 @@ static void test_LoadingImages(void) GpStatus stat; GpBitmap *bm; GpImage *img; - static const WCHAR nonexistentW[] = {'n','o','n','e','x','i','s','t','e','n','t',0};
stat = GdipCreateBitmapFromFile(0, 0); expect(InvalidParameter, stat); @@ -428,7 +427,7 @@ static void test_LoadingImages(void) ok(bm == (GpBitmap *)0xdeadbeef, "returned %p\n", bm);
bm = (GpBitmap *)0xdeadbeef; - stat = GdipCreateBitmapFromFile(nonexistentW, &bm); + stat = GdipCreateBitmapFromFile(L"nonexistent", &bm); todo_wine expect(InvalidParameter, stat); ok(!bm, "returned %p\n", bm);
@@ -441,7 +440,7 @@ static void test_LoadingImages(void) ok(img == (GpImage *)0xdeadbeef, "returned %p\n", img);
img = (GpImage *)0xdeadbeef; - stat = GdipLoadImageFromFile(nonexistentW, &img); + stat = GdipLoadImageFromFile(L"nonexistent", &img); todo_wine expect(OutOfMemory, stat); ok(!img, "returned %p\n", img);
@@ -454,7 +453,7 @@ static void test_LoadingImages(void) ok(img == (GpImage *)0xdeadbeef, "returned %p\n", img);
img = (GpImage *)0xdeadbeef; - stat = GdipLoadImageFromFileICM(nonexistentW, &img); + stat = GdipLoadImageFromFileICM(L"nonexistent", &img); todo_wine expect(OutOfMemory, stat); ok(!img, "returned %p\n", img); } @@ -469,7 +468,7 @@ static void test_SavingImages(void) REAL w, h; ImageCodecInfo *codecs; static const CHAR filenameA[] = "a.bmp"; - static const WCHAR filename[] = { 'a','.','b','m','p',0 }; + static const WCHAR filename[] = L"a.bmp";
codecs = NULL;
@@ -536,8 +535,8 @@ static void test_SavingMultiPageTiff(void) UINT frame_count; static const CHAR filename1A[] = "1.tif"; static const CHAR filename2A[] = "2.tif"; - static const WCHAR filename1[] = { '1','.','t','i','f',0 }; - static const WCHAR filename2[] = { '2','.','t','i','f',0 }; + static const WCHAR filename1[] = L"1.tif"; + static const WCHAR filename2[] = L"2.tif"; static const WCHAR tiff_mimetype[] = { 'i','m','a','g','e','/','t','i','f','f',0 };
params.Count = 1; diff --git a/dlls/gdiplus/tests/metafile.c b/dlls/gdiplus/tests/metafile.c index 33fff3f98cf..eaad4acdc69 100644 --- a/dlls/gdiplus/tests/metafile.c +++ b/dlls/gdiplus/tests/metafile.c @@ -2824,7 +2824,6 @@ static void test_fillpath(void) { static const WCHAR description[] = {'w','i','n','e','t','e','s','t',0}; static const GpRectF frame = {0.0, 0.0, 100.0, 100.0}; - static const WCHAR winetestemfW[] = {'w','i','n','e','t','e','s','t','.','e','m','f',0};
GpMetafile *metafile; GpGraphics *graphics; @@ -2870,7 +2869,7 @@ static void test_fillpath(void) check_emfplus(hemf, fill_path_records, "fill path");
/* write to disk */ - DeleteEnhMetaFile(CopyEnhMetaFileW(hemf, winetestemfW)); + DeleteEnhMetaFile(CopyEnhMetaFileW(hemf, L"winetest.emf"));
DeleteEnhMetaFile(hemf);
@@ -2878,15 +2877,15 @@ static void test_fillpath(void) expect(Ok, stat);
/* should succeed when given path to an EMF */ - stat = GdipCreateMetafileFromWmfFile(winetestemfW, NULL, &metafile); + stat = GdipCreateMetafileFromWmfFile(L"winetest.emf", NULL, &metafile); expect(Ok, stat);
stat = GdipDisposeImage((GpImage*)metafile); expect(Ok, stat);
- DeleteFileW(winetestemfW); + DeleteFileW(L"winetest.emf");
- stat = GdipCreateMetafileFromWmfFile(winetestemfW, NULL, &metafile); + stat = GdipCreateMetafileFromWmfFile(L"winetest.emf", NULL, &metafile); expect(GenericError, stat); }
Signed-off-by: Esme Povirk esme@codeweavers.com
Signed-off-by: Jeff Smith whydoubt@gmail.com --- dlls/gdiplus/tests/image.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c index c1f3b126a79..2175c1748e0 100644 --- a/dlls/gdiplus/tests/image.c +++ b/dlls/gdiplus/tests/image.c @@ -537,7 +537,6 @@ static void test_SavingMultiPageTiff(void) static const CHAR filename2A[] = "2.tif"; static const WCHAR filename1[] = L"1.tif"; static const WCHAR filename2[] = L"2.tif"; - static const WCHAR tiff_mimetype[] = { 'i','m','a','g','e','/','t','i','f','f',0 };
params.Count = 1; params.Parameter[0].Guid = EncoderSaveFlag; @@ -549,7 +548,7 @@ static void test_SavingMultiPageTiff(void) expect(Ok, stat); stat = GdipCreateBitmapFromScan0(2 * WIDTH, 2 * HEIGHT, 0, PixelFormat24bppRGB, NULL, &bm2); expect(Ok, stat); - result = get_encoder_clsid(tiff_mimetype, &format, &tiff_clsid); + result = get_encoder_clsid(L"image/tiff", &format, &tiff_clsid); ok(result, "getting TIFF encoding clsid failed");
if (!bm1 || !bm2 || !result)
Signed-off-by: Esme Povirk esme@codeweavers.com
Signed-off-by: Jeff Smith whydoubt@gmail.com --- dlls/gdiplus/tests/metafile.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-)
diff --git a/dlls/gdiplus/tests/metafile.c b/dlls/gdiplus/tests/metafile.c index eaad4acdc69..3ce7a16d61a 100644 --- a/dlls/gdiplus/tests/metafile.c +++ b/dlls/gdiplus/tests/metafile.c @@ -31,6 +31,8 @@ static BOOL save_metafiles; static BOOL load_metafiles;
+static const WCHAR description[] = L"winetest"; + typedef struct emfplus_record { DWORD record_type; @@ -378,7 +380,6 @@ static void test_empty(void) MetafileHeader header; static const GpRectF frame = {0.0, 0.0, 100.0, 100.0}; static const GpPointF dst_points[3] = {{0.0,0.0},{100.0,0.0},{0.0,100.0}}; - static const WCHAR description[] = {'w','i','n','e','t','e','s','t',0}; UINT limit_dpi;
hdc = CreateCompatibleDC(0); @@ -626,7 +627,6 @@ static void test_getdc(void) static const GpRectF frame = {0.0, 0.0, 100.0, 100.0}; static const GpPointF dst_points[3] = {{0.0,0.0},{100.0,0.0},{0.0,100.0}}; static const GpPointF dst_points_half[3] = {{0.0,0.0},{50.0,0.0},{0.0,50.0}}; - static const WCHAR description[] = {'w','i','n','e','t','e','s','t',0}; HBRUSH hbrush, holdbrush; GpBitmap *bitmap; ARGB color; @@ -784,7 +784,6 @@ static void test_emfonly(void) MetafileHeader header; static const GpRectF frame = {0.0, 0.0, 100.0, 100.0}; static const GpPointF dst_points[3] = {{0.0,0.0},{100.0,0.0},{0.0,100.0}}; - static const WCHAR description[] = {'w','i','n','e','t','e','s','t',0}; HBRUSH hbrush, holdbrush; GpBitmap *bitmap; ARGB color; @@ -1081,7 +1080,6 @@ static void test_fillrect(void) static const GpRectF frame = {0.0, 0.0, 100.0, 100.0}; static const GpPointF dst_points[3] = {{0.0,0.0},{100.0,0.0},{0.0,100.0}}; static const GpPointF dst_points_half[3] = {{0.0,0.0},{50.0,0.0},{0.0,50.0}}; - static const WCHAR description[] = {'w','i','n','e','t','e','s','t',0}; GpBitmap *bitmap; ARGB color; GpBrush *brush; @@ -1194,7 +1192,6 @@ static void test_clear(void) HENHMETAFILE hemf; static const GpRectF frame = {0.0, 0.0, 100.0, 100.0}; static const GpPointF dst_points[3] = {{10.0,10.0},{20.0,10.0},{10.0,20.0}}; - static const WCHAR description[] = {'w','i','n','e','t','e','s','t',0}; GpBitmap *bitmap; ARGB color;
@@ -1266,7 +1263,6 @@ static void test_nullframerect(void) { GpMetafile *metafile; GpGraphics *graphics; HDC hdc, metafile_dc; - static const WCHAR description[] = {'w','i','n','e','t','e','s','t',0}; GpBrush *brush; HBRUSH hbrush, holdbrush; GpRectF bounds; @@ -1459,7 +1455,6 @@ static void test_pagetransform(void) HDC hdc; static const GpRectF frame = {0.0, 0.0, 5.0, 5.0}; static const GpPointF dst_points[3] = {{0.0,0.0},{100.0,0.0},{0.0,100.0}}; - static const WCHAR description[] = {'w','i','n','e','t','e','s','t',0}; GpBitmap *bitmap; ARGB color; GpBrush *brush; @@ -1664,7 +1659,6 @@ static void test_worldtransform(void) HDC hdc; static const GpRectF frame = {0.0, 0.0, 5.0, 5.0}; static const GpPointF dst_points[3] = {{0.0,0.0},{100.0,0.0},{0.0,100.0}}; - static const WCHAR description[] = {'w','i','n','e','t','e','s','t',0}; GpBitmap *bitmap; ARGB color; GpBrush *brush; @@ -1921,7 +1915,6 @@ static void test_converttoemfplus(void) GpStatus (WINAPI *pGdipConvertToEmfPlus)( const GpGraphics *graphics, GpMetafile *metafile, BOOL *succ, EmfType emfType, const WCHAR *description, GpMetafile **outmetafile); static const GpRectF frame = {0.0, 0.0, 100.0, 100.0}; - static const WCHAR description[] = {'w','i','n','e','t','e','s','t',0}; GpStatus stat; GpMetafile *metafile, *metafile2 = NULL, *emhmeta; GpGraphics *graphics; @@ -2001,7 +1994,6 @@ static void test_frameunit(void) GpGraphics *graphics; HDC hdc; static const GpRectF frame = {0.0, 0.0, 5.0, 5.0}; - static const WCHAR description[] = {'w','i','n','e','t','e','s','t',0}; GpUnit unit; REAL dpix, dpiy; GpRectF bounds; @@ -2097,7 +2089,6 @@ static void test_containers(void) HDC hdc; static const GpRectF frame = {0.0, 0.0, 100.0, 100.0}; static const GpPointF dst_points[3] = {{0.0,0.0},{100.0,0.0},{0.0,100.0}}; - static const WCHAR description[] = {'w','i','n','e','t','e','s','t',0}; GraphicsContainer state1, state2; GpRectF srcrect, dstrect; REAL dpix, dpiy; @@ -2293,7 +2284,6 @@ static void test_clipping(void) HDC hdc; static const GpRectF frame = {0.0, 0.0, 100.0, 100.0}; static const GpPointF dst_points[3] = {{0.0,0.0},{100.0,0.0},{0.0,100.0}}; - static const WCHAR description[] = {'w','i','n','e','t','e','s','t',0}; GraphicsState state;
hdc = CreateCompatibleDC(0); @@ -2434,7 +2424,6 @@ static void test_gditransform(void) MetafileHeader header; static const GpRectF frame = {0.0, 0.0, 100.0, 100.0}; static const GpPointF dst_points[3] = {{0.0,0.0},{40.0,0.0},{0.0,40.0}}; - static const WCHAR description[] = {'w','i','n','e','t','e','s','t',0}; HBRUSH hbrush, holdbrush; GpBitmap *bitmap; ARGB color; @@ -2561,7 +2550,6 @@ static const emfplus_record draw_image_metafile_records[] = {
static void test_drawimage(void) { - static const WCHAR description[] = {'w','i','n','e','t','e','s','t',0}; static const GpPointF dst_points[3] = {{10.0,10.0},{85.0,15.0},{10.0,80.0}}; static const GpRectF frame = {0.0, 0.0, 100.0, 100.0}; const ColorMatrix double_red = {{ @@ -2679,7 +2667,6 @@ static const emfplus_record properties_records[] = {
static void test_properties(void) { - static const WCHAR description[] = {'w','i','n','e','t','e','s','t',0}; static const GpRectF frame = {0.0, 0.0, 100.0, 100.0};
GpMetafile *metafile; @@ -2757,7 +2744,6 @@ static const emfplus_record draw_path_records[] = {
static void test_drawpath(void) { - static const WCHAR description[] = {'w','i','n','e','t','e','s','t',0}; static const GpRectF frame = {0.0, 0.0, 100.0, 100.0};
GpMetafile *metafile; @@ -2822,7 +2808,6 @@ static const emfplus_record fill_path_records[] = {
static void test_fillpath(void) { - static const WCHAR description[] = {'w','i','n','e','t','e','s','t',0}; static const GpRectF frame = {0.0, 0.0, 100.0, 100.0};
GpMetafile *metafile;
Signed-off-by: Esme Povirk esme@codeweavers.com
Signed-off-by: Jeff Smith whydoubt@gmail.com --- dlls/gdiplus/tests/font.c | 2 +- dlls/gdiplus/tests/graphics.c | 24 +++++++++++------------- 2 files changed, 12 insertions(+), 14 deletions(-)
diff --git a/dlls/gdiplus/tests/font.c b/dlls/gdiplus/tests/font.c index 0d7254f255e..32cd1ff2c4f 100644 --- a/dlls/gdiplus/tests/font.c +++ b/dlls/gdiplus/tests/font.c @@ -946,7 +946,7 @@ todo_wine
static void test_font_transform(void) { - static const WCHAR string[] = { 'A',0 }; + static const WCHAR string[] = L"A"; GpStatus status; HDC hdc; LOGFONTA lf; diff --git a/dlls/gdiplus/tests/graphics.c b/dlls/gdiplus/tests/graphics.c index 9a09abcfc8b..3c864c92e0a 100644 --- a/dlls/gdiplus/tests/graphics.c +++ b/dlls/gdiplus/tests/graphics.c @@ -2279,7 +2279,7 @@ static void test_GdipDrawString(void) GpBrush *brush; LOGFONTA logfont; HDC hdc = GetDC( hwnd ); - static const WCHAR string[] = {'T','e','s','t',0}; + static const WCHAR string[] = L"Test"; static const PointF positions[4] = {{0,0}, {1,1}, {2,2}, {3,3}}; GpMatrix *matrix;
@@ -3195,8 +3195,8 @@ static void test_string_functions(void) GpBrush *brush; ARGB color = 0xff000000; HDC hdc = GetDC( hwnd ); - const WCHAR teststring[] = {'M','M',' ','M','\n','M',0}; - const WCHAR teststring2[] = {'j',0}; + const WCHAR teststring[] = L"MM M\nM"; + const WCHAR teststring2[] = L"j"; REAL char_width, char_height; INT codepointsfitted, linesfilled; GpStringFormat *format; @@ -3743,7 +3743,7 @@ static void test_GdipMeasureString(void) { 200.0, 600.0, 1.0, UnitPixel }, { 200.0, 600.0, 2.0, UnitPixel }, }; - static const WCHAR string[] = { '1','2','3','4','5','6','7',0 }; + static const WCHAR string[] = L"1234567"; GpStatus status; GpGraphics *graphics; GpFontFamily *family; @@ -4257,7 +4257,7 @@ static void test_pen_thickness(void) */ static void test_font_height_scaling(void) { - static const WCHAR string[] = { '1','2','3','4','5','6','7',0 }; + static const WCHAR string[] = L"1234567"; HDC hdc; GpStringFormat *format; CharacterRange range = { 0, 7 }; @@ -4357,7 +4357,6 @@ static void test_font_height_scaling(void) /* UnitPixel = 2, UnitPoint = 3, UnitInch = 4, UnitDocument = 5, UnitMillimeter = 6 */ for (gfx_unit = 2; gfx_unit <= 6; gfx_unit++) { - static const WCHAR doubleW[2] = { 'W','W' }; RectF bounds_1, bounds_2; REAL margin, margin_y, font_height; int match; @@ -4397,12 +4396,12 @@ todo_wine /* bounds.width of 1 glyph: [margin]+[width]+[margin] */ set_rect_empty(&rect); set_rect_empty(&bounds_1); - status = GdipMeasureString(graphics, doubleW, 1, font, &rect, format, &bounds_1, NULL, NULL); + status = GdipMeasureString(graphics, L"W", 1, font, &rect, format, &bounds_1, NULL, NULL); expect(Ok, status); /* bounds.width of 2 identical glyphs: [margin]+[width]+[width]+[margin] */ set_rect_empty(&rect); set_rect_empty(&bounds_2); - status = GdipMeasureString(graphics, doubleW, 2, font, &rect, format, &bounds_2, NULL, NULL); + status = GdipMeasureString(graphics, L"WW", 2, font, &rect, format, &bounds_2, NULL, NULL); expect(Ok, status);
/* margin = [bounds.width of 1] - [bounds.width of 2] / 2*/ @@ -4444,8 +4443,8 @@ cleanup:
static void test_measure_string(void) { - static const WCHAR string[] = { 'A','0','1',0 }; - static const WCHAR string2[] = { 'M',' ','M','M',0 }; + static const WCHAR string[] = L"A01"; + static const WCHAR string2[] = "M MM"; HDC hdc; GpStringFormat *format, *format_no_wrap; CharacterRange range; @@ -4915,7 +4914,6 @@ todo_wine
static void test_measured_extra_space(void) { - static const WCHAR string[2] = { 'W','W' }; GpStringFormat *format; HDC hdc; GpGraphics *graphics; @@ -4959,12 +4957,12 @@ static void test_measured_extra_space(void) /* bounds.width of 1 glyph: [margin]+[width]+[margin] */ set_rect_empty(&rect); set_rect_empty(&bounds_1); - status = GdipMeasureString(graphics, string, 1, font, &rect, format, &bounds_1, NULL, NULL); + status = GdipMeasureString(graphics, L"W", 1, font, &rect, format, &bounds_1, NULL, NULL); expect(Ok, status); /* bounds.width of 2 identical glyphs: [margin]+[width]+[width]+[margin] */ set_rect_empty(&rect); set_rect_empty(&bounds_2); - status = GdipMeasureString(graphics, string, 2, font, &rect, format, &bounds_2, NULL, NULL); + status = GdipMeasureString(graphics, L"WW", 2, font, &rect, format, &bounds_2, NULL, NULL); expect(Ok, status);
/* margin = [bounds.width of 1] - [bounds.width of 2] / 2*/
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=83257
Your paranoid android.
=== build (build log) ===
../wine/dlls/gdiplus/tests/graphics.c:4447:36: error: wide character array initialized from non-wide string Makefile:73658: recipe for target 'dlls/gdiplus/tests/graphics.cross.o' failed Task: The exe32 Wine build failed
=== debiant (build log) ===
../wine/dlls/gdiplus/tests/graphics.c:4447:36: error: cannot initialize array of ‘short unsigned int’ from a string literal with type array of ‘char’ Task: The win32 Wine build failed
=== debiant (build log) ===
../wine/dlls/gdiplus/tests/graphics.c:4447:36: error: cannot initialize array of ‘short unsigned int’ from a string literal with type array of ‘char’ Task: The wow64 Wine build failed