Module: wine Branch: master Commit: 25118e53835dd19aad9a8a27e07e3b6344609a74 URL: http://source.winehq.org/git/wine.git/?a=commit;h=25118e53835dd19aad9a8a27e0...
Author: Jeremy Drake wine@jdrake.com Date: Wed Oct 6 23:26:54 2010 -0700
oleaut32/tests: Test conversion of ambiguous DATE values.
For 0.0 < x < 1.0, DATE values x and -x represent the same date/time: 30-Dec-1899 at some time determined by x. When converting from DATE, either value is accepted. When converting to DATE, the positive value is produced.
---
dlls/oleaut32/tests/vartest.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/dlls/oleaut32/tests/vartest.c b/dlls/oleaut32/tests/vartest.c index 1d02b3b..962a415 100644 --- a/dlls/oleaut32/tests/vartest.c +++ b/dlls/oleaut32/tests/vartest.c @@ -1615,6 +1615,9 @@ static void test_VarUdateFromDate(void) } /* This just demostrates the non-linear nature of values prior to the epoch */ DT2UD(-4.0,0,S_OK,26,12,1899,0,0,0,0,2,360); + /* Numerical oddity: for 0.0 < x < 1.0, x and -x represent the same datetime */ + todo_wine DT2UD(-0.25,0,S_OK,30,12,1899,6,0,0,0,6,364); + DT2UD(0.25,0,S_OK,30,12,1899,6,0,0,0,6,364); }
@@ -1686,6 +1689,9 @@ static void test_VarDateFromUdate(void) } /* This just demostrates the non-linear nature of values prior to the epoch */ UD2T(26,12,1899,0,0,0,0,2,360,0,S_OK,-4.0); + /* for DATE values 0.0 < x < 1.0, x and -x represent the same datetime */ + /* but when converting to DATE, prefer the positive versions */ + UD2T(30,12,1899,6,0,0,0,6,364,0,S_OK,0.25); }
static void test_st2dt(int line, WORD d, WORD m, WORD y, WORD h, WORD mn,