Andrew Nguyen : usp10/tests: Avoid passing optional pointers to uninitialized structures in ScriptString tests .
Alexandre Julliard
julliard at winehq.org
Wed Feb 16 11:14:11 CST 2011
Module: wine
Branch: master
Commit: 6d0983972e9213c54c722468ead6ea79f5bd8212
URL: http://source.winehq.org/git/wine.git/?a=commit;h=6d0983972e9213c54c722468ead6ea79f5bd8212
Author: Andrew Nguyen <anguyen at codeweavers.com>
Date: Tue Feb 15 12:36:01 2011 -0600
usp10/tests: Avoid passing optional pointers to uninitialized structures in ScriptString tests.
---
dlls/usp10/tests/usp10.c | 21 ++++++---------------
1 files changed, 6 insertions(+), 15 deletions(-)
diff --git a/dlls/usp10/tests/usp10.c b/dlls/usp10/tests/usp10.c
index 8a06bd9..109b1db 100644
--- a/dlls/usp10/tests/usp10.c
+++ b/dlls/usp10/tests/usp10.c
@@ -1229,10 +1229,7 @@ static void test_ScriptString(HDC hdc)
int Charset;
DWORD Flags = SSA_GLYPHS;
int ReqWidth = 100;
- SCRIPT_CONTROL Control;
- SCRIPT_STATE State;
const int Dx[5] = {10, 10, 10, 10, 10};
- SCRIPT_TABDEF Tabdef;
const BYTE InClass = 0;
SCRIPT_STRING_ANALYSIS ssa = NULL;
@@ -1251,20 +1248,20 @@ static void test_ScriptString(HDC hdc)
Charset = -1; /* this flag indicates unicode input */
/* Test without hdc to get E_PENDING */
hr = ScriptStringAnalyse( NULL, teststr, len, Glyphs, Charset, Flags,
- ReqWidth, &Control, &State, Dx, &Tabdef,
- &InClass, &ssa);
+ ReqWidth, NULL, NULL, Dx, NULL,
+ &InClass, &ssa);
ok(hr == E_PENDING, "ScriptStringAnalyse Stub should return E_PENDING not %08x\n", hr);
/* test with hdc, this should be a valid test */
hr = ScriptStringAnalyse( hdc, teststr, len, Glyphs, Charset, Flags,
- ReqWidth, &Control, &State, Dx, &Tabdef,
+ ReqWidth, NULL, NULL, Dx, NULL,
&InClass, &ssa);
ok(hr == S_OK, "ScriptStringAnalyse should return S_OK not %08x\n", hr);
ScriptStringFree(&ssa);
/* test makes sure that a call with a valid pssa still works */
hr = ScriptStringAnalyse( hdc, teststr, len, Glyphs, Charset, Flags,
- ReqWidth, &Control, &State, Dx, &Tabdef,
+ ReqWidth, NULL, NULL, Dx, NULL,
&InClass, &ssa);
ok(hr == S_OK, "ScriptStringAnalyse should return S_OK not %08x\n", hr);
ok(ssa != NULL, "ScriptStringAnalyse pssa should not be NULL\n");
@@ -1309,9 +1306,6 @@ static void test_ScriptStringXtoCP_CPtoX(HDC hdc)
int Charset = -1; /* unicode */
DWORD Flags = SSA_GLYPHS;
int ReqWidth = 100;
- SCRIPT_CONTROL Control;
- SCRIPT_STATE State;
- SCRIPT_TABDEF Tabdef;
const BYTE InClass = 0;
SCRIPT_STRING_ANALYSIS ssa = NULL;
@@ -1326,12 +1320,9 @@ static void test_ScriptStringXtoCP_CPtoX(HDC hdc)
* Here we generate an SCRIPT_STRING_ANALYSIS that will be used as input to the
* following character positions to X and X to character position functions.
*/
- memset(&Control, 0, sizeof(SCRIPT_CONTROL));
- memset(&State, 0, sizeof(SCRIPT_STATE));
- memset(&Tabdef, 0, sizeof(SCRIPT_TABDEF));
hr = ScriptStringAnalyse( hdc, String, String_len, Glyphs, Charset, Flags,
- ReqWidth, &Control, &State, NULL, &Tabdef,
+ ReqWidth, NULL, NULL, NULL, NULL,
&InClass, &ssa);
ok(hr == S_OK ||
hr == E_INVALIDARG, /* NT */
@@ -1471,7 +1462,7 @@ static void test_ScriptStringXtoCP_CPtoX(HDC hdc)
* generate an SSA for the subsequent tests.
*/
hr = ScriptStringAnalyse( hdc, String, String_len, Glyphs, Charset, Flags,
- ReqWidth, &Control, &State, NULL, &Tabdef,
+ ReqWidth, NULL, NULL, NULL, NULL,
&InClass, &ssa);
ok(hr == S_OK, "ScriptStringAnalyse should return S_OK not %08x\n", hr);
More information about the wine-cvs
mailing list