Jacek Caban : jscript: Added test of Date object default value.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Dec 15 15:32:06 CST 2014


Module: wine
Branch: master
Commit: ceaf8bfd837946edf179408ea380c11dd98e6805
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=ceaf8bfd837946edf179408ea380c11dd98e6805

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Sat Dec 13 11:47:52 2014 +1100

jscript: Added test of Date object default value.

---

 dlls/jscript/tests/run.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/dlls/jscript/tests/run.c b/dlls/jscript/tests/run.c
index 122db60..1adc25d 100644
--- a/dlls/jscript/tests/run.c
+++ b/dlls/jscript/tests/run.c
@@ -1945,6 +1945,30 @@ static HRESULT parse_script_expr(const char *expr, VARIANT *res)
     return hres;
 }
 
+static void test_default_value(void)
+{
+    DISPPARAMS dp = {0};
+    IDispatch *disp;
+    VARIANT v;
+    HRESULT hres;
+
+    hres = parse_script_expr("new Date()", &v);
+    ok(hres == S_OK, "parse_script_expr failed: %08x\n", hres);
+    ok(V_VT(&v) == VT_DISPATCH, "V_VT(v) = %d", V_VT(&v));
+    disp = V_DISPATCH(&v);
+
+    V_VT(&v) = VT_EMPTY;
+    hres = IDispatch_Invoke(disp, DISPID_VALUE, &IID_NULL, 0, DISPATCH_PROPERTYGET, &dp, &v, NULL, NULL);
+    ok(hres == S_OK || broken(hres == 0x8000ffff), "Invoke failed: %08x\n", hres);
+    if(hres == S_OK)
+    {
+        ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
+    }
+
+    VariantClear(&v);
+    IDispatch_Release(disp);
+}
+
 static void test_script_exprs(void)
 {
     VARIANT v;
@@ -1988,6 +2012,8 @@ static void test_script_exprs(void)
     CHECK_CALLED(global_success_d);
     CHECK_CALLED(global_success_i);
 
+    test_default_value();
+
     testing_expr = FALSE;
 }
 




More information about the wine-cvs mailing list