chromium/third_party/abseil-cpp/absl/time/duration_test.cc

// Copyright 2017 The Abseil Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#if defined(_MSC_VER)
#include <winsock2.h>  // for timeval
#endif

#include "absl/base/config.h"

// For feature testing and determining which headers can be included.
#if ABSL_INTERNAL_CPLUSPLUS_LANG >= 202002L
#include <version>
#endif

#include <array>
#include <cfloat>
#include <chrono>  // NOLINT(build/c++11)
#ifdef __cpp_lib_three_way_comparison
#include <compare>
#endif  // __cpp_lib_three_way_comparison
#include <cmath>
#include <cstdint>
#include <ctime>
#include <iomanip>
#include <limits>
#include <random>
#include <string>

#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "absl/strings/str_format.h"
#include "absl/time/time.h"

namespace {

constexpr int64_t kint64max =;
constexpr int64_t kint64min =;

// Approximates the given number of years. This is only used to make some test
// code more readable.
absl::Duration ApproxYears(int64_t n) {}

// A gMock matcher to match timespec values. Use this matcher like:
// timespec ts1, ts2;
// EXPECT_THAT(ts1, TimespecMatcher(ts2));
MATCHER_P(TimespecMatcher, ts, "") {}

// A gMock matcher to match timeval values. Use this matcher like:
// timeval tv1, tv2;
// EXPECT_THAT(tv1, TimevalMatcher(tv2));
MATCHER_P(TimevalMatcher, tv, "") {}

TEST(Duration, ConstExpr) {}

TEST(Duration, ValueSemantics) {}

TEST(Duration, Factories) {}

TEST(Duration, ToConversion) {}

template <int64_t N>
void TestToConversion() {}

TEST(Duration, ToConversionDeprecated) {}

template <int64_t N>
void TestFromChronoBasicEquality() {}

TEST(Duration, FromChrono) {}

template <int64_t N>
void TestToChrono() {}

TEST(Duration, ToChrono) {}

TEST(Duration, FactoryOverloads) {}

TEST(Duration, InfinityExamples) {}

TEST(Duration, InfinityComparison) {}

TEST(Duration, InfinityAddition) {}

TEST(Duration, InfinitySubtraction) {}

TEST(Duration, InfinityMultiplication) {}

TEST(Duration, InfinityDivision) {}

TEST(Duration, InfinityModulus) {}

TEST(Duration, InfinityIDiv) {}

TEST(Duration, InfinityFDiv) {}

TEST(Duration, DivisionByZero) {}

TEST(Duration, NaN) {}

TEST(Duration, Range) {}

TEST(Duration, RelationalOperators) {}

#ifdef ABSL_INTERNAL_TIME_HAS_THREE_WAY_COMPARISON

TEST(Duration, SpaceshipOperators) {}

#endif  // ABSL_INTERNAL_TIME_HAS_THREE_WAY_COMPARISON

TEST(Duration, Addition) {}

TEST(Duration, Negation) {}

TEST(Duration, AbsoluteValue) {}

TEST(Duration, Multiplication) {}

TEST(Duration, Truncation) {}

TEST(Duration, Flooring) {}

TEST(Duration, Ceiling) {}

TEST(Duration, RoundTripUnits) {}

TEST(Duration, TruncConversions) {}

TEST(Duration, SmallConversions) {}

void VerifyApproxSameAsMul(double time_as_seconds, int* const misses) {}

// For a variety of interesting durations, we find the exact point
// where one double converts to that duration, and the very next double
// converts to the next duration.  For both of those points, verify that
// Seconds(point) returns a duration near point * Seconds(1.0). (They may
// not be exactly equal due to fused multiply/add contraction.)
TEST(Duration, ToDoubleSecondsCheckEdgeCases) {}

TEST(Duration, ToDoubleSecondsCheckRandom) {}

TEST(Duration, ConversionSaturation) {}

TEST(Duration, FormatDuration) {}

TEST(Duration, ParseDuration) {}

TEST(Duration, FormatParseRoundTrip) {}

TEST(Duration, AbslStringify) {}

TEST(Duration, NoPadding) {}

}  // namespace