Commit f192f2f1 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

jscript: Support type conversion to VT_UI2.

parent 02da0edd
......@@ -894,6 +894,14 @@ HRESULT variant_change_type(script_ctx_t *ctx, VARIANT *dst, VARIANT *src, VARTY
}
break;
}
case VT_UI2: {
UINT32 i;
hres = to_uint32(ctx, val, &i);
if(SUCCEEDED(hres))
V_UI2(dst) = i;
break;
}
case VT_R8: {
double n;
hres = to_number(ctx, val, &n);
......
......@@ -136,6 +136,9 @@ static void test_change_type(IVariantChangeType *change_type, VARIANT *src, cons
call_change_type(change_type, &v, src, VT_I4);
ok(V_I4(&v) == ex->int_result, "V_I4(v) = %d, expected %d\n", V_I4(&v), ex->int_result);
call_change_type(change_type, &v, src, VT_UI2);
ok(V_UI2(&v) == (UINT16)ex->int_result, "V_UI2(v) = %u, expected %u\n", V_UI2(&v), (UINT16)ex->int_result);
call_change_type(change_type, &v, src, VT_BSTR);
ok(!strcmp_wa(V_BSTR(&v), ex->str_result), "V_BSTR(v) = %s, expected %s\n", wine_dbgstr_w(V_BSTR(&v)), ex->str_result);
VariantClear(&v);
......
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