[libc-commits] [libc] 9e34454 - [libc] Fix test case that expects time_t to be a 32-bit type

Mikhail R. Gadelha via libc-commits libc-commits at lists.llvm.org
Wed Aug 30 07:24:33 PDT 2023


Author: Mikhail R. Gadelha
Date: 2023-08-30T11:24:19-03:00
New Revision: 9e34454519898b79975c655ee46048f77490b0d2

URL: https://github.com/llvm/llvm-project/commit/9e34454519898b79975c655ee46048f77490b0d2
DIFF: https://github.com/llvm/llvm-project/commit/9e34454519898b79975c655ee46048f77490b0d2.diff

LOG: [libc] Fix test case that expects time_t to be a 32-bit type

This patch changes a test case that tests for overflow when time_t is
32-bit long, however, it was checking size_t instead of time_t.

This in on par with other testcases that correctly check the size of
time_t (asctime_test.cpp, gmtime_r_test.cpp and gmtime_test.cpp).

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D159113

Added: 
    

Modified: 
    libc/test/src/time/mktime_test.cpp

Removed: 
    


################################################################################
diff  --git a/libc/test/src/time/mktime_test.cpp b/libc/test/src/time/mktime_test.cpp
index 21910cffc376f7..8ee18adca8e135 100644
--- a/libc/test/src/time/mktime_test.cpp
+++ b/libc/test/src/time/mktime_test.cpp
@@ -178,7 +178,7 @@ TEST(LlvmLibcMkTime, InvalidYear) {
 }
 
 TEST(LlvmLibcMkTime, InvalidEndOf32BitEpochYear) {
-  if (sizeof(size_t) != 4)
+  if (sizeof(time_t) != 4)
     return;
   {
     // 2038-01-19 03:14:08 tests overflow of the second in 2038.


        


More information about the libc-commits mailing list