James Hawkins : usp10: Fix several failing test in win2k3.
Alexandre Julliard
julliard at winehq.org
Wed May 28 04:56:54 CDT 2008
Module: wine
Branch: master
Commit: a4c10fda8e13827de96fa1b8fd40a9435fd8d9be
URL: http://source.winehq.org/git/wine.git/?a=commit;h=a4c10fda8e13827de96fa1b8fd40a9435fd8d9be
Author: James Hawkins <jhawkins at codeweavers.com>
Date: Tue May 27 11:16:01 2008 -0500
usp10: Fix several failing test in win2k3.
---
dlls/usp10/tests/usp10.c | 73 ++++++++++++++++++++++++++++++++++-----------
1 files changed, 55 insertions(+), 18 deletions(-)
diff --git a/dlls/usp10/tests/usp10.c b/dlls/usp10/tests/usp10.c
index 252f7d9..3902e2b 100644
--- a/dlls/usp10/tests/usp10.c
+++ b/dlls/usp10/tests/usp10.c
@@ -635,54 +635,74 @@ static void test_ScriptXtoX(void)
cGlyphs = 10;
hr = ScriptXtoCP(iX, cChars, cGlyphs, pwLogClust, psva, piAdvance, &psa, &piCP, &piTrailing);
ok(hr == S_OK, "ScriptXtoCP should return S_OK not %08x\n", hr);
- ok(piCP == -1, "Negative iX should return piCP=-1 not %d\n", piCP);
- ok(piTrailing == TRUE, "Negative iX should return piTrailing=TRUE not %d\n", piTrailing);
+ if (piTrailing)
+ ok(piCP == -1, "Negative iX should return piCP=-1 not %d\n", piCP);
+ else /* win2k3 */
+ ok(piCP == 10, "Negative iX should return piCP=10 not %d\n", piCP);
+
iX = 1954;
cChars = 10;
cGlyphs = 10;
hr = ScriptXtoCP(iX, cChars, cGlyphs, pwLogClust, psva, piAdvance, &psa, &piCP, &piTrailing);
ok(hr == S_OK, "ScriptXtoCP should return S_OK not %08x\n", hr);
- ok(piCP == 10, "Excessive iX should return piCP=10 not %d\n", piCP);
- ok(piTrailing == FALSE, "Excessive iX should return piTrailing=FALSE not %d\n", piTrailing);
+ if (piTrailing) /* win2k3 */
+ ok(piCP == -1, "Negative iX should return piCP=-1 not %d\n", piCP);
+ else
+ ok(piCP == 10, "Negative iX should return piCP=10 not %d\n", piCP);
+
iX = 779;
cChars = 10;
cGlyphs = 10;
hr = ScriptXtoCP(iX, cChars, cGlyphs, pwLogClust, psva, piAdvance, &psa, &piCP, &piTrailing);
ok(hr == S_OK, "ScriptXtoCP should return S_OK not %08x\n", hr);
- ok(piCP == 3, "iX=%d should return piCP=3 not %d\n", iX, piCP);
+ ok(piCP == 3 ||
+ piCP == -1, /* win2k3 */
+ "iX=%d should return piCP=3 or piCP=-1 not %d\n", iX, piCP);
ok(piTrailing == 1, "iX=%d should return piTrailing=1 not %d\n", iX, piTrailing);
+
iX = 780;
cChars = 10;
cGlyphs = 10;
hr = ScriptXtoCP(iX, cChars, cGlyphs, pwLogClust, psva, piAdvance, &psa, &piCP, &piTrailing);
ok(hr == S_OK, "ScriptXtoCP should return S_OK not %08x\n", hr);
- ok(piCP == 3, "iX=%d should return piCP=3 not %d\n", iX, piCP);
+ ok(piCP == 3 ||
+ piCP == -1, /* win2k3 */
+ "iX=%d should return piCP=3 or piCP=-1 not %d\n", iX, piCP);
ok(piTrailing == 1, "iX=%d should return piTrailing=1 not %d\n", iX, piTrailing);
+
iX = 868;
cChars = 10;
cGlyphs = 10;
hr = ScriptXtoCP(iX, cChars, cGlyphs, pwLogClust, psva, piAdvance, &psa, &piCP, &piTrailing);
ok(hr == S_OK, "ScriptXtoCP should return S_OK not %08x\n", hr);
- ok(piCP == 4, "iX=%d should return piCP=4 not %d\n", iX, piCP);
+ ok(piCP == 4 ||
+ piCP == -1, /* win2k3 */
+ "iX=%d should return piCP=4 or piCP=-1 not %d\n", iX, piCP);
iX = 0;
cChars = 10;
cGlyphs = 10;
hr = ScriptXtoCP(iX, cChars, cGlyphs, pwLogClust, psva, piAdvance, &psa, &piCP, &piTrailing);
ok(hr == S_OK, "ScriptXtoCP should return S_OK not %08x\n", hr);
- ok(piCP == 0, "iX=%d should return piCP=0 not %d\n", iX, piCP);
+ ok(piCP == 0 ||
+ piCP == 10, /* win2k3 */
+ "iX=%d should return piCP=0 piCP=10 not %d\n", iX, piCP);
+
iX = 195;
cChars = 10;
cGlyphs = 10;
hr = ScriptXtoCP(iX, cChars, cGlyphs, pwLogClust, psva, piAdvance, &psa, &piCP, &piTrailing);
ok(hr == S_OK, "ScriptXtoCP should return S_OK not %08x\n", hr);
ok(piCP == 0, "iX=%d should return piCP=0 not %d\n", iX, piCP);
+
iX = 196;
cChars = 10;
cGlyphs = 10;
hr = ScriptXtoCP(iX, cChars, cGlyphs, pwLogClust, psva, piAdvance, &psa, &piCP, &piTrailing);
ok(hr == S_OK, "ScriptXtoCP should return S_OK not %08x\n", hr);
- ok(piCP == 1, "iX=%d should return piCP=1 not %d\n", iX, piCP);
+ ok(piCP == 1 ||
+ piCP == 0, /* win2k3 */
+ "iX=%d should return piCP=1 or piCP=0 not %d\n", iX, piCP);
iCP=5;
fTrailing = FALSE;
@@ -690,36 +710,49 @@ static void test_ScriptXtoX(void)
cGlyphs = 10;
hr = ScriptCPtoX(iCP, fTrailing, cChars, cGlyphs, pwLogClust, psva, piAdvance, &psa, &piX);
ok(hr == S_OK, "ScriptCPtoX should return S_OK not %08x\n", hr);
- ok(piX == 976, "iCP=%d should return piX=976 not %d\n", iCP, piX);
+ ok(piX == 976 ||
+ piX == 100, /* win2k3 */
+ "iCP=%d should return piX=976 or piX=100 not %d\n", iCP, piX);
+
iCP=5;
fTrailing = TRUE;
cChars = 10;
cGlyphs = 10;
hr = ScriptCPtoX(iCP, fTrailing, cChars, cGlyphs, pwLogClust, psva, piAdvance, &psa, &piX);
ok(hr == S_OK, "ScriptCPtoX should return S_OK not %08x\n", hr);
- ok(piX == 1171, "iCP=%d should return piX=1171 not %d\n", iCP, piX);
+ ok(piX == 1171 ||
+ piX == 80, /* win2k3 */
+ "iCP=%d should return piX=1171 or piX=80 not %d\n", iCP, piX);
+
iCP=6;
fTrailing = FALSE;
cChars = 10;
cGlyphs = 10;
hr = ScriptCPtoX(iCP, fTrailing, cChars, cGlyphs, pwLogClust, psva, piAdvance, &psa, &piX);
ok(hr == S_OK, "ScriptCPtoX should return S_OK not %08x\n", hr);
- ok(piX == 1171, "iCP=%d should return piX=1171 not %d\n", iCP, piX);
+ ok(piX == 1171 ||
+ piX == 80, /* win2k3 */
+ "iCP=%d should return piX=1171 or piX=80 not %d\n", iCP, piX);
+
iCP=11;
fTrailing = FALSE;
cChars = 10;
cGlyphs = 10;
hr = ScriptCPtoX(iCP, fTrailing, cChars, cGlyphs, pwLogClust, psva, piAdvance, &psa, &piX);
ok(hr == S_OK, "ScriptCPtoX should return S_OK not %08x\n", hr);
- ok(piX == 1953, "iCP=%d should return piX=1953 not %d\n", iCP, piX);
+ ok(piX == 1953 ||
+ piX == 0, /* win2k3 */
+ "iCP=%d should return piX=1953 or piX=0 not %d\n", iCP, piX);
+
iCP=11;
fTrailing = TRUE;
cChars = 10;
cGlyphs = 10;
hr = ScriptCPtoX(iCP, fTrailing, cChars, cGlyphs, pwLogClust, psva, piAdvance, &psa, &piX);
ok(hr == S_OK, "ScriptCPtoX should return S_OK not %08x\n", hr);
- ok(piX == 1953, "iCP=%d should return piX=1953 not %d\n", iCP, piX);
-
+ ok(piX == 1953 ||
+ piX == 0, /* win2k3 */
+ "iCP=%d should return piX=1953 or piX=0 not %d\n", iCP, piX);
}
static void test_ScriptString(HDC hdc)
@@ -838,10 +871,14 @@ static void test_ScriptStringXtoCP_CPtoX(HDC hdc)
hr = ScriptStringAnalyse( hdc, String, String_len, Glyphs, Charset, Flags,
ReqWidth, &Control, &State, NULL, &Tabdef,
&InClass, &ssa);
- ok(hr == S_OK, "ScriptStringAnalyse should return S_OK not %08x\n", hr);
- ok(ssa != NULL, "ScriptStringAnalyse ssa should not be NULL\n");
- if (hr == 0)
+ ok(hr == S_OK ||
+ hr == E_INVALIDARG, /* NT */
+ "ScriptStringAnalyse should return S_OK or E_INVALIDARG not %08x\n", hr);
+
+ if (hr == S_OK)
{
+ ok(ssa != NULL, "ScriptStringAnalyse ssa should not be NULL\n");
+
/*
* Loop to generate character positions to provide starting positions for the
* ScriptStringCPtoX and ScriptStringXtoCP functions
More information about the wine-cvs
mailing list