WININET: implement InternetTime{From,To}SystemTime{A,W} (#2)
Dmitry Timoshkov
dmitry at baikal.ru
Mon Jan 10 10:58:48 CST 2005
"Hans Leidekker" <hans at it.vu.nl> wrote:
> Changelog:
> Implement and test InternetTime{From,To}SystemTime{A,W}.
If you could also make the attached tests pass (applied over
your tests) that would be great. The tests show that strings
should be parsed a bit smarter and comparisons should be case
insensitive.
--
Dmitry.
-------------- next part --------------
--- http.c Mon Jan 10 16:46:35 2005
+++ http.c Mon Jan 10 16:58:10 2005
@@ -403,10 +403,15 @@ static void InternetTimeToSystemTimeA_te
SYSTEMTIME time;
static const SYSTEMTIME expect = { 2005, 1, 5, 7, 12, 6, 35, 0 };
static const char string[] = "Fri, 07 Jan 2005 12:06:35 GMT";
+ static const char string2[] = "fri, 7 jan 2005 12:06:35 gmt";
ret = InternetTimeToSystemTimeA( string, &time, 0 );
ok( ret, "InternetTimeToSystemTimeA failed (%ld)\n", GetLastError() );
+ ok( !memcmp( &time, &expect, sizeof(expect) ),
+ "InternetTimeToSystemTimeA failed (%ld)\n", GetLastError() );
+ ret = InternetTimeToSystemTimeA( string2, &time, 0 );
+ ok( ret, "InternetTimeToSystemTimeA failed (%ld)\n", GetLastError() );
ok( !memcmp( &time, &expect, sizeof(expect) ),
"InternetTimeToSystemTimeA failed (%ld)\n", GetLastError() );
}
@@ -418,10 +423,16 @@ static void InternetTimeToSystemTimeW_te
static const SYSTEMTIME expect = { 2005, 1, 5, 7, 12, 6, 35, 0 };
static const WCHAR string[] = { 'F','r','i',',',' ','0','7',' ','J','a','n',' ','2','0','0','5',' ',
'1','2',':','0','6',':','3','5',' ','G','M','T',0 };
+ static const WCHAR string2[] = { 'f','r','i',',',' ','7',' ','j','a','n',' ','2','0','0','5',' ',
+ '1','2',':','0','6',':','3','5',' ','g','m','t',0 };
ret = InternetTimeToSystemTimeW( string, &time, 0 );
ok( ret, "InternetTimeToSystemTimeW failed (%ld)\n", GetLastError() );
+ ok( !memcmp( &time, &expect, sizeof(expect) ),
+ "InternetTimeToSystemTimeW failed (%ld)\n", GetLastError() );
+ ret = InternetTimeToSystemTimeW( string2, &time, 0 );
+ ok( ret, "InternetTimeToSystemTimeW failed (%ld)\n", GetLastError() );
ok( !memcmp( &time, &expect, sizeof(expect) ),
"InternetTimeToSystemTimeW failed (%ld)\n", GetLastError() );
}
More information about the wine-devel
mailing list