Jeff Smith : gdiplus/tests: Use wide-char string literals for file names.
Alexandre Julliard
julliard at winehq.org
Thu Dec 10 16:05:29 CST 2020
Module: wine
Branch: master
Commit: 796550cc72ce50b9af04bbec973576dccc5e0c7d
URL: https://source.winehq.org/git/wine.git/?a=commit;h=796550cc72ce50b9af04bbec973576dccc5e0c7d
Author: Jeff Smith <whydoubt at gmail.com>
Date: Tue Dec 8 19:40:10 2020 -0600
gdiplus/tests: Use wide-char string literals for file names.
Signed-off-by: Jeff Smith <whydoubt at gmail.com>
Signed-off-by: Esme Povirk <esme at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
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);
}
More information about the wine-cvs
mailing list