@@ -36,7 +36,8 @@ TEST(LlvmLibcMkTime, FailureSetsErrno) {
3636 .tm_wday = 0 ,
3737 .tm_yday = 0 ,
3838 .tm_isdst = 0 };
39- EXPECT_THAT ((int )LIBC_NAMESPACE::mktime (&tm_data), Fails (EOVERFLOW));
39+ EXPECT_THAT (static_cast <int >(LIBC_NAMESPACE::mktime (&tm_data)),
40+ Fails (EOVERFLOW));
4041}
4142
4243TEST (LlvmLibcMkTime, InvalidSeconds) {
@@ -51,7 +52,8 @@ TEST(LlvmLibcMkTime, InvalidSeconds) {
5152 .tm_wday = 0 ,
5253 .tm_yday = 0 ,
5354 .tm_isdst = 0 };
54- EXPECT_THAT ((int )LIBC_NAMESPACE::mktime (&tm_data), Succeeds (-1 ));
55+ EXPECT_THAT (static_cast <int >(LIBC_NAMESPACE::mktime (&tm_data)),
56+ Succeeds (-1 ));
5557 EXPECT_TM_EQ ((tm{.tm_sec = 59 ,
5658 .tm_min = 59 ,
5759 .tm_hour = 23 ,
@@ -75,7 +77,8 @@ TEST(LlvmLibcMkTime, InvalidSeconds) {
7577 .tm_wday = 0 ,
7678 .tm_yday = 0 ,
7779 .tm_isdst = 0 };
78- EXPECT_THAT ((int )LIBC_NAMESPACE::mktime (&tm_data), Succeeds (60 ));
80+ EXPECT_THAT (static_cast <int >(LIBC_NAMESPACE::mktime (&tm_data)),
81+ Succeeds (60 ));
7982 EXPECT_TM_EQ ((tm{.tm_sec = 0 ,
8083 .tm_min = 1 ,
8184 .tm_hour = 0 ,
@@ -101,7 +104,7 @@ TEST(LlvmLibcMkTime, InvalidMinutes) {
101104 .tm_wday = 0 ,
102105 .tm_yday = 0 ,
103106 .tm_isdst = 0 };
104- EXPECT_THAT (( int ) LIBC_NAMESPACE::mktime (&tm_data),
107+ EXPECT_THAT (static_cast < int >( LIBC_NAMESPACE::mktime (&tm_data) ),
105108 Succeeds (-LIBC_NAMESPACE::time_constants::SECONDS_PER_MIN));
106109 EXPECT_TM_EQ ((tm{.tm_sec = 0 ,
107110 .tm_min = 59 ,
@@ -126,7 +129,7 @@ TEST(LlvmLibcMkTime, InvalidMinutes) {
126129 .tm_wday = 0 ,
127130 .tm_yday = 0 ,
128131 .tm_isdst = 0 };
129- EXPECT_THAT (( int ) LIBC_NAMESPACE::mktime (&tm_data),
132+ EXPECT_THAT (static_cast < int >( LIBC_NAMESPACE::mktime (&tm_data) ),
130133 Succeeds (60 * LIBC_NAMESPACE::time_constants::SECONDS_PER_MIN));
131134 EXPECT_TM_EQ ((tm{.tm_sec = 0 ,
132135 .tm_min = 0 ,
@@ -153,7 +156,7 @@ TEST(LlvmLibcMkTime, InvalidHours) {
153156 .tm_wday = 0 ,
154157 .tm_yday = 0 ,
155158 .tm_isdst = 0 };
156- EXPECT_THAT (( int ) LIBC_NAMESPACE::mktime (&tm_data),
159+ EXPECT_THAT (static_cast < int >( LIBC_NAMESPACE::mktime (&tm_data) ),
157160 Succeeds (-LIBC_NAMESPACE::time_constants::SECONDS_PER_HOUR));
158161 EXPECT_TM_EQ ((tm{.tm_sec = 0 ,
159162 .tm_min = 0 ,
@@ -179,7 +182,7 @@ TEST(LlvmLibcMkTime, InvalidHours) {
179182 .tm_yday = 0 ,
180183 .tm_isdst = 0 };
181184 EXPECT_THAT (
182- ( int ) LIBC_NAMESPACE::mktime (&tm_data),
185+ static_cast < int >( LIBC_NAMESPACE::mktime (&tm_data) ),
183186 Succeeds (24 * LIBC_NAMESPACE::time_constants::SECONDS_PER_HOUR));
184187 EXPECT_TM_EQ ((tm{.tm_sec = 0 ,
185188 .tm_min = 0 ,
@@ -205,7 +208,7 @@ TEST(LlvmLibcMkTime, InvalidYear) {
205208 .tm_wday = 0 ,
206209 .tm_yday = 0 ,
207210 .tm_isdst = 0 };
208- EXPECT_THAT (( int ) LIBC_NAMESPACE::mktime (&tm_data),
211+ EXPECT_THAT (static_cast < int >( LIBC_NAMESPACE::mktime (&tm_data) ),
209212 Succeeds (-LIBC_NAMESPACE::time_constants::DAYS_PER_NON_LEAP_YEAR *
210213 LIBC_NAMESPACE::time_constants::SECONDS_PER_DAY));
211214 EXPECT_TM_EQ ((tm{.tm_sec = 0 ,
@@ -234,7 +237,8 @@ TEST(LlvmLibcMkTime, InvalidEndOf32BitEpochYear) {
234237 .tm_wday = 0 ,
235238 .tm_yday = 0 ,
236239 .tm_isdst = 0 };
237- EXPECT_THAT ((int )LIBC_NAMESPACE::mktime (&tm_data), Fails (EOVERFLOW));
240+ EXPECT_THAT (static_cast <int >(LIBC_NAMESPACE::mktime (&tm_data)),
241+ Fails (EOVERFLOW));
238242 }
239243
240244 {
@@ -248,7 +252,8 @@ TEST(LlvmLibcMkTime, InvalidEndOf32BitEpochYear) {
248252 .tm_wday = 0 ,
249253 .tm_yday = 0 ,
250254 .tm_isdst = 0 };
251- EXPECT_THAT ((int )LIBC_NAMESPACE::mktime (&tm_data), Fails (EOVERFLOW));
255+ EXPECT_THAT (static_cast <int >(LIBC_NAMESPACE::mktime (&tm_data)),
256+ Fails (EOVERFLOW));
252257 }
253258
254259 {
@@ -262,7 +267,8 @@ TEST(LlvmLibcMkTime, InvalidEndOf32BitEpochYear) {
262267 .tm_wday = 0 ,
263268 .tm_yday = 0 ,
264269 .tm_isdst = 0 };
265- EXPECT_THAT ((int )LIBC_NAMESPACE::mktime (&tm_data), Fails (EOVERFLOW));
270+ EXPECT_THAT (static_cast <int >(LIBC_NAMESPACE::mktime (&tm_data)),
271+ Fails (EOVERFLOW));
266272 }
267273
268274 {
@@ -276,7 +282,8 @@ TEST(LlvmLibcMkTime, InvalidEndOf32BitEpochYear) {
276282 .tm_wday = 0 ,
277283 .tm_yday = 0 ,
278284 .tm_isdst = 0 };
279- EXPECT_THAT ((int )LIBC_NAMESPACE::mktime (&tm_data), Fails (EOVERFLOW));
285+ EXPECT_THAT (static_cast <int >(LIBC_NAMESPACE::mktime (&tm_data)),
286+ Fails (EOVERFLOW));
280287 }
281288
282289 {
@@ -290,7 +297,8 @@ TEST(LlvmLibcMkTime, InvalidEndOf32BitEpochYear) {
290297 .tm_wday = 0 ,
291298 .tm_yday = 0 ,
292299 .tm_isdst = 0 };
293- EXPECT_THAT ((int )LIBC_NAMESPACE::mktime (&tm_data), Fails (EOVERFLOW));
300+ EXPECT_THAT (static_cast <int >(LIBC_NAMESPACE::mktime (&tm_data)),
301+ Fails (EOVERFLOW));
294302 }
295303
296304 {
@@ -304,7 +312,8 @@ TEST(LlvmLibcMkTime, InvalidEndOf32BitEpochYear) {
304312 .tm_wday = 0 ,
305313 .tm_yday = 0 ,
306314 .tm_isdst = 0 };
307- EXPECT_THAT ((int )LIBC_NAMESPACE::mktime (&tm_data), Fails (EOVERFLOW));
315+ EXPECT_THAT (static_cast <int >(LIBC_NAMESPACE::mktime (&tm_data)),
316+ Fails (EOVERFLOW));
308317 }
309318}
310319
@@ -321,7 +330,7 @@ TEST(LlvmLibcMkTime, InvalidMonths) {
321330 .tm_yday = 0 ,
322331 .tm_isdst = 0 };
323332 EXPECT_THAT (
324- ( int ) LIBC_NAMESPACE::mktime (&tm_data),
333+ static_cast < int >( LIBC_NAMESPACE::mktime (&tm_data) ),
325334 Succeeds (-32 * LIBC_NAMESPACE::time_constants::SECONDS_PER_DAY));
326335 EXPECT_TM_EQ ((tm{.tm_sec = 0 ,
327336 .tm_min = 0 ,
@@ -347,7 +356,7 @@ TEST(LlvmLibcMkTime, InvalidMonths) {
347356 .tm_yday = 0 ,
348357 .tm_isdst = 0 };
349358 EXPECT_THAT (
350- ( int ) LIBC_NAMESPACE::mktime (&tm_data),
359+ static_cast < int >( LIBC_NAMESPACE::mktime (&tm_data) ),
351360 Succeeds (LIBC_NAMESPACE::time_constants::DAYS_PER_NON_LEAP_YEAR *
352361 LIBC_NAMESPACE::time_constants::SECONDS_PER_DAY));
353362 EXPECT_TM_EQ ((tm{.tm_sec = 0 ,
@@ -375,7 +384,7 @@ TEST(LlvmLibcMkTime, InvalidDays) {
375384 .tm_wday = 0 ,
376385 .tm_yday = 0 ,
377386 .tm_isdst = 0 };
378- EXPECT_THAT (( int ) LIBC_NAMESPACE::mktime (&tm_data),
387+ EXPECT_THAT (static_cast < int >( LIBC_NAMESPACE::mktime (&tm_data) ),
379388 Succeeds (-1 * LIBC_NAMESPACE::time_constants::SECONDS_PER_DAY));
380389 EXPECT_TM_EQ ((tm{.tm_sec = 0 ,
381390 .tm_min = 0 ,
@@ -400,7 +409,7 @@ TEST(LlvmLibcMkTime, InvalidDays) {
400409 .tm_wday = 0 ,
401410 .tm_yday = 0 ,
402411 .tm_isdst = 0 };
403- EXPECT_THAT (( int ) LIBC_NAMESPACE::mktime (&tm_data),
412+ EXPECT_THAT (static_cast < int >( LIBC_NAMESPACE::mktime (&tm_data) ),
404413 Succeeds (31 * LIBC_NAMESPACE::time_constants::SECONDS_PER_DAY));
405414 EXPECT_TM_EQ ((tm{.tm_sec = 0 ,
406415 .tm_min = 0 ,
@@ -425,7 +434,7 @@ TEST(LlvmLibcMkTime, InvalidDays) {
425434 .tm_wday = 0 ,
426435 .tm_yday = 0 ,
427436 .tm_isdst = 0 };
428- EXPECT_THAT (( int ) LIBC_NAMESPACE::mktime (&tm_data),
437+ EXPECT_THAT (static_cast < int >( LIBC_NAMESPACE::mktime (&tm_data) ),
429438 Succeeds (59 * LIBC_NAMESPACE::time_constants::SECONDS_PER_DAY));
430439 EXPECT_TM_EQ ((tm{.tm_sec = 0 ,
431440 .tm_min = 0 ,
@@ -451,7 +460,7 @@ TEST(LlvmLibcMkTime, InvalidDays) {
451460 .tm_yday = 0 ,
452461 .tm_isdst = 0 };
453462 EXPECT_THAT (
454- ( int ) LIBC_NAMESPACE::mktime (&tm_data),
463+ static_cast < int >( LIBC_NAMESPACE::mktime (&tm_data) ),
455464 Succeeds (((2 * LIBC_NAMESPACE::time_constants::DAYS_PER_NON_LEAP_YEAR) +
456465 60 ) *
457466 LIBC_NAMESPACE::time_constants::SECONDS_PER_DAY));
@@ -481,7 +490,8 @@ TEST(LlvmLibcMkTime, EndOf32BitEpochYear) {
481490 .tm_wday = 0 ,
482491 .tm_yday = 0 ,
483492 .tm_isdst = 0 };
484- EXPECT_THAT ((int )LIBC_NAMESPACE::mktime (&tm_data), Succeeds (0x7FFFFFFF ));
493+ EXPECT_THAT (static_cast <int >(LIBC_NAMESPACE::mktime (&tm_data)),
494+ Succeeds (0x7FFFFFFF ));
485495 EXPECT_TM_EQ ((tm{.tm_sec = 7 ,
486496 .tm_min = 14 ,
487497 .tm_hour = 3 ,
@@ -507,7 +517,7 @@ TEST(LlvmLibcMkTime, EndOf32BitEpochYear) {
507517 .tm_wday = 0 ,
508518 .tm_yday = 0 ,
509519 .tm_isdst = 0 };
510- EXPECT_THAT (( int ) LIBC_NAMESPACE::mktime (&tm_data),
520+ EXPECT_THAT (static_cast < int >( LIBC_NAMESPACE::mktime (&tm_data) ),
511521 Succeeds (0x7FFFFFFF - 8 ));
512522 EXPECT_TM_EQ ((tm{.tm_sec = 59 ,
513523 .tm_min = 13 ,
@@ -533,7 +543,7 @@ TEST(LlvmLibcMkTime, EndOf32BitEpochYear) {
533543 .tm_wday = 0 ,
534544 .tm_yday = 0 ,
535545 .tm_isdst = 0 };
536- EXPECT_THAT (( int ) LIBC_NAMESPACE::mktime (&tm_data),
546+ EXPECT_THAT (static_cast < int >( LIBC_NAMESPACE::mktime (&tm_data) ),
537547 Succeeds (0x7FFFFFFF - 8 -
538548 14 * LIBC_NAMESPACE::time_constants::SECONDS_PER_MIN));
539549 EXPECT_TM_EQ ((tm{.tm_sec = 59 ,
@@ -560,7 +570,7 @@ TEST(LlvmLibcMkTime, EndOf32BitEpochYear) {
560570 .tm_wday = 0 ,
561571 .tm_yday = 0 ,
562572 .tm_isdst = 0 };
563- EXPECT_THAT (( int ) LIBC_NAMESPACE::mktime (&tm_data),
573+ EXPECT_THAT (static_cast < int >( LIBC_NAMESPACE::mktime (&tm_data) ),
564574 Succeeds (0x7FFFFFFF - 8 -
565575 14 * LIBC_NAMESPACE::time_constants::SECONDS_PER_MIN -
566576 3 * LIBC_NAMESPACE::time_constants::SECONDS_PER_HOUR));
@@ -588,7 +598,7 @@ TEST(LlvmLibcMkTime, EndOf32BitEpochYear) {
588598 .tm_wday = 0 ,
589599 .tm_yday = 0 ,
590600 .tm_isdst = 0 };
591- EXPECT_THAT (( int ) LIBC_NAMESPACE::mktime (&tm_data),
601+ EXPECT_THAT (static_cast < int >( LIBC_NAMESPACE::mktime (&tm_data) ),
592602 Succeeds (0x7FFFFFFF - 8 -
593603 14 * LIBC_NAMESPACE::time_constants::SECONDS_PER_MIN -
594604 3 * LIBC_NAMESPACE::time_constants::SECONDS_PER_HOUR -
0 commit comments