Commit 8eff23cc authored by Jeff Smith's avatar Jeff Smith Committed by Alexandre Julliard

gdiplus/tests: Use wide-char string literals for test strings.

parent cf405026
...@@ -946,7 +946,7 @@ todo_wine ...@@ -946,7 +946,7 @@ todo_wine
static void test_font_transform(void) static void test_font_transform(void)
{ {
static const WCHAR string[] = { 'A',0 }; static const WCHAR string[] = L"A";
GpStatus status; GpStatus status;
HDC hdc; HDC hdc;
LOGFONTA lf; LOGFONTA lf;
......
...@@ -2279,7 +2279,7 @@ static void test_GdipDrawString(void) ...@@ -2279,7 +2279,7 @@ static void test_GdipDrawString(void)
GpBrush *brush; GpBrush *brush;
LOGFONTA logfont; LOGFONTA logfont;
HDC hdc = GetDC( hwnd ); 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}}; static const PointF positions[4] = {{0,0}, {1,1}, {2,2}, {3,3}};
GpMatrix *matrix; GpMatrix *matrix;
...@@ -3195,8 +3195,8 @@ static void test_string_functions(void) ...@@ -3195,8 +3195,8 @@ static void test_string_functions(void)
GpBrush *brush; GpBrush *brush;
ARGB color = 0xff000000; ARGB color = 0xff000000;
HDC hdc = GetDC( hwnd ); HDC hdc = GetDC( hwnd );
const WCHAR teststring[] = {'M','M',' ','M','\n','M',0}; const WCHAR teststring[] = L"MM M\nM";
const WCHAR teststring2[] = {'j',0}; const WCHAR teststring2[] = L"j";
REAL char_width, char_height; REAL char_width, char_height;
INT codepointsfitted, linesfilled; INT codepointsfitted, linesfilled;
GpStringFormat *format; GpStringFormat *format;
...@@ -3743,7 +3743,7 @@ static void test_GdipMeasureString(void) ...@@ -3743,7 +3743,7 @@ static void test_GdipMeasureString(void)
{ 200.0, 600.0, 1.0, UnitPixel }, { 200.0, 600.0, 1.0, UnitPixel },
{ 200.0, 600.0, 2.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; GpStatus status;
GpGraphics *graphics; GpGraphics *graphics;
GpFontFamily *family; GpFontFamily *family;
...@@ -4257,7 +4257,7 @@ static void test_pen_thickness(void) ...@@ -4257,7 +4257,7 @@ static void test_pen_thickness(void)
*/ */
static void test_font_height_scaling(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; HDC hdc;
GpStringFormat *format; GpStringFormat *format;
CharacterRange range = { 0, 7 }; CharacterRange range = { 0, 7 };
...@@ -4357,7 +4357,6 @@ static void test_font_height_scaling(void) ...@@ -4357,7 +4357,6 @@ static void test_font_height_scaling(void)
/* UnitPixel = 2, UnitPoint = 3, UnitInch = 4, UnitDocument = 5, UnitMillimeter = 6 */ /* UnitPixel = 2, UnitPoint = 3, UnitInch = 4, UnitDocument = 5, UnitMillimeter = 6 */
for (gfx_unit = 2; gfx_unit <= 6; gfx_unit++) for (gfx_unit = 2; gfx_unit <= 6; gfx_unit++)
{ {
static const WCHAR doubleW[2] = { 'W','W' };
RectF bounds_1, bounds_2; RectF bounds_1, bounds_2;
REAL margin, margin_y, font_height; REAL margin, margin_y, font_height;
int match; int match;
...@@ -4397,12 +4396,12 @@ todo_wine ...@@ -4397,12 +4396,12 @@ todo_wine
/* bounds.width of 1 glyph: [margin]+[width]+[margin] */ /* bounds.width of 1 glyph: [margin]+[width]+[margin] */
set_rect_empty(&rect); set_rect_empty(&rect);
set_rect_empty(&bounds_1); 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); expect(Ok, status);
/* bounds.width of 2 identical glyphs: [margin]+[width]+[width]+[margin] */ /* bounds.width of 2 identical glyphs: [margin]+[width]+[width]+[margin] */
set_rect_empty(&rect); set_rect_empty(&rect);
set_rect_empty(&bounds_2); 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); expect(Ok, status);
/* margin = [bounds.width of 1] - [bounds.width of 2] / 2*/ /* margin = [bounds.width of 1] - [bounds.width of 2] / 2*/
...@@ -4444,8 +4443,8 @@ cleanup: ...@@ -4444,8 +4443,8 @@ cleanup:
static void test_measure_string(void) static void test_measure_string(void)
{ {
static const WCHAR string[] = { 'A','0','1',0 }; static const WCHAR string[] = L"A01";
static const WCHAR string2[] = { 'M',' ','M','M',0 }; static const WCHAR string2[] = L"M MM";
HDC hdc; HDC hdc;
GpStringFormat *format, *format_no_wrap; GpStringFormat *format, *format_no_wrap;
CharacterRange range; CharacterRange range;
...@@ -4915,7 +4914,6 @@ todo_wine ...@@ -4915,7 +4914,6 @@ todo_wine
static void test_measured_extra_space(void) static void test_measured_extra_space(void)
{ {
static const WCHAR string[2] = { 'W','W' };
GpStringFormat *format; GpStringFormat *format;
HDC hdc; HDC hdc;
GpGraphics *graphics; GpGraphics *graphics;
...@@ -4959,12 +4957,12 @@ static void test_measured_extra_space(void) ...@@ -4959,12 +4957,12 @@ static void test_measured_extra_space(void)
/* bounds.width of 1 glyph: [margin]+[width]+[margin] */ /* bounds.width of 1 glyph: [margin]+[width]+[margin] */
set_rect_empty(&rect); set_rect_empty(&rect);
set_rect_empty(&bounds_1); 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); expect(Ok, status);
/* bounds.width of 2 identical glyphs: [margin]+[width]+[width]+[margin] */ /* bounds.width of 2 identical glyphs: [margin]+[width]+[width]+[margin] */
set_rect_empty(&rect); set_rect_empty(&rect);
set_rect_empty(&bounds_2); 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); expect(Ok, status);
/* margin = [bounds.width of 1] - [bounds.width of 2] / 2*/ /* margin = [bounds.width of 1] - [bounds.width of 2] / 2*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment