Jacek Caban : vbscript: Add Hour function implementation.
Alexandre Julliard
julliard at winehq.org
Mon Sep 30 16:19:08 CDT 2019
Module: wine
Branch: master
Commit: cb16190ec15e7d5c9a61088cfa0f1126fc5da1e7
URL: https://source.winehq.org/git/wine.git/?a=commit;h=cb16190ec15e7d5c9a61088cfa0f1126fc5da1e7
Author: Jacek Caban <jacek at codeweavers.com>
Date: Mon Sep 30 20:19:51 2019 +0200
vbscript: Add Hour function implementation.
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/vbscript/global.c | 9 +++++++--
dlls/vbscript/tests/api.vbs | 3 +++
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/dlls/vbscript/global.c b/dlls/vbscript/global.c
index 4201ac1a15..bd6596a928 100644
--- a/dlls/vbscript/global.c
+++ b/dlls/vbscript/global.c
@@ -1648,8 +1648,13 @@ static HRESULT Global_Year(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARI
static HRESULT Global_Hour(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
{
- FIXME("\n");
- return E_NOTIMPL;
+ SYSTEMTIME st;
+ HRESULT hres;
+
+ TRACE("(%s)\n", debugstr_variant(arg));
+
+ hres = to_system_time(arg, &st);
+ return FAILED(hres) ? hres : return_short(res, st.wHour);
}
static HRESULT Global_Minute(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
diff --git a/dlls/vbscript/tests/api.vbs b/dlls/vbscript/tests/api.vbs
index 9e73e668c8..38dbe68bcb 100644
--- a/dlls/vbscript/tests/api.vbs
+++ b/dlls/vbscript/tests/api.vbs
@@ -1448,6 +1448,9 @@ Call ok(getVT(Month(now)) = "VT_I2", "getVT(Month(now)) = " & getVT(Month(now)))
Call ok(Month(2) = 1, "Month(2) = " & Month(2))
Call ok(getVT(Year(now)) = "VT_I2", "getVT(Year(now)) = " & getVT(Year(now)))
Call ok(Year(2) = 1900, "Year(2) = " & Year(2))
+Call ok(getVT(Hour(now)) = "VT_I2", "getVT(Hour(now)) = " & getVT(Hour(now)))
+Call ok(Hour(2) = 0, "Hour(2) = " & Hour(2))
+Call ok(Hour(2.75) = 18, "Hour(2) = " & Hour(2.75))
Sub testRGBError(arg1, arg2, arg3, error_num)
on error resume next
More information about the wine-cvs
mailing list