aboutsummaryrefslogtreecommitdiff
path: root/absl/time/internal/test_util.cc
diff options
context:
space:
mode:
authorBenjamin Barenblat <bbaren@google.com>2022-07-12 21:47:19 -0400
committerBenjamin Barenblat <bbaren@google.com>2022-07-12 21:47:19 -0400
commitd055841ab4147dac20d5c46d04ca3a2fb13748b7 (patch)
tree15a01389c86f10a8844ff2a86bddf46640d065e8 /absl/time/internal/test_util.cc
parent2d23a3e16abfcf8f22ba850d67e972cc77e98874 (diff)
parent273292d1cfc0a94a65082ee350509af1d113344d (diff)
downloadabseil-d055841ab4147dac20d5c46d04ca3a2fb13748b7.tar.gz
abseil-d055841ab4147dac20d5c46d04ca3a2fb13748b7.tar.bz2
abseil-d055841ab4147dac20d5c46d04ca3a2fb13748b7.zip
Merge new upstream LTS 20220623.0
Diffstat (limited to 'absl/time/internal/test_util.cc')
-rw-r--r--absl/time/internal/test_util.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/absl/time/internal/test_util.cc b/absl/time/internal/test_util.cc
index 9a485a07..454b33a1 100644
--- a/absl/time/internal/test_util.cc
+++ b/absl/time/internal/test_util.cc
@@ -17,6 +17,7 @@
#include <algorithm>
#include <cstddef>
#include <cstring>
+#include <memory>
#include "absl/base/config.h"
#include "absl/base/internal/raw_logging.h"
@@ -67,10 +68,6 @@ const struct ZoneInfo {
{"Invalid/TimeZone", nullptr, 0},
{"", nullptr, 0},
- // Also allow for loading the local time zone under TZ=US/Pacific.
- {"US/Pacific", //
- reinterpret_cast<char*>(America_Los_Angeles), America_Los_Angeles_len},
-
// Allows use of the local time zone from a system-specific location.
#ifdef _MSC_VER
{"localtime", //
@@ -114,7 +111,10 @@ std::unique_ptr<cctz::ZoneInfoSource> TestFactory(
new TestZoneInfoSource(zoneinfo.data, zoneinfo.length));
}
}
- ABSL_RAW_LOG(FATAL, "Unexpected time zone \"%s\" in test", name.c_str());
+
+ // The embedded zoneinfo data does not include the zone, so fallback to
+ // built-in UTC. The tests have been crafted so that this should only
+ // happen when testing absl::LocalTimeZone() with an unconstrained ${TZ}.
return nullptr;
}