[PATCH v2 2/5] msvcrt: Add additional strftime tests.

Jeff Smith whydoubt at gmail.com
Mon Nov 18 01:07:27 CST 2019


Signed-off-by: Jeff Smith <whydoubt at gmail.com>
---
 dlls/msvcrt/tests/time.c   |  6 ++++++
 dlls/ucrtbase/tests/misc.c | 11 +++++++++++
 2 files changed, 17 insertions(+)

diff --git a/dlls/msvcrt/tests/time.c b/dlls/msvcrt/tests/time.c
index c8acd848bf..4a3d81d2dd 100644
--- a/dlls/msvcrt/tests/time.c
+++ b/dlls/msvcrt/tests/time.c
@@ -612,8 +612,14 @@ static void test_strftime(void)
         {"e%#%e", "e%e", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }},
         {"%c", "01/01/70 00:00:00", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }},
         {"%c", "02/30/70 00:00:00", { 0, 0, 0, 30, 1, 70, 4, 0, 0 }, TRUE},
+        {"%#c", "Thursday, January 01, 1970 00:00:00", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }},
+        {"%#c", "Thursday, February 30, 1970 00:00:00", { 0, 0, 0, 30, 1, 70, 4, 0, 0 }, TRUE},
         {"%x", "01/01/70", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }},
+        {"%x", "02/30/70", { 0, 0, 0, 30, 1, 70, 4, 0, 0 }, TRUE},
+        {"%#x", "Thursday, January 01, 1970", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }},
+        {"%#x", "Thursday, February 30, 1970", { 0, 0, 0, 30, 1, 70, 4, 0, 0 }, TRUE},
         {"%X", "00:00:00", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }},
+        {"%X", "14:00:00", { 0, 0, 14, 1, 0, 70, 4, 0, 0 }},
         {"%a", "Thu", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }},
         {"%A", "Thursday", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }},
         {"%b", "Jan", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }},
diff --git a/dlls/ucrtbase/tests/misc.c b/dlls/ucrtbase/tests/misc.c
index fb138a0fa4..fa5f29372c 100644
--- a/dlls/ucrtbase/tests/misc.c
+++ b/dlls/ucrtbase/tests/misc.c
@@ -936,6 +936,17 @@ static void test_strftime(void)
         {"%g", "72", { 0, 0, 0, 3, 0, 72, 1, 2, 0 }},
         {"%G", "1971", { 0, 0, 0, 2, 0, 72, 0, 1, 0 }},
         {"%G", "1972", { 0, 0, 0, 3, 0, 72, 1, 2, 0 }},
+        {"%c", "Thu Jan  1 00:00:00 1970", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }, TRUE},
+        {"%c", "Thu Feb 30 00:00:00 1970", { 0, 0, 0, 30, 1, 70, 4, 0, 0 }, TRUE},
+        {"%#c", "Thursday, January 01, 1970 00:00:00", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }},
+        {"%#c", "Thursday, February 30, 1970 00:00:00", { 0, 0, 0, 30, 1, 70, 4, 0, 0 }, TRUE},
+        {"%x", "01/01/70", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }},
+        {"%x", "02/30/70", { 0, 0, 0, 30, 1, 70, 4, 0, 0 }, TRUE},
+        {"%#x", "Thursday, January 01, 1970", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }},
+        {"%#x", "Thursday, February 30, 1970", { 0, 0, 0, 30, 1, 70, 4, 0, 0 }, TRUE},
+        {"%X", "00:00:00", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }},
+        {"%X", "14:00:00", { 0, 0, 14, 1, 0, 70, 4, 0, 0 }},
+        {"%X", "23:59:60", { 60, 59, 23, 1, 0, 70, 4, 0, 0 }, TRUE},
     };
 
     const struct tm epoch = { 0, 0, 0, 1, 0, 70, 4, 0, 0 };
-- 
2.23.0




More information about the wine-devel mailing list