[PATCH 3/5] jscript/tests: Add tests for persistent named items.

Gabriel Ivăncescu gabrielopcode at gmail.com
Tue Mar 24 08:42:21 CDT 2020


Hi Jacek,

On 24/03/2020 02:38, Jacek Caban wrote:
> Hi Gabriel,
> 
> On 23.03.2020 14:53, Gabriel Ivăncescu wrote:
>>      SET_EXPECT(OnStateChange_CONNECTED);
>> -    SET_EXPECT_MULTI(OnEnterScript, 4);
>> -    SET_EXPECT_MULTI(OnLeaveScript, 4);
>> +    SET_EXPECT_MULTI(OnEnterScript, 5);
>> +    SET_EXPECT_MULTI(OnLeaveScript, 5);
>> +    SET_EXPECT(GetIDsOfNames);
>>       hr = IActiveScript_SetScriptState(script, SCRIPTSTATE_CONNECTED);
>>       ok(hr == S_OK, "SetScriptState(SCRIPTSTATE_CONNECTED) failed: 
>> %08x\n", hr);
>>       CHECK_CALLED(OnStateChange_CONNECTED);
>> -    CHECK_CALLED_MULTI(OnEnterScript, 4);
>> -    CHECK_CALLED_MULTI(OnLeaveScript, 4);
>> +    CHECK_CALLED_MULTI(OnEnterScript, 5);
>> +    CHECK_CALLED_MULTI(OnLeaveScript, 5);
>> +    todo_wine CHECK_CALLED(GetIDsOfNames);
>>       test_state(script, SCRIPTSTATE_CONNECTED);
> 
> 
> Before this patch that code verified that GetIDsOfNames is not called 
> for any code. Now, after your change, it does no longer does that. 
> Please try to move the test into a separated pass instead of mixing all 
> tests together.
> 

I can't really move it to a separate test, it's because the 'var x' 
itself calls it, which is needed to test the persistent item + 
persistent code relationship, so I can't get rid of that variable.

However I can use the new 'expected_GetIDsOfNames_iface' variable to 
test that it's only the specific iface (persistent item) that is called 
here. Is that a good approach?

Thanks,
Gabriel



More information about the wine-devel mailing list