Commit ea139838 authored by Vijay Kiran Kamuju's avatar Vijay Kiran Kamuju Committed by Alexandre Julliard

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

parent fde9de91
...@@ -904,6 +904,7 @@ static void test_strftime(void) ...@@ -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 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 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]; char bufA[256];
size_t retA; size_t retA;
int i; int i;
...@@ -964,6 +965,14 @@ static void test_strftime(void) ...@@ -964,6 +965,14 @@ static void test_strftime(void)
ok(retA == 1, "expected 1, got %d\n", (int)retA); ok(retA == 1, "expected 1, got %d\n", (int)retA);
ok(!strcmp(bufA, "\n"), "got %s\n", bufA); 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); retA = p_strftime(bufA, sizeof(bufA), "%t", &epoch);
ok(retA == 1, "expected 1, got %d\n", (int)retA); ok(retA == 1, "expected 1, got %d\n", (int)retA);
ok(!strcmp(bufA, "\t"), "got %s\n", bufA); ok(!strcmp(bufA, "\t"), "got %s\n", bufA);
...@@ -984,6 +993,18 @@ static void test_strftime(void) ...@@ -984,6 +993,18 @@ static void test_strftime(void)
ok(retA == 4, "expected 4, got %d\n", (int)retA); ok(retA == 4, "expected 4, got %d\n", (int)retA);
ok(!strcmp(bufA, "2016"), "got %s\n", bufA); 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++) for(i=0; i<14; i++)
{ {
__time32_t t = (365*2 + i - 7) * 24 * 60 * 60; __time32_t t = (365*2 + i - 7) * 24 * 60 * 60;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment