Daniel Lehman : propsys/tests: Add some InitVariantFromFileTime tests.
Alexandre Julliard
julliard at winehq.org
Thu Mar 17 17:18:32 CDT 2022
Module: wine
Branch: master
Commit: 083dea7fce4372840ac18176496a7d05dadd5ad8
URL: https://source.winehq.org/git/wine.git/?a=commit;h=083dea7fce4372840ac18176496a7d05dadd5ad8
Author: Daniel Lehman <dlehman at esri.com>
Date: Tue Mar 15 07:17:37 2022 -0700
propsys/tests: Add some InitVariantFromFileTime tests.
Signed-off-by: Daniel Lehman <dlehman at esri.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/propsys/tests/propsys.c | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
diff --git a/dlls/propsys/tests/propsys.c b/dlls/propsys/tests/propsys.c
index 36b1a9dca8e..124b3405bcb 100644
--- a/dlls/propsys/tests/propsys.c
+++ b/dlls/propsys/tests/propsys.c
@@ -2030,6 +2030,40 @@ static void test_PSCreatePropertyStoreFromObject(void)
IPropertyStore_Release(propstore);
}
+static void test_InitVariantFromFileTime(void)
+{
+ FILETIME ft = {0};
+ SYSTEMTIME st;
+ VARIANT var;
+ HRESULT hr;
+ double d;
+
+ VariantInit(&var);
+ if (0) /* crash on Windows */
+ {
+ InitVariantFromFileTime(&ft, NULL);
+ InitVariantFromFileTime(NULL, &var);
+ }
+
+ ft.dwHighDateTime = -1;
+ ft.dwLowDateTime = -1;
+ V_VT(&var) = 0xdead;
+ V_DATE(&var) = 42.0;
+ hr = InitVariantFromFileTime(&ft, &var);
+ ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
+ ok(V_VT(&var) == VT_EMPTY, "Unexpected VT %d\n", V_VT(&var));
+ ok(V_DATE(&var) == 0.0, "got wrong value: %f, expected 0.0\n", V_DATE(&var));
+
+ GetSystemTimeAsFileTime(&ft);
+ hr = InitVariantFromFileTime(&ft, &var);
+ ok(V_VT(&var) == VT_DATE, "Unexpected VT %d\n", V_VT(&var));
+ ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
+
+ FileTimeToSystemTime(&ft, &st);
+ SystemTimeToVariantTime(&st, &d);
+ ok(V_DATE(&var) == d, "got wrong value: %f, expected %f\n", V_DATE(&var), d);
+}
+
START_TEST(propsys)
{
test_PSStringFromPropertyKey();
@@ -2053,4 +2087,5 @@ START_TEST(propsys)
test_PSCreateMemoryPropertyStore();
test_propertystore();
test_PSCreatePropertyStoreFromObject();
+ test_InitVariantFromFileTime();
}
More information about the wine-cvs
mailing list