[libcxx-commits] [libcxx] 2685256 - [libc++][TZDZ] Validates the database version.

Mark de Wever via libcxx-commits libcxx-commits at lists.llvm.org
Sat Apr 13 07:09:13 PDT 2024


Author: Mark de Wever
Date: 2024-04-13T16:08:07+02:00
New Revision: 26852565a5f609e6b466f43c2f690ce3047d04c7

URL: https://github.com/llvm/llvm-project/commit/26852565a5f609e6b466f43c2f690ce3047d04c7
DIFF: https://github.com/llvm/llvm-project/commit/26852565a5f609e6b466f43c2f690ce3047d04c7.diff

LOG: [libc++][TZDZ] Validates the database version.

It seems one of the tests requires a very recent timezone database. Skip
the test when the database is older.

Added: 
    

Modified: 
    libcxx/test/std/time/time.zone/time.zone.timezone/time.zone.members/get_info.sys_time.pass.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/test/std/time/time.zone/time.zone.timezone/time.zone.members/get_info.sys_time.pass.cpp b/libcxx/test/std/time/time.zone/time.zone.timezone/time.zone.members/get_info.sys_time.pass.cpp
index 2ad408968589e6..b710f3df23352d 100644
--- a/libcxx/test/std/time/time.zone/time.zone.timezone/time.zone.members/get_info.sys_time.pass.cpp
+++ b/libcxx/test/std/time/time.zone/time.zone.timezone/time.zone.members/get_info.sys_time.pass.cpp
@@ -175,6 +175,10 @@ static void test_indian_kerguelen() {
   // Z Indian/Kerguelen 0 - -00 1950
   // 5 - +05
 
+  //  Make sure the entry is present in the database.
+  if (std::chrono::get_tzdb().version < "2024a")
+    return;
+
   const std::chrono::time_zone* tz = std::chrono::locate_zone("Indian/Kerguelen");
 
   std::chrono::sys_seconds transition =


        


More information about the libcxx-commits mailing list