File tree Expand file tree Collapse file tree 1 file changed +27
-33
lines changed Expand file tree Collapse file tree 1 file changed +27
-33
lines changed Original file line number Diff line number Diff line change 10
10
#include " test/UnitTest/Test.h"
11
11
12
12
TEST (LlvmLibcLocaltimeR, ValidUnixTimestamp0) {
13
- struct tm input = {
14
- .tm_sec = 0 ,
15
- .tm_min = 0 ,
16
- .tm_hour = 0 ,
17
- .tm_mday = 0 ,
18
- .tm_mon = 0 ,
19
- .tm_year = 0 ,
20
- .tm_wday = 0 ,
21
- .tm_yday = 0 ,
22
- .tm_isdst = 0
23
- };
13
+ struct tm input = {.tm_sec = 0 ,
14
+ .tm_min = 0 ,
15
+ .tm_hour = 0 ,
16
+ .tm_mday = 0 ,
17
+ .tm_mon = 0 ,
18
+ .tm_year = 0 ,
19
+ .tm_wday = 0 ,
20
+ .tm_yday = 0 ,
21
+ .tm_isdst = 0 };
24
22
const time_t timer = 0 ;
25
23
26
24
struct tm *result = LIBC_NAMESPACE::localtime_r (&timer, &input);
@@ -42,17 +40,15 @@ TEST(LlvmLibcLocaltimeR, ValidUnixTimestamp0) {
42
40
// This will be resolved a new pull request.
43
41
44
42
TEST (LlvmLibcLocaltimeR, ValidUnixTimestamp) {
45
- struct tm input = {
46
- .tm_sec = 0 ,
47
- .tm_min = 0 ,
48
- .tm_hour = 0 ,
49
- .tm_mday = 0 ,
50
- .tm_mon = 0 ,
51
- .tm_year = 0 ,
52
- .tm_wday = 0 ,
53
- .tm_yday = 0 ,
54
- .tm_isdst = 0
55
- };
43
+ struct tm input = {.tm_sec = 0 ,
44
+ .tm_min = 0 ,
45
+ .tm_hour = 0 ,
46
+ .tm_mday = 0 ,
47
+ .tm_mon = 0 ,
48
+ .tm_year = 0 ,
49
+ .tm_wday = 0 ,
50
+ .tm_yday = 0 ,
51
+ .tm_isdst = 0 };
56
52
const time_t timer = 1756595338 ;
57
53
struct tm *result = LIBC_NAMESPACE::localtime_r (&timer, &input);
58
54
@@ -68,17 +64,15 @@ TEST(LlvmLibcLocaltimeR, ValidUnixTimestamp) {
68
64
}
69
65
70
66
TEST (LlvmLibcLocaltimeR, ValidUnixTimestampNegative) {
71
- struct tm input = {
72
- .tm_sec = 0 ,
73
- .tm_min = 0 ,
74
- .tm_hour = 0 ,
75
- .tm_mday = 0 ,
76
- .tm_mon = 0 ,
77
- .tm_year = 0 ,
78
- .tm_wday = 0 ,
79
- .tm_yday = 0 ,
80
- .tm_isdst = 0
81
- };
67
+ struct tm input = {.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 };
82
76
const time_t timer = -1756595338 ;
83
77
struct tm *result = LIBC_NAMESPACE::localtime_r (&timer, &input);
84
78
You can’t perform that action at this time.
0 commit comments