#include "absl/status/statusor.h"
#include <array>
#include <cstddef>
#include <initializer_list>
#include <map>
#include <memory>
#include <ostream>
#include <sstream>
#include <string>
#include <type_traits>
#include <utility>
#include <vector>
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "absl/base/casts.h"
#include "absl/memory/memory.h"
#include "absl/status/status.h"
#include "absl/status/status_matchers.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
#include "absl/types/any.h"
#include "absl/types/variant.h"
#include "absl/utility/utility.h"
namespace {
IsOk;
IsOkAndHolds;
AllOf;
AnyOf;
AnyWith;
ElementsAre;
EndsWith;
Field;
HasSubstr;
Ne;
Not;
Pointee;
StartsWith;
VariantWith;
struct CopyDetector { … };
testing::Matcher<const CopyDetector&> CopyDetectorHas(int a, bool b, bool c) { … }
class Base1 { … };
class Base2 { … };
class Derived : public Base1, public Base2 { … };
class CopyNoAssign { … };
absl::StatusOr<std::unique_ptr<int>> ReturnUniquePtr() { … }
TEST(StatusOr, ElementType) { … }
TEST(StatusOr, TestMoveOnlyInitialization) { … }
TEST(StatusOr, TestMoveOnlyValueExtraction) { … }
TEST(StatusOr, TestMoveOnlyInitializationFromTemporaryByValueOrDie) { … }
TEST(StatusOr, TestValueOrDieOverloadForConstTemporary) { … }
TEST(StatusOr, TestMoveOnlyConversion) { … }
TEST(StatusOr, TestMoveOnlyVector) { … }
TEST(StatusOr, TestDefaultCtor) { … }
TEST(StatusOr, StatusCtorForwards) { … }
TEST(BadStatusOrAccessTest, CopyConstructionWhatOk) { … }
TEST(BadStatusOrAccessTest, CopyAssignmentWhatOk) { … }
TEST(BadStatusOrAccessTest, MoveConstructionWhatOk) { … }
TEST(BadStatusOrAccessTest, MoveAssignmentWhatOk) { … }
#ifdef ABSL_HAVE_EXCEPTIONS
#define EXPECT_DEATH_OR_THROW …
#else
#define EXPECT_DEATH_OR_THROW(statement, status) …
#endif
TEST(StatusOrDeathTest, TestDefaultCtorValue) { … }
TEST(StatusOrDeathTest, TestValueNotOk) { … }
TEST(StatusOrDeathTest, TestValueNotOkConst) { … }
TEST(StatusOrDeathTest, TestPointerDefaultCtorValue) { … }
TEST(StatusOrDeathTest, TestPointerValueNotOk) { … }
TEST(StatusOrDeathTest, TestPointerValueNotOkConst) { … }
#if GTEST_HAS_DEATH_TEST
TEST(StatusOrDeathTest, TestStatusCtorStatusOk) { … }
TEST(StatusOrDeathTest, TestPointerStatusCtorStatusOk) { … }
#endif
TEST(StatusOr, ValueAccessor) { … }
TEST(StatusOr, BadValueAccess) { … }
TEST(StatusOr, TestStatusCtor) { … }
TEST(StatusOr, TestValueCtor) { … }
struct Foo { … };
TEST(StatusOr, InPlaceConstruction) { … }
struct InPlaceHelper { … };
TEST(StatusOr, InPlaceInitListConstruction) { … }
TEST(StatusOr, Emplace) { … }
TEST(StatusOr, EmplaceInitializerList) { … }
TEST(StatusOr, TestCopyCtorStatusOk) { … }
TEST(StatusOr, TestCopyCtorStatusNotOk) { … }
TEST(StatusOr, TestCopyCtorNonAssignable) { … }
TEST(StatusOr, TestCopyCtorStatusOKConverting) { … }
TEST(StatusOr, TestCopyCtorStatusNotOkConverting) { … }
TEST(StatusOr, TestAssignmentStatusOk) { … }
TEST(StatusOr, TestAssignmentStatusNotOk) { … }
TEST(StatusOr, TestAssignmentStatusOKConverting) { … }
struct A { … };
struct ImplicitConstructibleFromA { … };
TEST(StatusOr, ImplicitConvertingConstructor) { … }
struct ExplicitConstructibleFromA { … };
TEST(StatusOr, ExplicitConvertingConstructor) { … }
struct ImplicitConstructibleFromBool { … };
struct ConvertibleToBool { … };
TEST(StatusOr, ImplicitBooleanConstructionWithImplicitCasts) { … }
TEST(StatusOr, BooleanConstructionWithImplicitCasts) { … }
TEST(StatusOr, ConstImplicitCast) { … }
TEST(StatusOr, ConstExplicitConstruction) { … }
struct ExplicitConstructibleFromInt { … };
TEST(StatusOr, ExplicitConstruction) { … }
TEST(StatusOr, ImplicitConstruction) { … }
TEST(StatusOr, ImplicitConstructionFromInitliazerList) { … }
TEST(StatusOr, UniquePtrImplicitConstruction) { … }
TEST(StatusOr, NestedStatusOrCopyAndMoveConstructorTests) { … }
TEST(StatusOr, NestedStatusOrCopyAndMoveAssignment) { … }
struct Copyable { … };
struct MoveOnly { … };
struct NonMovable { … };
TEST(StatusOr, CopyAndMoveAbility) { … }
TEST(StatusOr, StatusOrAnyCopyAndMoveConstructorTests) { … }
TEST(StatusOr, StatusOrAnyCopyAndMoveAssignment) { … }
TEST(StatusOr, StatusOrCopyAndMoveTestsConstructor) { … }
TEST(StatusOr, StatusOrCopyAndMoveTestsAssignment) { … }
TEST(StatusOr, AbslAnyAssignment) { … }
TEST(StatusOr, ImplicitAssignment) { … }
TEST(StatusOr, SelfDirectInitAssignment) { … }
TEST(StatusOr, ImplicitCastFromInitializerList) { … }
TEST(StatusOr, UniquePtrImplicitAssignment) { … }
TEST(StatusOr, Pointer) { … }
TEST(StatusOr, TestAssignmentStatusNotOkConverting) { … }
TEST(StatusOr, SelfAssignment) { … }
struct FromConstructibleAssignableLvalue { … };
struct FromConstructibleAssignableRvalue { … };
struct FromImplicitConstructibleOnly { … };
struct FromAssignableOnly { … };
struct MockValue { … };
TEST(StatusOr, PerfectForwardingAssignment) { … }
TEST(StatusOr, TestStatus) { … }
TEST(StatusOr, OperatorStarRefQualifiers) { … }
TEST(StatusOr, OperatorStar) { … }
TEST(StatusOr, OperatorArrowQualifiers) { … }
TEST(StatusOr, OperatorArrow) { … }
TEST(StatusOr, RValueStatus) { … }
TEST(StatusOr, TestValue) { … }
TEST(StatusOr, TestValueConst) { … }
TEST(StatusOr, TestPointerDefaultCtor) { … }
TEST(StatusOr, TestPointerStatusCtor) { … }
TEST(StatusOr, TestPointerValueCtor) { … }
TEST(StatusOr, TestPointerCopyCtorStatusOk) { … }
TEST(StatusOr, TestPointerCopyCtorStatusNotOk) { … }
TEST(StatusOr, TestPointerCopyCtorStatusOKConverting) { … }
TEST(StatusOr, TestPointerCopyCtorStatusNotOkConverting) { … }
TEST(StatusOr, TestPointerAssignmentStatusOk) { … }
TEST(StatusOr, TestPointerAssignmentStatusNotOk) { … }
TEST(StatusOr, TestPointerAssignmentStatusOKConverting) { … }
TEST(StatusOr, TestPointerAssignmentStatusNotOkConverting) { … }
TEST(StatusOr, TestPointerStatus) { … }
TEST(StatusOr, TestPointerValue) { … }
TEST(StatusOr, TestPointerValueConst) { … }
TEST(StatusOr, StatusOrVectorOfUniquePointerCanReserveAndResize) { … }
TEST(StatusOr, ConstPayload) { … }
TEST(StatusOr, MapToStatusOrUniquePtr) { … }
TEST(StatusOr, ValueOrOk) { … }
TEST(StatusOr, ValueOrDefault) { … }
TEST(StatusOr, MoveOnlyValueOrOk) { … }
TEST(StatusOr, MoveOnlyValueOrDefault) { … }
static absl::StatusOr<int> MakeStatus() { … }
TEST(StatusOr, TestIgnoreError) { … }
TEST(StatusOr, EqualityOperator) { … }
struct MyType { … };
enum class ConvTraits { … };
template <typename T, ConvTraits conv_traits = ConvTraits::kNone>
struct StatusOrConversionBase { … };
StatusOrConversionBase<T, ConvTraits::kImplicit>;
StatusOrConversionBase<T, ConvTraits::kExplicit>;
template <typename T, ConvTraits conv_traits = ConvTraits::kNone>
struct ConversionBase { … };
ConversionBase<T, ConvTraits::kImplicit>;
ConversionBase<T, ConvTraits::kExplicit>;
template <ConvTraits conv_traits = ConvTraits::kNone>
struct StatusConversionBase { … };
template <>
struct StatusConversionBase<ConvTraits::kImplicit> { … };
template <>
struct StatusConversionBase<ConvTraits::kExplicit> { … };
static constexpr int kConvToStatus = …;
static constexpr int kConvToStatusOr = …;
static constexpr int kConvToT = …;
static constexpr int kConvExplicit = …;
constexpr ConvTraits GetConvTraits(int bit, int config) { … }
template <typename T, int config>
struct CustomType
: StatusOrConversionBase<T, GetConvTraits(kConvToStatusOr, config)>,
ConversionBase<T, GetConvTraits(kConvToT, config)>,
StatusConversionBase<GetConvTraits(kConvToStatus, config)> { … };
struct ConvertibleToAnyStatusOr { … };
TEST(StatusOr, ConstructionFromT) { … }
TEST(StatusOr, ConstructionFromTypeConvertibleToT) { … }
TEST(StatusOr, ConstructionFromTypeWithConversionOperatorToStatusOrT) { … }
TEST(StatusOr, ConstructionFromTypeConvertibleToStatus) { … }
TEST(StatusOr, AssignmentFromT) { … }
TEST(StatusOr, AssignmentFromTypeConvertibleToT) { … }
TEST(StatusOr, AssignmentFromTypeWithConversionOperatortoStatusOrT) { … }
TEST(StatusOr, AssignmentFromTypeConvertibleToStatus) { … }
TEST(StatusOr, StatusAssignmentFromStatusError) { … }
#if GTEST_HAS_DEATH_TEST
TEST(StatusOr, StatusAssignmentFromStatusOk) { … }
#endif
TEST(StatusOr, StatusAssignmentFromTypeConvertibleToStatus) { … }
struct PrintTestStruct { … };
TEST(StatusOr, OkPrinting) { … }
TEST(StatusOr, ErrorPrinting) { … }
}