Commit f5aaaf21 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

msxml3/tests: Don't overwrite a variant which is later used in a QueryInterface call.

parent 843ef11e
......@@ -656,7 +656,7 @@ static void test_xmlelem_collection(void)
WCHAR path[MAX_PATH];
LONG length, type;
ULONG num_vars;
VARIANT var, vIndex, vName;
VARIANT var, dummy, vIndex, vName;
BSTR url, str;
static const CHAR szBankXML[] = "bank.xml";
static const WCHAR szNumber[] = {'N','U','M','B','E','R',0};
......@@ -766,14 +766,16 @@ static void test_xmlelem_collection(void)
ok(num_vars == 1, "Expected 1, got %d\n", num_vars);
/* try advance further, no children left */
hr = IEnumVARIANT_Next(enumVar, 1, &var, &num_vars);
V_VT(&dummy) = VT_I4;
hr = IEnumVARIANT_Next(enumVar, 1, &dummy, &num_vars);
ok(hr == S_FALSE, "Expected S_FALSE, got %08x\n", hr);
ok(V_VT(&var) == 0, "Expected 0, got %d\n", V_VT(&var));
ok(V_VT(&dummy) == VT_EMPTY, "Expected 0, got %d\n", V_VT(&dummy));
ok(num_vars == 0, "Expected 0, got %d\n", num_vars);
hr = IEnumVARIANT_Next(enumVar, 1, &var, NULL);
V_VT(&dummy) = VT_I4;
hr = IEnumVARIANT_Next(enumVar, 1, &dummy, NULL);
ok(hr == S_FALSE, "Expected S_FALSE, got %08x\n", hr);
ok(V_VT(&var) == 0, "Expected 0, got %d\n", V_VT(&var));
ok(V_VT(&dummy) == VT_EMPTY, "Expected 0, got %d\n", V_VT(&dummy));
hr = IDispatch_QueryInterface(V_DISPATCH(&var), &IID_IXMLElement, (LPVOID *)&child);
ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
......
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