1313
1414TEST (LlvmLibcLocaltimeR, ValidUnixTimestamp0) {
1515 const time_t t_ptr = 1 ;
16- static struct tm input = (struct tm ) {
17- .tm_sec = 0 ,
18- .tm_min = 0 ,
19- .tm_hour = 0 ,
20- .tm_mday = 0 ,
21- .tm_mon = 0 ,
22- .tm_year = 0 ,
23- .tm_wday = 0 ,
24- .tm_yday = 0 ,
25- .tm_isdst = 0
26- };
16+ static struct tm input = (struct tm ){.tm_sec = 0 ,
17+ .tm_min = 0 ,
18+ .tm_hour = 0 ,
19+ .tm_mday = 0 ,
20+ .tm_mon = 0 ,
21+ .tm_year = 0 ,
22+ .tm_wday = 0 ,
23+ .tm_yday = 0 ,
24+ .tm_isdst = 0 };
2725 struct tm *result = LIBC_NAMESPACE::localtime_r (&t_ptr, &input);
2826 ASSERT_EQ (70 , result->tm_year );
2927 ASSERT_EQ (0 , result->tm_mon );
@@ -38,17 +36,15 @@ TEST(LlvmLibcLocaltimeR, ValidUnixTimestamp0) {
3836
3937TEST (LlvmLibcLocaltimeR, ValidUnixTimestamp32Int) {
4038 time_t t_ptr = 2147483647 ;
41- static struct tm input = (struct tm ) {
42- .tm_sec = 0 ,
43- .tm_min = 0 ,
44- .tm_hour = 0 ,
45- .tm_mday = 0 ,
46- .tm_mon = 0 ,
47- .tm_year = 0 ,
48- .tm_wday = 0 ,
49- .tm_yday = 0 ,
50- .tm_isdst = 0
51- };
39+ static struct tm input = (struct tm ){.tm_sec = 0 ,
40+ .tm_min = 0 ,
41+ .tm_hour = 0 ,
42+ .tm_mday = 0 ,
43+ .tm_mon = 0 ,
44+ .tm_year = 0 ,
45+ .tm_wday = 0 ,
46+ .tm_yday = 0 ,
47+ .tm_isdst = 0 };
5248 struct tm *result = LIBC_NAMESPACE::localtime_r (&t_ptr, &input);
5349 ASSERT_EQ (138 , result->tm_year );
5450 ASSERT_EQ (0 , result->tm_mon );
@@ -63,17 +59,15 @@ TEST(LlvmLibcLocaltimeR, ValidUnixTimestamp32Int) {
6359
6460TEST (LlvmLibcLocaltimeR, ValidUnixTimestamp32IntDst) {
6561 time_t t_ptr = 1627225465 ;
66- static struct tm input = (struct tm ) {
67- .tm_sec = 0 ,
68- .tm_min = 0 ,
69- .tm_hour = 0 ,
70- .tm_mday = 0 ,
71- .tm_mon = 0 ,
72- .tm_year = 0 ,
73- .tm_wday = 0 ,
74- .tm_yday = 0 ,
75- .tm_isdst = 0
76- };
62+ static struct tm input = (struct tm ){.tm_sec = 0 ,
63+ .tm_min = 0 ,
64+ .tm_hour = 0 ,
65+ .tm_mday = 0 ,
66+ .tm_mon = 0 ,
67+ .tm_year = 0 ,
68+ .tm_wday = 0 ,
69+ .tm_yday = 0 ,
70+ .tm_isdst = 0 };
7771 struct tm *result = LIBC_NAMESPACE::localtime_r (&t_ptr, &input);
7872 ASSERT_EQ (121 , result->tm_year );
7973 ASSERT_EQ (6 , result->tm_mon );
0 commit comments