43 lines · cpp
1//===----------------------------------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9// UNSUPPORTED: c++03, c++11, c++14, c++1710// UNSUPPORTED: no-filesystem, no-localization, no-tzdb11 12// XFAIL: libcpp-has-no-experimental-tzdb13// XFAIL: availability-tzdb-missing14 15// <chrono>16 17// const tzdb& get_tzdb();18 19#include <algorithm>20#include <cassert>21#include <chrono>22 23#include "test_macros.h"24 25int main(int, const char**) {26 const std::chrono::tzdb& db = std::chrono::get_tzdb();27 28 assert(!db.version.empty());29 30 assert(!db.zones.empty());31 assert(std::ranges::is_sorted(db.zones));32 assert(std::ranges::adjacent_find(db.zones) == db.zones.end()); // is unique?33 34 assert(!db.links.empty());35 assert(std::ranges::is_sorted(db.links));36 assert(std::ranges::adjacent_find(db.links) == db.links.end()); // is unique?37 38 assert(!db.leap_seconds.empty());39 assert(std::ranges::is_sorted(db.leap_seconds));40 41 return 0;42}43