Automated Code Change

PiperOrigin-RevId: 820039898
Change-Id: I910d8ec41198794e7344a2d79566a19243532251
This commit is contained in:
Abseil Team 2025-10-15 21:01:25 -07:00 committed by Copybara-Service
parent 8dbd60f7d5
commit e17e37a115
4 changed files with 12 additions and 12 deletions

View File

@ -1822,7 +1822,7 @@ std::vector<std::unique_ptr<int>> VectorUniquePtrSource() {
TEST(MockMethodTest, CanReturnMoveOnlyValue_Return) {
MockClass mock;
std::unique_ptr<int> i(new int(19));
std::unique_ptr<int> i = std::make_unique<int>(19);
EXPECT_CALL(mock, MakeUnique()).WillOnce(Return(ByMove(std::move(i))));
EXPECT_CALL(mock, MakeVectorUnique())
.WillOnce(Return(ByMove(VectorUniquePtrSource())));
@ -1845,7 +1845,7 @@ TEST(MockMethodTest, CanReturnMoveOnlyValue_Return) {
TEST(MockMethodTest, CanReturnMoveOnlyValue_DoAllReturn) {
testing::MockFunction<void()> mock_function;
MockClass mock;
std::unique_ptr<int> i(new int(19));
std::unique_ptr<int> i = std::make_unique<int>(19);
EXPECT_CALL(mock_function, Call());
EXPECT_CALL(mock, MakeUnique())
.WillOnce(DoAll(InvokeWithoutArgs(&mock_function,

View File

@ -1625,7 +1625,7 @@ TEST_F(DoubleNearTest, NanSensitiveDoubleNearCanMatchNaN) {
}
TEST(NotTest, WorksOnMoveOnlyType) {
std::unique_ptr<int> p(new int(3));
std::unique_ptr<int> p = std::make_unique<int>(3);
EXPECT_THAT(p, Pointee(Eq(3)));
EXPECT_THAT(p, Not(Pointee(Eq(2))));
}
@ -1681,13 +1681,13 @@ TEST(AnyOfTest, DoesNotCallAnyOfUnqualified) {
} // namespace adl_test
TEST(AllOfTest, WorksOnMoveOnlyType) {
std::unique_ptr<int> p(new int(3));
std::unique_ptr<int> p = std::make_unique<int>(3);
EXPECT_THAT(p, AllOf(Pointee(Eq(3)), Pointee(Gt(0)), Pointee(Lt(5))));
EXPECT_THAT(p, Not(AllOf(Pointee(Eq(3)), Pointee(Gt(0)), Pointee(Lt(3)))));
}
TEST(AnyOfTest, WorksOnMoveOnlyType) {
std::unique_ptr<int> p(new int(3));
std::unique_ptr<int> p = std::make_unique<int>(3);
EXPECT_THAT(p, AnyOf(Pointee(Eq(5)), Pointee(Lt(0)), Pointee(Lt(5))));
EXPECT_THAT(p, Not(AnyOf(Pointee(Eq(5)), Pointee(Lt(0)), Pointee(Gt(5)))));
}

View File

@ -217,7 +217,7 @@ TEST(PointeeTest, ReferenceToNonConstRawPointer) {
TEST(PointeeTest, SmartPointer) {
const Matcher<std::unique_ptr<int>> m = Pointee(Ge(0));
std::unique_ptr<int> n(new int(1));
std::unique_ptr<int> n = std::make_unique<int>(1);
EXPECT_TRUE(m.Matches(n));
}
@ -254,7 +254,7 @@ TEST(PointerTest, RawPointerToConst) {
}
TEST(PointerTest, SmartPointer) {
std::unique_ptr<int> n(new int(10));
std::unique_ptr<int> n = std::make_unique<int>(10);
int* raw_n = n.get();
const Matcher<std::unique_ptr<int>> m = Pointer(Eq(raw_n));
@ -2796,7 +2796,7 @@ TEST(UnorderedPointwiseTest, WorksWithMoveOnly) {
}
TEST(PointeeTest, WorksOnMoveOnlyType) {
std::unique_ptr<int> p(new int(3));
std::unique_ptr<int> p = std::make_unique<int>(3);
EXPECT_THAT(p, Pointee(Eq(3)));
EXPECT_THAT(p, Not(Pointee(Eq(2))));
}

View File

@ -79,7 +79,7 @@ TEST(AddressTest, Const) {
}
TEST(AddressTest, MatcherDoesntCopy) {
std::unique_ptr<int> n(new int(1));
std::unique_ptr<int> n = std::make_unique<int>(1);
const Matcher<std::unique_ptr<int>> m = Address(Eq(&n));
EXPECT_TRUE(m.Matches(n));
@ -202,7 +202,7 @@ TEST(IsTrueTest, IsTrueIsFalse) {
EXPECT_THAT(nullptr, Not(IsTrue()));
EXPECT_THAT(nullptr, IsFalse());
std::unique_ptr<int> null_unique;
std::unique_ptr<int> nonnull_unique(new int(0));
std::unique_ptr<int> nonnull_unique = std::make_unique<int>(0);
EXPECT_THAT(null_unique, Not(IsTrue()));
EXPECT_THAT(null_unique, IsFalse());
EXPECT_THAT(nonnull_unique, IsTrue());
@ -1665,7 +1665,7 @@ MATCHER(IsNotNull, "") { return arg != nullptr; }
// Verifies that a matcher defined using MATCHER() can work on
// move-only types.
TEST(MatcherMacroTest, WorksOnMoveOnlyType) {
std::unique_ptr<int> p(new int(3));
std::unique_ptr<int> p = std::make_unique<int>(3);
EXPECT_THAT(p, IsNotNull());
EXPECT_THAT(std::unique_ptr<int>(), Not(IsNotNull()));
}
@ -1675,7 +1675,7 @@ MATCHER_P(UniquePointee, pointee, "") { return *arg == pointee; }
// Verifies that a matcher defined using MATCHER_P*() can work on
// move-only types.
TEST(MatcherPMacroTest, WorksOnMoveOnlyType) {
std::unique_ptr<int> p(new int(3));
std::unique_ptr<int> p = std::make_unique<int>(3);
EXPECT_THAT(p, UniquePointee(3));
EXPECT_THAT(p, Not(UniquePointee(2)));
}