Vijay Kiran Kamuju : ucrtbase/tests: Add tests for strftime formats %r and %V.

Alexandre Julliard julliard at winehq.org
Fri Nov 1 15:37:48 CDT 2019


Module: wine
Branch: master
Commit: ea1398382c2ae319045fe7118fbaba0f9372f6d4
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=ea1398382c2ae319045fe7118fbaba0f9372f6d4

Author: Vijay Kiran Kamuju <infyquest at gmail.com>
Date:   Fri Nov  1 10:16:05 2019 +0100

ucrtbase/tests: Add tests for strftime formats %r and %V.

Signed-off-by: Vijay Kiran Kamuju <infyquest at gmail.com>
Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ucrtbase/tests/misc.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/dlls/ucrtbase/tests/misc.c b/dlls/ucrtbase/tests/misc.c
index 8a6fb7b8e1..3a1598fee2 100644
--- a/dlls/ucrtbase/tests/misc.c
+++ b/dlls/ucrtbase/tests/misc.c
@@ -904,6 +904,7 @@ static void test_strftime(void)
 {
     const struct tm epoch = { 0, 0, 0, 1, 0, 70, 4, 0, 0 };
     const struct tm tm1 = { 0, 0, 0, 1, 0, 117, 0, 0, 0 };
+    const struct tm tm2 = { 0, 0, 14, 1, 0, 121, 6, 0, 0 };
     char bufA[256];
     size_t retA;
     int i;
@@ -964,6 +965,14 @@ static void test_strftime(void)
     ok(retA == 1, "expected 1, got %d\n", (int)retA);
     ok(!strcmp(bufA, "\n"), "got %s\n", bufA);
 
+    retA = p_strftime(bufA, sizeof(bufA), "%r", &epoch);
+    todo_wine ok(retA == 11, "expected 11, got %d\n", (int)retA);
+    todo_wine ok(!strcmp(bufA, "12:00:00 AM"), "got %s\n", bufA);
+
+    retA = p_strftime(bufA, sizeof(bufA), "%r", &tm2);
+    todo_wine ok(retA == 11, "expected 11, got %d\n", (int)retA);
+    todo_wine ok(!strcmp(bufA, "02:00:00 PM"), "got %s\n", bufA);
+
     retA = p_strftime(bufA, sizeof(bufA), "%t", &epoch);
     ok(retA == 1, "expected 1, got %d\n", (int)retA);
     ok(!strcmp(bufA, "\t"), "got %s\n", bufA);
@@ -984,6 +993,18 @@ static void test_strftime(void)
     ok(retA == 4, "expected 4, got %d\n", (int)retA);
     ok(!strcmp(bufA, "2016"), "got %s\n", bufA);
 
+    retA = p_strftime(bufA, sizeof(bufA), "%V", &epoch);
+    todo_wine ok(retA == 2, "expected 2, got %d\n", (int)retA);
+    todo_wine ok(!strcmp(bufA, "01"), "got %s\n", bufA);
+
+    retA = p_strftime(bufA, sizeof(bufA), "%V", &tm1);
+    todo_wine ok(retA == 2, "expected 2, got %d\n", (int)retA);
+    todo_wine ok(!strcmp(bufA, "52"), "got %s\n", bufA);
+
+    retA = p_strftime(bufA, sizeof(bufA), "%V", &tm2);
+    todo_wine ok(retA == 2, "expected 2, got %d\n", (int)retA);
+    todo_wine ok(!strcmp(bufA, "53"), "got %s\n", bufA);
+
     for(i=0; i<14; i++)
     {
         __time32_t t = (365*2 + i - 7) * 24 * 60 * 60;




More information about the wine-cvs mailing list