usp10: Make tests pass on Win7. Conform to the more recent behavior.

This commit is contained in:
Hans Leidekker 2009-09-03 14:50:17 +02:00 committed by Alexandre Julliard
parent 70241904b9
commit f7a4936fc4
2 changed files with 25 additions and 14 deletions

View File

@ -67,9 +67,10 @@ static void test_ScriptShape(HDC hdc)
ok(hr == E_PENDING, "ScriptShape should return E_PENDING not %08x\n", hr);
hr = ScriptShape(hdc, &sc, test1, 4, 4, &items[0].a, glyphs, NULL, attrs, &nb);
ok(!hr ||
hr == E_INVALIDARG, /* Vista, W2K8 */
"ScriptShape should return S_OK or E_INVALIDARG, not %08x\n", hr);
ok(broken(hr == S_OK) ||
hr == E_INVALIDARG || /* Vista, W2K8 */
hr == E_FAIL, /* WIN7 */
"ScriptShape should return E_FAIL or E_INVALIDARG, not %08x\n", hr);
ok(items[0].a.fNoGlyphIndex == FALSE, "fNoGlyphIndex TRUE\n");
hr = ScriptShape(hdc, &sc, test1, 4, 4, &items[0].a, glyphs, logclust, attrs, &nb);
@ -83,17 +84,19 @@ static void test_ScriptShape(HDC hdc)
ok(hr == E_INVALIDARG, "ScriptPlace should return E_INVALIDARG not %08x\n", hr);
hr = ScriptPlace(NULL, &sc, glyphs, 4, attrs, &items[0].a, widths, NULL, NULL);
ok(hr == E_PENDING ||
hr == E_INVALIDARG, /* Vista, W2K8 */
"ScriptPlace should return E_PENDING or E_INVALIDARG, not %08x\n", hr);
ok(broken(hr == E_PENDING) ||
hr == E_INVALIDARG || /* Vista, W2K8 */
hr == E_FAIL, /* WIN7 */
"ScriptPlace should return E_FAIL or E_INVALIDARG, not %08x\n", hr);
hr = ScriptPlace(NULL, &sc, glyphs, 4, attrs, &items[0].a, widths, offset, NULL);
ok(hr == E_PENDING, "ScriptPlace should return E_PENDING not %08x\n", hr);
hr = ScriptPlace(NULL, &sc, glyphs, 4, attrs, &items[0].a, widths, NULL, abc);
ok(hr == E_PENDING ||
hr == E_INVALIDARG, /* Vista, W2K8 */
"ScriptPlace should return E_PENDING or E_INVALIDARG, not %08x\n", hr);
ok(broken(hr == E_PENDING) ||
hr == E_INVALIDARG || /* Vista, W2K8 */
hr == E_FAIL, /* WIN7 */
"ScriptPlace should return E_FAIL or E_INVALIDARG, not %08x\n", hr);
hr = ScriptPlace(hdc, &sc, glyphs, 4, attrs, &items[0].a, widths, offset, NULL);
ok(!hr, "ScriptPlace should return S_OK not %08x\n", hr);
@ -339,14 +342,14 @@ static void test_ScriptGetCMap(HDC hdc, unsigned short pwOutGlyphs[256])
/* Set psc to NULL, to be able to check if a pointer is returned in psc */
psc = NULL;
hr = ScriptGetCMap(NULL, &psc, NULL, 0, 0, NULL);
ok( hr == E_PENDING, "(NULL,&psc,NULL,0,0NULL), expected E_PENDING, "
hr = ScriptGetCMap(NULL, &psc, TestItem1, cInChars, 0, pwOutGlyphs3);
ok( hr == E_PENDING, "(NULL,&psc,NULL,0,0,NULL), expected E_PENDING, "
"got %08x\n", hr);
ok( psc == NULL, "Expected psc to be NULL, got %p\n", psc);
/* Set psc to NULL but add hdc, to be able to check if a pointer is returned in psc */
psc = NULL;
hr = ScriptGetCMap(hdc, &psc, NULL, 0, 0, NULL);
hr = ScriptGetCMap(hdc, &psc, TestItem1, cInChars, 0, pwOutGlyphs3);
ok( hr == S_OK, "ScriptGetCMap(NULL,&psc,NULL,0,0,NULL), expected S_OK, "
"got %08x\n", hr);
ok( psc != NULL, "ScritpGetCMap expected psc to be not NULL\n");
@ -1058,6 +1061,11 @@ static void test_ScriptGetGlyphABCWidth(HDC hdc)
ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got 0x%08x\n", hr);
hr = ScriptGetGlyphABCWidth(NULL, &sc, 'a', NULL);
ok(broken(hr == E_PENDING) ||
hr == E_INVALIDARG, /* WIN7 */
"expected E_INVALIDARG, got 0x%08x\n", hr);
hr = ScriptGetGlyphABCWidth(NULL, &sc, 'a', &abc);
ok(hr == E_PENDING, "expected E_PENDING, got 0x%08x\n", hr);
if (0) { /* crashes on WinXP */

View File

@ -1298,6 +1298,7 @@ HRESULT WINAPI ScriptShape(HDC hdc, SCRIPT_CACHE *psc, const WCHAR *pwcChars,
*pcGlyphs = cChars;
if ((hr = init_script_cache(hdc, psc)) != S_OK) return hr;
if (!pwLogClust) return E_FAIL;
if ((get_cache_pitch_family(psc) & TMPF_TRUETYPE) && !psa->fNoGlyphIndex)
{
@ -1329,7 +1330,7 @@ HRESULT WINAPI ScriptShape(HDC hdc, SCRIPT_CACHE *psc, const WCHAR *pwcChars,
psva[i].fReserved = 0;
psva[i].fShapeReserved = 0;
if (pwLogClust) pwLogClust[i] = i;
pwLogClust[i] = i;
}
return S_OK;
}
@ -1366,6 +1367,7 @@ HRESULT WINAPI ScriptPlace(HDC hdc, SCRIPT_CACHE *psc, const WORD *pwGlyphs,
if (!psva) return E_INVALIDARG;
if ((hr = init_script_cache(hdc, psc)) != S_OK) return hr;
if (!pGoffset) return E_FAIL;
if (pABC) memset(pABC, 0, sizeof(ABC));
for (i = 0; i < cGlyphs; i++)
@ -1394,7 +1396,7 @@ HRESULT WINAPI ScriptPlace(HDC hdc, SCRIPT_CACHE *psc, const WORD *pwGlyphs,
pABC->abcC += abc.abcC;
}
/* FIXME: set to more reasonable values */
if (pGoffset) pGoffset[i].du = pGoffset[i].dv = 0;
pGoffset[i].du = pGoffset[i].dv = 0;
if (piAdvance) piAdvance[i] = abc.abcA + abc.abcB + abc.abcC;
}
@ -1527,6 +1529,7 @@ HRESULT WINAPI ScriptGetGlyphABCWidth(HDC hdc, SCRIPT_CACHE *psc, WORD glyph, AB
TRACE("(%p, %p, 0x%04x, %p)\n", hdc, psc, glyph, abc);
if (!abc) return E_INVALIDARG;
if ((hr = init_script_cache(hdc, psc)) != S_OK) return hr;
if (!get_cache_glyph_widths(psc, glyph, abc))