Zac Brown : winhttp: Add test for WinHttpTimeFromSystemTime.

Alexandre Julliard julliard at winehq.org
Tue Aug 19 08:46:53 CDT 2008


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

Author: Zac Brown <zac at zacbrown.org>
Date:   Thu Aug 14 14:54:18 2008 -0700

winhttp: Add test for WinHttpTimeFromSystemTime.

---

 dlls/winhttp/tests/winhttp.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/dlls/winhttp/tests/winhttp.c b/dlls/winhttp/tests/winhttp.c
index 3b43550..c3878a9 100644
--- a/dlls/winhttp/tests/winhttp.c
+++ b/dlls/winhttp/tests/winhttp.c
@@ -146,8 +146,24 @@ static void test_SendRequest (void)
     todo_wine ok(ret == TRUE, "WinHttpCloseHandle failed on closing session, got %d.\n", ret);
 }
 
+static void test_WinHttpTimeFromSystemTime(void)
+{
+    BOOL ret;
+    static const SYSTEMTIME time = {2008, 7, 1, 28, 10, 5, 52, 0};
+    static const WCHAR expected_string[] =
+        {'M','o','n',',',' ','2','8',' ','J','u','l',' ','2','0','0','8',' ',
+         '1','0',':','0','5',':','5','2',' ','G','M','T',0};
+    WCHAR time_string[WINHTTP_TIME_FORMAT_BUFSIZE+1];
+
+    ret = WinHttpTimeFromSystemTime(&time, time_string);
+    todo_wine ok(ret == TRUE, "WinHttpTimeFromSystemTime failed: %u\n", GetLastError());
+    todo_wine ok(memcmp(time_string, expected_string, sizeof(expected_string)) == 0,
+        "Time string returned did not match expected time string.\n");
+}
+
 START_TEST (winhttp)
 {
     test_OpenRequest();
     test_SendRequest();
+    test_WinHttpTimeFromSystemTime();
 }




More information about the wine-cvs mailing list