diff --git a/test/fuse/linux/fuse_base.cc b/test/fuse/linux/fuse_base.cc index 1cd16067f..01f1a502c 100644 --- a/test/fuse/linux/fuse_base.cc +++ b/test/fuse/linux/fuse_base.cc @@ -24,6 +24,8 @@ #include #include +#include + #include "gmock/gmock.h" #include "gtest/gtest.h" #include "absl/strings/str_format.h" @@ -261,7 +263,7 @@ void FuseTest::ServerFuseLoop() { void FuseTest::SetUpFuseServer(const struct fuse_init_out* payload) { ASSERT_THAT(socketpair(AF_UNIX, SOCK_STREAM, 0, sock_), SyscallSucceeds()); - fuse_server_ = absl::make_unique([this, payload]() { + fuse_server_ = std::make_unique([this, payload]() { // Begin child thread, i.e. the FUSE server. ServerCompleteWith(ServerConsumeFuseInit(payload).ok()); ServerFuseLoop(); diff --git a/test/syscalls/linux/base_poll_test.cc b/test/syscalls/linux/base_poll_test.cc index ab7a19dd0..c03eb2083 100644 --- a/test/syscalls/linux/base_poll_test.cc +++ b/test/syscalls/linux/base_poll_test.cc @@ -19,6 +19,8 @@ #include #include +#include + #include "gtest/gtest.h" #include "absl/memory/memory.h" #include "absl/time/clock.h" @@ -51,7 +53,7 @@ void BasePollTest::SetTimer(absl::Duration duration) { ClearTimer(); // Create a new timer thread. - timer_ = absl::make_unique(absl::Now() + duration, tgid, tid); + timer_ = std::make_unique(absl::Now() + duration, tgid, tid); } bool BasePollTest::TimerFired() const { return timer_fired; } diff --git a/test/syscalls/linux/dup.cc b/test/syscalls/linux/dup.cc index 7da6ee5a0..e1a74b5f9 100644 --- a/test/syscalls/linux/dup.cc +++ b/test/syscalls/linux/dup.cc @@ -16,6 +16,8 @@ #include #include +#include + #include "gtest/gtest.h" #include "absl/memory/memory.h" #include "test/util/eventfd_util.h" @@ -125,7 +127,7 @@ TEST(DupTest, Rlimit) { if (new_fd == -1) { break; } - auto f = absl::make_unique(new_fd); + auto f = std::make_unique(new_fd); EXPECT_LT(new_fd, kFDLimit); EXPECT_GT(new_fd, prev_fd); // Check that all fds in (prev_fd, new_fd) are used. diff --git a/test/syscalls/linux/futex.cc b/test/syscalls/linux/futex.cc index 859f92b75..3f0f53fd1 100644 --- a/test/syscalls/linux/futex.cc +++ b/test/syscalls/linux/futex.cc @@ -270,7 +270,7 @@ TEST_P(PrivateAndSharedFutexTest, WakeAll) { std::vector> threads; threads.reserve(kThreads); for (int i = 0; i < kThreads; i++) { - threads.push_back(absl::make_unique([&] { + threads.push_back(std::make_unique([&] { EXPECT_THAT(futex_wait(IsPrivate(), &a, kInitialValue), SyscallSucceeds()); })); @@ -302,7 +302,7 @@ TEST_P(PrivateAndSharedFutexTest, WakeSome) { errs.push_back(0); } for (int i = 0; i < kThreads; i++) { - threads.push_back(absl::make_unique([&, i] { + threads.push_back(std::make_unique([&, i] { rets[i] = futex_wait(IsPrivate(), &a, kInitialValue, kIneffectiveWakeTimeout); errs[i] = errno; @@ -669,7 +669,7 @@ TEST_P(PrivateAndSharedFutexTest, PIConcurrency) { std::unique_ptr threads[100]; for (size_t i = 0; i < ABSL_ARRAYSIZE(threads); ++i) { - threads[i] = absl::make_unique([is_priv, &a] { + threads[i] = std::make_unique([is_priv, &a] { for (size_t j = 0; j < 10; ++j) { ASSERT_THAT(futex_lock_pi(is_priv, &a), SyscallSucceeds()); EXPECT_EQ(a.load() & FUTEX_TID_MASK, gettid()); @@ -725,7 +725,7 @@ TEST_P(PrivateAndSharedFutexTest, PITryLockConcurrency) { std::unique_ptr threads[10]; for (size_t i = 0; i < ABSL_ARRAYSIZE(threads); ++i) { - threads[i] = absl::make_unique([is_priv, &a] { + threads[i] = std::make_unique([is_priv, &a] { for (size_t j = 0; j < 10;) { if (futex_trylock_pi(is_priv, &a) == 0) { ++j; diff --git a/test/syscalls/linux/mempolicy.cc b/test/syscalls/linux/mempolicy.cc index fa8e5fcda..87f507ff9 100644 --- a/test/syscalls/linux/mempolicy.cc +++ b/test/syscalls/linux/mempolicy.cc @@ -15,6 +15,8 @@ #include #include +#include + #include "gtest/gtest.h" #include "absl/memory/memory.h" #include "test/util/cleanup.h" @@ -198,7 +200,7 @@ TEST(MempolicyTest, QueryAvailableNodes) { TEST(MempolicyTest, GetMempolicyQueryNodeForAddress) { uint64_t dummy_stack_address; - auto dummy_heap_address = absl::make_unique(); + auto dummy_heap_address = std::make_unique(); int mode; for (auto ptr : {&dummy_stack_address, dummy_heap_address.get()}) { diff --git a/test/syscalls/linux/open.cc b/test/syscalls/linux/open.cc index 6fd37f3a2..5ba14af86 100644 --- a/test/syscalls/linux/open.cc +++ b/test/syscalls/linux/open.cc @@ -19,6 +19,8 @@ #include #include +#include + #include "gmock/gmock.h" #include "gtest/gtest.h" #include "absl/memory/memory.h" @@ -325,7 +327,7 @@ TEST_F(OpenTest, AppendConcurrentWrite) { // Start kThreadCount threads which will write concurrently into the same // file. for (int i = 0; i < kThreadCount; i++) { - threads[i] = absl::make_unique([filename]() { + threads[i] = std::make_unique([filename]() { const FileDescriptor fd = ASSERT_NO_ERRNO_AND_VALUE(Open(filename, O_RDWR | O_APPEND)); diff --git a/test/syscalls/linux/preadv2.cc b/test/syscalls/linux/preadv2.cc index dec35b12d..9f896289e 100644 --- a/test/syscalls/linux/preadv2.cc +++ b/test/syscalls/linux/preadv2.cc @@ -17,6 +17,7 @@ #include #include +#include #include #include @@ -199,7 +200,7 @@ TEST(Preadv2Test, TestInvalidOffset) { const FileDescriptor fd = ASSERT_NO_ERRNO_AND_VALUE(Open(file.path(), O_RDONLY | O_DIRECT)); - auto iov = absl::make_unique(1); + auto iov = std::make_unique(1); iov[0].iov_base = nullptr; iov[0].iov_len = 0; @@ -217,7 +218,7 @@ TEST(Preadv2Test, TestUnreadableFile) { const FileDescriptor fd = ASSERT_NO_ERRNO_AND_VALUE(Open(file.path(), O_WRONLY)); - auto iov = absl::make_unique(1); + auto iov = std::make_unique(1); iov[0].iov_base = nullptr; iov[0].iov_len = 0; @@ -234,7 +235,7 @@ TEST(Preadv2Test, Preadv2WithOpath) { const FileDescriptor fd = ASSERT_NO_ERRNO_AND_VALUE(Open(file.path(), O_PATH)); - auto iov = absl::make_unique(1); + auto iov = std::make_unique(1); iov[0].iov_base = nullptr; iov[0].iov_len = 0; @@ -252,7 +253,7 @@ TEST(Preadv2Test, TestUnseekableFileInvalid) { ASSERT_THAT(pipe(pipe_fds), SyscallSucceeds()); - auto iov = absl::make_unique(1); + auto iov = std::make_unique(1); iov[0].iov_base = nullptr; iov[0].iov_len = 0; @@ -277,7 +278,7 @@ TEST(Preadv2Test, TestUnseekableFileValid) { SyscallSucceedsWithValue(content.size())); std::vector buf(content.size()); - auto iov = absl::make_unique(1); + auto iov = std::make_unique(1); iov[0].iov_base = buf.data(); iov[0].iov_len = buf.size(); diff --git a/test/syscalls/linux/semaphore.cc b/test/syscalls/linux/semaphore.cc index 87b66aa98..562e559c0 100644 --- a/test/syscalls/linux/semaphore.cc +++ b/test/syscalls/linux/semaphore.cc @@ -20,6 +20,7 @@ #include #include #include +#include #include #include "gmock/gmock.h" @@ -371,7 +372,7 @@ TEST(SemaphoreTest, SemOpRandom) { // These threads will wait in a loop. std::unique_ptr decs[5]; for (auto& dec : decs) { - dec = absl::make_unique([&sem, &mutex, &count, &seed, &done] { + dec = std::make_unique([&sem, &mutex, &count, &seed, &done] { for (size_t i = 0; i < 500; ++i) { int16_t val; { @@ -393,7 +394,7 @@ TEST(SemaphoreTest, SemOpRandom) { // These threads will wait for zero in a loop. std::unique_ptr zeros[5]; for (auto& zero : zeros) { - zero = absl::make_unique([&sem, &mutex, &done] { + zero = std::make_unique([&sem, &mutex, &done] { for (size_t i = 0; i < 500; ++i) { { absl::MutexLock l(&mutex); @@ -412,7 +413,7 @@ TEST(SemaphoreTest, SemOpRandom) { // These threads will signal in a loop. std::unique_ptr incs[5]; for (auto& inc : incs) { - inc = absl::make_unique([&sem, &mutex, &count, &seed] { + inc = std::make_unique([&sem, &mutex, &count, &seed] { for (size_t i = 0; i < 500; ++i) { int16_t val; { diff --git a/test/syscalls/linux/socket_bind_to_device_distribution.cc b/test/syscalls/linux/socket_bind_to_device_distribution.cc index 4cddb875a..dc7930bd1 100644 --- a/test/syscalls/linux/socket_bind_to_device_distribution.cc +++ b/test/syscalls/linux/socket_bind_to_device_distribution.cc @@ -139,7 +139,7 @@ TEST_P(BindToDeviceDistributionTest, Tcp) { listener_fds.size()); for (size_t i = 0; i < listener_fds.size(); i++) { - listen_threads[i] = absl::make_unique( + listen_threads[i] = std::make_unique( [&listener_fds, &accept_counts, &connects_received, i, kConnectAttempts]() { do { @@ -262,7 +262,7 @@ TEST_P(BindToDeviceDistributionTest, Udp) { listener_fds.size()); for (size_t i = 0; i < listener_fds.size(); i++) { - receiver_threads[i] = absl::make_unique( + receiver_threads[i] = std::make_unique( [&listener_fds, &packets_per_socket, &packets_received, i]() { do { struct sockaddr_storage addr = {}; diff --git a/test/syscalls/linux/socket_inet_loopback.cc b/test/syscalls/linux/socket_inet_loopback.cc index 0ba88735f..3ed8c38b4 100644 --- a/test/syscalls/linux/socket_inet_loopback.cc +++ b/test/syscalls/linux/socket_inet_loopback.cc @@ -1420,7 +1420,7 @@ TEST_P(SocketInetReusePortTest, TcpPortReuseMultiThread) { DisableSave ds; for (int i = 0; i < kThreadCount; i++) { - listen_thread[i] = absl::make_unique( + listen_thread[i] = std::make_unique( [&listener_fds, &accept_counts, i, &connects_received]() { do { auto fd = Accept(listener_fds[i].get(), nullptr, nullptr); @@ -1527,7 +1527,7 @@ TEST_P(SocketInetReusePortTest, UdpPortReuseMultiThread) { DisableSave ds; // Too expensive. for (int i = 0; i < kThreadCount; i++) { - receiver_thread[i] = absl::make_unique( + receiver_thread[i] = std::make_unique( [&listener_fds, &packets_per_socket, i, &packets_received]() { do { struct sockaddr_storage addr = {}; diff --git a/test/syscalls/linux/socket_ip_tcp_generic.cc b/test/syscalls/linux/socket_ip_tcp_generic.cc index c5f699366..e9d7509c5 100644 --- a/test/syscalls/linux/socket_ip_tcp_generic.cc +++ b/test/syscalls/linux/socket_ip_tcp_generic.cc @@ -1119,6 +1119,8 @@ TEST_P(TCPSocketPairTest, SpliceToPipe) { #include +#include + TEST_P(TCPSocketPairTest, SendfileFromRegularFileSucceeds) { auto sockets = ASSERT_NO_ERRNO_AND_VALUE(NewSocketPair()); const TempPath in_file = ASSERT_NO_ERRNO_AND_VALUE(TempPath::CreateFile()); @@ -1214,7 +1216,7 @@ TEST_P(TCPSocketPairTest, TCPResetDuringClose) { constexpr int kThreadCount = 100; std::unique_ptr instances[kThreadCount]; for (int i = 0; i < kThreadCount; i++) { - instances[i] = absl::make_unique([&]() { + instances[i] = std::make_unique([&]() { auto sockets = ASSERT_NO_ERRNO_AND_VALUE(NewSocketPair()); ScopedThread t([&]() { diff --git a/test/syscalls/linux/socket_ipv4_udp_unbound.cc b/test/syscalls/linux/socket_ipv4_udp_unbound.cc index 896eaa516..0fd7699e2 100644 --- a/test/syscalls/linux/socket_ipv4_udp_unbound.cc +++ b/test/syscalls/linux/socket_ipv4_udp_unbound.cc @@ -20,6 +20,7 @@ #include #include +#include #include "gtest/gtest.h" #include "absl/memory/memory.h" @@ -1014,10 +1015,10 @@ TEST_P(IPv4UDPUnboundSocketTest, TestTwoSocketsJoinSameMulticastGroup) { // and both will receive data on it. TEST_P(IPv4UDPUnboundSocketTest, TestMcastReceptionOnTwoSockets) { std::unique_ptr socket_pairs[2] = { - absl::make_unique(ASSERT_NO_ERRNO_AND_VALUE(NewSocket()), - ASSERT_NO_ERRNO_AND_VALUE(NewSocket())), - absl::make_unique(ASSERT_NO_ERRNO_AND_VALUE(NewSocket()), - ASSERT_NO_ERRNO_AND_VALUE(NewSocket()))}; + std::make_unique(ASSERT_NO_ERRNO_AND_VALUE(NewSocket()), + ASSERT_NO_ERRNO_AND_VALUE(NewSocket())), + std::make_unique(ASSERT_NO_ERRNO_AND_VALUE(NewSocket()), + ASSERT_NO_ERRNO_AND_VALUE(NewSocket()))}; ip_mreq iface = {}, group = {}; iface.imr_interface.s_addr = htonl(INADDR_LOOPBACK); @@ -1087,10 +1088,10 @@ TEST_P(IPv4UDPUnboundSocketTest, TestMcastReceptionOnTwoSockets) { // both memberships have been dropped. TEST_P(IPv4UDPUnboundSocketTest, TestMcastReceptionWhenDroppingMemberships) { std::unique_ptr socket_pairs[2] = { - absl::make_unique(ASSERT_NO_ERRNO_AND_VALUE(NewSocket()), - ASSERT_NO_ERRNO_AND_VALUE(NewSocket())), - absl::make_unique(ASSERT_NO_ERRNO_AND_VALUE(NewSocket()), - ASSERT_NO_ERRNO_AND_VALUE(NewSocket()))}; + std::make_unique(ASSERT_NO_ERRNO_AND_VALUE(NewSocket()), + ASSERT_NO_ERRNO_AND_VALUE(NewSocket())), + std::make_unique(ASSERT_NO_ERRNO_AND_VALUE(NewSocket()), + ASSERT_NO_ERRNO_AND_VALUE(NewSocket()))}; ip_mreq iface = {}, group = {}; iface.imr_interface.s_addr = htonl(INADDR_LOOPBACK); diff --git a/test/util/socket_util.cc b/test/util/socket_util.cc index bda6665b3..4d3ed5f78 100644 --- a/test/util/socket_util.cc +++ b/test/util/socket_util.cc @@ -43,8 +43,8 @@ Creator SyscallSocketPairCreator(int domain, int type, int pair[2]; RETURN_ERROR_IF_SYSCALL_FAIL(socketpair(domain, type, protocol, pair)); MaybeSave(); // Save on successful creation. - return absl::make_unique(FileDescriptor(pair[0]), - FileDescriptor(pair[1])); + return std::make_unique(FileDescriptor(pair[0]), + FileDescriptor(pair[1])); }; } @@ -54,7 +54,7 @@ Creator SyscallSocketCreator(int domain, int type, int fd = 0; RETURN_ERROR_IF_SYSCALL_FAIL(fd = socket(domain, type, protocol)); MaybeSave(); // Save on successful creation. - return absl::make_unique(fd); + return std::make_unique(fd); }; } @@ -128,7 +128,7 @@ Creator AcceptBindSocketPairCreator(bool abstract, int domain, // accepted is before connected to destruct connected before accepted. // Destructors for nonstatic member objects are called in the reverse order // in which they appear in the class declaration. - return absl::make_unique( + return std::make_unique( std::move(accepted), std::move(connected), bind_addr, extra_addr); }; } @@ -188,7 +188,7 @@ Creator BidirectionalBindSocketPairCreator(bool abstract, MaybeSave(); // Successful unlink. } - return absl::make_unique(std::move(sock1), std::move(sock2)); + return std::make_unique(std::move(sock1), std::move(sock2)); }; } @@ -242,7 +242,7 @@ Creator SocketpairGoferSocketPairCreator(int domain, int type, RETURN_ERROR_IF_SYSCALL_FAIL(close(sock)); } - return absl::make_unique(std::move(sock1), std::move(sock2)); + return std::make_unique(std::move(sock1), std::move(sock2)); }; } @@ -268,7 +268,7 @@ Creator SocketpairGoferFileSocketPairCreator(int flags) { sock2.reset(sock2_fd); } - return absl::make_unique(std::move(sock1), std::move(sock2)); + return std::make_unique(std::move(sock1), std::move(sock2)); }; } @@ -284,8 +284,8 @@ Creator UnboundSocketPairCreator(bool abstract, int domain, MaybeSave(); // Successful socket creation. ASSIGN_OR_RETURN_ERRNO(auto sock2, Socket(domain, type, protocol)); MaybeSave(); // Successful socket creation. - return absl::make_unique(std::move(sock1), - std::move(sock2), addr1, addr2); + return std::make_unique(std::move(sock1), + std::move(sock2), addr1, addr2); }; } @@ -382,7 +382,7 @@ CreateTCPConnectAcceptSocketPair(int bound, FileDescriptor connected, int type, T extra_addr = {}; LocalhostAddr(&extra_addr, dual_stack); - return absl::make_unique( + return std::make_unique( std::move(connected), std::move(accepted), bind_addr, extra_addr); } @@ -485,8 +485,8 @@ PosixErrorOr> CreateUDPBoundSocketPair( ASSIGN_OR_RETURN_ERRNO(T addr1, BindIP(sock1.get(), dual_stack)); ASSIGN_OR_RETURN_ERRNO(T addr2, BindIP(sock2.get(), dual_stack)); - return absl::make_unique(std::move(sock1), std::move(sock2), - addr1, addr2); + return std::make_unique(std::move(sock1), std::move(sock2), + addr1, addr2); } template @@ -538,7 +538,7 @@ Creator UDPUnboundSocketPairCreator(int domain, int type, ASSIGN_OR_RETURN_ERRNO(auto sock2, Socket(domain, type, protocol)); MaybeSave(); // Successful socket creation. - return absl::make_unique(std::move(sock1), std::move(sock2)); + return std::make_unique(std::move(sock1), std::move(sock2)); }; } @@ -549,7 +549,7 @@ SocketPairKind Reversed(SocketPairKind const& base) { base.protocol, [creator]() -> PosixErrorOr> { ASSIGN_OR_RETURN_ERRNO(auto creator_value, creator()); - return absl::make_unique(std::move(creator_value)); + return std::make_unique(std::move(creator_value)); }}; } @@ -560,7 +560,7 @@ Creator UnboundSocketCreator(int domain, int type, RETURN_ERROR_IF_SYSCALL_FAIL(sock = socket(domain, type, protocol)); MaybeSave(); // Successful socket creation. - return absl::make_unique(sock); + return std::make_unique(sock); }; }