aboutsummaryrefslogtreecommitdiff
path: root/third_party/abseil-cpp/absl/time/internal/cctz/src/civil_time_test.cc
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-05-11 05:08:19 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-05-11 05:08:19 +0000
commit15a86298981ce1e05202ce428a01831c5c676b5b (patch)
tree2ce94d7f0804ccb77d1fa9b2a1bca00eecdff1e2 /third_party/abseil-cpp/absl/time/internal/cctz/src/civil_time_test.cc
parentbb40cdcc9e0cd35dcca27d6cb7952e8f54a8fcc1 (diff)
parentd3dfe74c4025bacd9741d761815a8cb059e49c68 (diff)
downloadwebrtc-android13-mainline-media-swcodec-release.tar.gz
Change-Id: Ibc8554ed4c01d5182837917c6939a19ab500bdb0
Diffstat (limited to 'third_party/abseil-cpp/absl/time/internal/cctz/src/civil_time_test.cc')
-rw-r--r--third_party/abseil-cpp/absl/time/internal/cctz/src/civil_time_test.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/third_party/abseil-cpp/absl/time/internal/cctz/src/civil_time_test.cc b/third_party/abseil-cpp/absl/time/internal/cctz/src/civil_time_test.cc
index be894d7072..a5a7123041 100644
--- a/third_party/abseil-cpp/absl/time/internal/cctz/src/civil_time_test.cc
+++ b/third_party/abseil-cpp/absl/time/internal/cctz/src/civil_time_test.cc
@@ -235,6 +235,16 @@ TEST(CivilTime, Difference) {
}
// NOTE: Run this with --copt=-ftrapv to detect overflow problems.
+TEST(CivilTime, ConstructionWithHugeYear) {
+ constexpr civil_hour h(-9223372036854775807, 1, 1, -1);
+ static_assert(h.year() == -9223372036854775807 - 1,
+ "ConstructionWithHugeYear");
+ static_assert(h.month() == 12, "ConstructionWithHugeYear");
+ static_assert(h.day() == 31, "ConstructionWithHugeYear");
+ static_assert(h.hour() == 23, "ConstructionWithHugeYear");
+}
+
+// NOTE: Run this with --copt=-ftrapv to detect overflow problems.
TEST(CivilTime, DifferenceWithHugeYear) {
{
constexpr civil_day d1(9223372036854775807, 1, 1);