Author: akhaldi Date: Thu Aug 18 10:48:39 2016 New Revision: 72312
URL: http://svn.reactos.org/svn/reactos?rev=72312&view=rev Log: [USP10_WINETEST] Sync with Wine Staging 1.9.16. CORE-11866
Modified: trunk/rostests/winetests/usp10/usp10.c
Modified: trunk/rostests/winetests/usp10/usp10.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/usp10/usp10.c?re... ============================================================================== --- trunk/rostests/winetests/usp10/usp10.c [iso-8859-1] (original) +++ trunk/rostests/winetests/usp10/usp10.c [iso-8859-1] Thu Aug 18 10:48:39 2016 @@ -89,7 +89,8 @@ return; } todo_wine_if (nItemsToDo) - winetest_ok(outnItems == nItems, "Wrong number of items\n"); + winetest_ok(outnItems == nItems, "Wrong number of items (%u)\n", outnItems); + outnItems = min(outnItems, nItems); for (x = 0; x <= outnItems; x++) { if (items[x].isBroken && broken(outpItems[x].iCharPos == items[x].broken_value[0])) @@ -570,6 +571,29 @@ static const WCHAR test56[] = {0x0645, 0x06cc, 0x200c, 0x06a9, 0x0646, 0x0645}; /* Ù ÛâÚ©ÙÙ */ static const itemTest t561[] = {{{0,0,0,0,0,0},0,1,1,1,0,arab_tag,FALSE},{{0,0,0,0,0,0},6,0,0,0,0,-1,FALSE}}; static const itemTest t562[] = {{{0,0,0,0,0,0},0,0,0,0,1,arab_tag,FALSE},{{0,0,0,0,0,0},6,0,0,0,0,-1,FALSE}}; + + /* Persian numerals and punctuation. */ + static const WCHAR test57[] = {0x06f1, 0x06f2, 0x066c, 0x06f3, 0x06f4, 0x06f5, 0x066c, /* Û±Û²Ù¬Û³Û´ÛµÙ¬ */ + 0x06f6, 0x06f7, 0x06f8, 0x066b, 0x06f9, 0x06f0}; /* Û¶Û·Û¸Ù«Û¹Û° */ + static const itemTest t571[] = {{{0,0,0,0,0,0}, 0,0,1,2,0,arab_tag,FALSE},{{0,0,0,0,0,0}, 2,0,1,2,0,arab_tag,FALSE}, + {{0,0,0,0,0,0}, 3,0,1,2,0,arab_tag,FALSE},{{0,0,0,0,0,0}, 6,0,1,2,0,arab_tag,FALSE}, + {{0,0,0,0,0,0}, 7,0,1,2,0,arab_tag,FALSE},{{0,0,0,0,0,0},10,0,1,2,0,arab_tag,FALSE}, + {{0,0,0,0,0,0},11,0,1,2,0,arab_tag,FALSE},{{0,0,0,0,0,0},13,0,0,0,0,-1,FALSE}}; + static const itemTest t572[] = {{{0,0,0,0,0,0}, 0,0,0,2,0,arab_tag,FALSE},{{0,0,1,0,0,0}, 2,0,1,2,0,arab_tag,FALSE}, + {{0,0,0,0,0,0}, 3,0,0,2,0,arab_tag,FALSE},{{0,0,1,0,0,0}, 6,0,1,2,0,arab_tag,FALSE}, + {{0,0,0,0,0,0}, 7,0,0,2,0,arab_tag,FALSE},{{0,0,1,0,0,0},10,0,1,2,0,arab_tag,FALSE}, + {{0,0,0,0,0,0},11,0,0,2,0,arab_tag,FALSE},{{0,0,0,0,0,0},13,0,0,0,0,-1,FALSE}}; + static const itemTest t573[] = {{{0,0,0,0,0,0}, 0,0,0,0,1,arab_tag,FALSE},{{0,0,0,0,0,0}, 2,0,0,0,1,arab_tag,FALSE}, + {{0,0,0,0,0,0}, 3,0,0,0,1,arab_tag,FALSE},{{0,0,0,0,0,0}, 6,0,0,0,1,arab_tag,FALSE}, + {{0,0,0,0,0,0}, 7,0,0,0,1,arab_tag,FALSE},{{0,0,0,0,0,0},10,0,0,0,1,arab_tag,FALSE}, + {{0,0,0,0,0,0},11,0,0,0,1,arab_tag,FALSE},{{0,0,0,0,0,0},13,0,0,0,0,-1,FALSE}}; + /* Arabic numerals and punctuation. */ + static const WCHAR test58[] = {0x0661, 0x0662, 0x066c, 0x0663, 0x0664, 0x0665, 0x066c, /* ١٢٬٣٤٥٬ */ + 0x0666, 0x0667, 0x0668, 0x066b, 0x0669, 0x0660}; /* ٦٧٨٫٩٠*/ + static const itemTest t581[] = {{{0,0,0,0,0,0}, 0,0,1,2,0,arab_tag,FALSE}, + {{0,0,0,0,0,0},13,0,0,0,0,-1,FALSE}}; + static const itemTest t582[] = {{{0,0,1,1,0,1}, 0,0,0,0,1,arab_tag,FALSE}, + {{0,0,0,0,0,0},13,0,0,0,0,-1,FALSE}};
SCRIPT_ITEM items[15]; SCRIPT_CONTROL Control; @@ -652,6 +676,8 @@ test_items_ok(test46,16,NULL,NULL,1,t461,FALSE,0); test_items_ok(test47,26,NULL,NULL,1,t471,FALSE,0); test_items_ok(test56,6,NULL,NULL,1,t561,FALSE,0); + test_items_ok(test57,13,NULL,NULL,7,t571,FALSE,0); + test_items_ok(test58,13,NULL,NULL,1,t581,FALSE,0);
State.uBidiLevel = 0; test_items_ok(test1,4,&Control,&State,1,t11,FALSE,0); @@ -715,6 +741,8 @@ test_items_ok(test54,7,&Control,&State,2,t541,FALSE,0); test_items_ok(test55,8,&Control,&State,2,t551,FALSE,0); test_items_ok(test56,6,&Control,&State,1,t561,FALSE,0); + test_items_ok(test57,13,&Control,&State,7,t572,FALSE,0); + test_items_ok(test58,13,&Control,&State,1,t581,FALSE,0);
State.uBidiLevel = 1; test_items_ok(test1,4,&Control,&State,1,t12,FALSE,0); @@ -770,6 +798,8 @@ test_items_ok(test46,16,&Control,&State,1,t462,FALSE,0); test_items_ok(test47,26,&Control,&State,1,t472,FALSE,0); test_items_ok(test56,6,&Control,&State,1,t561,FALSE,0); + test_items_ok(test57,13,&Control,&State,7,t571,FALSE,0); + test_items_ok(test58,13,&Control,&State,1,t581,FALSE,0);
State.uBidiLevel = 1; Control.fMergeNeutralItems = TRUE; @@ -826,6 +856,8 @@ test_items_ok(test46,16,&Control,&State,1,t462,FALSE,0); test_items_ok(test47,26,&Control,&State,1,t472,FALSE,0); test_items_ok(test56,6,&Control,&State,1,t561,FALSE,0); + test_items_ok(test57,13,&Control,&State,7,t571,FALSE,0); + test_items_ok(test58,13,&Control,&State,1,t581,FALSE,0);
State.uBidiLevel = 0; Control.fMergeNeutralItems = FALSE; @@ -891,6 +923,8 @@ test_items_ok(test54,7,&Control,&State,2,t542,FALSE,0); test_items_ok(test55,8,&Control,&State,2,t552,FALSE,0); test_items_ok(test56,6,&Control,&State,1,t562,FALSE,0); + test_items_ok(test57,13,&Control,&State,7,t573,FALSE,0); + test_items_ok(test58,13,&Control,&State,1,t582,FALSE,0); }
static inline void _test_shape_ok(int valid, HDC hdc, LPCWSTR string, @@ -1665,7 +1699,9 @@ for (i = 0; i < 2; i++) { static const WCHAR space[] = {' ', 0}; - static const WCHAR blanks[] = {'\t', '\r', '\n', 0x001C, 0x001D, 0x001E, 0x001F,0}; + static const WCHAR blanks[] = {'\t', '\r', '\n', 0x001c, 0x001d, 0x001e, 0x001f, + 0x200b, 0x200c, 0x200d, 0x200e, 0x200f, /* ZWSP, ZWNJ, ZWJ, LRM, RLM */ + 0x202a, 0x202b, 0x202c, 0x202d, 0x202e, 0}; /* LRE, RLE, PDF, LRO, RLO */ HFONT font, oldfont = NULL; LOGFONTA lf;
@@ -1689,13 +1725,39 @@ hr = ScriptItemize(&blanks[j], 1, 2, NULL, NULL, items, NULL); ok(hr == S_OK, "%s: [%02x] expected S_OK, got %08x\n", lf.lfFaceName, blanks[j], hr);
+ ok(!items[0].a.fNoGlyphIndex, "%s: [%02x] got unexpected fNoGlyphIndex %#x.\n", + lf.lfFaceName, blanks[j], items[0].a.fNoGlyphIndex); hr = ScriptShape(hdc, &sc, &blanks[j], 1, 1, &items[0].a, glyphs2, logclust, attrs, &nb); ok(hr == S_OK, "%s: [%02x] expected S_OK, got %08x\n", lf.lfFaceName, blanks[j], hr); ok(nb == 1, "%s: [%02x] expected 1, got %d\n", lf.lfFaceName, blanks[j], nb); + ok(!items[0].a.fNoGlyphIndex, "%s: [%02x] got unexpected fNoGlyphIndex %#x.\n", + lf.lfFaceName, blanks[j], items[0].a.fNoGlyphIndex);
ok(glyphs[0] == glyphs2[0] || broken(glyphs2[0] == blanks[j] && (blanks[j] < 0x10)), "%s: [%02x] expected %04x, got %04x\n", lf.lfFaceName, blanks[j], glyphs[0], glyphs2[0]); + ok(attrs[0].fZeroWidth || broken(!attrs[0].fZeroWidth && (blanks[j] < 0x10) /* Vista */), + "%s: [%02x] got unexpected fZeroWidth %#x.\n", lf.lfFaceName, blanks[j], attrs[0].fZeroWidth); + + items[0].a.fNoGlyphIndex = 1; + hr = ScriptShape(hdc, &sc, &blanks[j], 1, 1, &items[0].a, glyphs2, logclust, attrs, &nb); + ok(hr == S_OK, "%s: [%02x] expected S_OK, got %08x\n", lf.lfFaceName, blanks[j], hr); + ok(nb == 1, "%s: [%02x] expected 1, got %d\n", lf.lfFaceName, blanks[j], nb); + + if (blanks[j] == 0x200b || blanks[j] == 0x200c || blanks[j] == 0x200d) + { + ok(glyphs2[0] == 0x0020, + "%s: [%02x] got unexpected %04x.\n", lf.lfFaceName, blanks[j], glyphs2[0]); + ok(attrs[0].fZeroWidth, "%s: [%02x] got unexpected fZeroWidth %#x.\n", + lf.lfFaceName, blanks[j], attrs[0].fZeroWidth); + } + else + { + ok(glyphs2[0] == blanks[j], + "%s: [%02x] got unexpected %04x.\n", lf.lfFaceName, blanks[j], glyphs2[0]); + ok(!attrs[0].fZeroWidth, "%s: [%02x] got unexpected fZeroWidth %#x.\n", + lf.lfFaceName, blanks[j], attrs[0].fZeroWidth); + } } if (oldfont) DeleteObject(SelectObject(hdc, oldfont)); @@ -2391,10 +2453,7 @@ ok (hr == S_OK, "ScriptTextOut should return S_OK not (%08x)\n", hr);
/* Test Rect Rgn is acceptable */ - rect.top = 10; - rect.bottom = 20; - rect.left = 10; - rect.right = 40; + SetRect(&rect, 10, 10, 40, 20); hr = ScriptTextOut(hdc, &psc, 0, 0, 0, &rect, &pItem[0].a, NULL, 0, pwOutGlyphs1, pcGlyphs, piAdvance, NULL, pGoffset); ok (hr == S_OK, "ScriptTextOut should return S_OK not (%08x)\n", hr); @@ -2557,10 +2616,7 @@ ok (hr == S_OK, "Should return S_OK not (%08x)\n", hr);
/* Test Rect Rgn is acceptable */ - rect.top = 10; - rect.bottom = 20; - rect.left = 10; - rect.right = 40; + SetRect(&rect, 10, 10, 40, 20); hr = ScriptTextOut(hdc, &psc, 0, 0, 0, &rect, &pItem[0].a, NULL, 0, pwOutGlyphs1, pcGlyphs, piAdvance, NULL, pGoffset); ok (hr == S_OK, "ScriptTextOut should return S_OK not (%08x)\n", hr);