Appease googletest deprecation

PiperOrigin-RevId: 245788366
Change-Id: I17bbecf8493132dbe95564c34c45b838194bfabb
This commit is contained in:
Tamir Duberstein
2019-04-29 11:34:16 -07:00
committed by Shentubot
parent 2df64cd6d2
commit ac8fca1ef4
58 changed files with 113 additions and 112 deletions
+1 -1
View File
@@ -580,7 +580,7 @@ TEST_P(AllSocketPairTest, BindAfterAcceptSenderAddr) {
0);
}
INSTANTIATE_TEST_CASE_P(
INSTANTIATE_TEST_SUITE_P(
AllUnixDomainSockets, AllSocketPairTest,
::testing::ValuesIn(VecCat<SocketPairKind>(
ApplyVec<SocketPairKind>(
+1 -1
View File
@@ -73,7 +73,7 @@ TEST_P(AllSocketPairTest, BoundSenderAddrCoalesced) {
0);
}
INSTANTIATE_TEST_CASE_P(
INSTANTIATE_TEST_SUITE_P(
AllUnixDomainSockets, AllSocketPairTest,
::testing::ValuesIn(VecCat<SocketPairKind>(
ApplyVec<SocketPairKind>(FilesystemUnboundUnixDomainSocketPair,
+5 -5
View File
@@ -397,9 +397,9 @@ TEST_P(AIOReadWriteParamTest, BadOffset) {
ASSERT_THAT(Submit(1, cbs), SyscallFailsWithErrno(EINVAL));
}
INSTANTIATE_TEST_CASE_P(BadOffset, AIOReadWriteParamTest,
::testing::Values(IOCB_CMD_PREAD, IOCB_CMD_PWRITE,
IOCB_CMD_PREADV, IOCB_CMD_PWRITEV));
INSTANTIATE_TEST_SUITE_P(BadOffset, AIOReadWriteParamTest,
::testing::Values(IOCB_CMD_PREAD, IOCB_CMD_PWRITE,
IOCB_CMD_PREADV, IOCB_CMD_PWRITEV));
class AIOVectorizedParamTest : public AIOTest,
public ::testing::WithParamInterface<int> {};
@@ -426,8 +426,8 @@ TEST_P(AIOVectorizedParamTest, BadIOVecs) {
ASSERT_THAT(Submit(1, cbs), SyscallFailsWithErrno(EFAULT));
}
INSTANTIATE_TEST_CASE_P(BadIOVecs, AIOVectorizedParamTest,
::testing::Values(IOCB_CMD_PREADV, IOCB_CMD_PWRITEV));
INSTANTIATE_TEST_SUITE_P(BadIOVecs, AIOVectorizedParamTest,
::testing::Values(IOCB_CMD_PREADV, IOCB_CMD_PWRITEV));
} // namespace testing
} // namespace gvisor
+1 -1
View File
@@ -126,7 +126,7 @@ TEST_P(AllSocketPairTest, Unbind) {
ASSERT_THAT(close(sockets->release_second_fd()), SyscallSucceeds());
}
INSTANTIATE_TEST_CASE_P(
INSTANTIATE_TEST_SUITE_P(
AllUnixDomainSockets, AllSocketPairTest,
::testing::ValuesIn(VecCat<SocketPairKind>(
ApplyVec<SocketPairKind>(
+1 -1
View File
@@ -160,7 +160,7 @@ PosixError errorFromReturn(const std::string& name, int ret) {
return NoError();
}
INSTANTIATE_TEST_CASE_P(
INSTANTIATE_TEST_SUITE_P(
ChownKinds, ChownParamTest,
::testing::Values(
[](const std::string& path, uid_t owner, gid_t group) -> PosixError {
+5 -5
View File
@@ -132,11 +132,11 @@ std::string PrintClockId(::testing::TestParamInfo<clockid_t> info) {
}
}
INSTANTIATE_TEST_CASE_P(ClockGettime, MonotonicClockTest,
::testing::Values(CLOCK_MONOTONIC,
CLOCK_MONOTONIC_COARSE,
CLOCK_MONOTONIC_RAW),
PrintClockId);
INSTANTIATE_TEST_SUITE_P(ClockGettime, MonotonicClockTest,
::testing::Values(CLOCK_MONOTONIC,
CLOCK_MONOTONIC_COARSE,
CLOCK_MONOTONIC_RAW),
PrintClockId);
TEST(ClockGettime, UnimplementedReturnsEINVAL) {
SKIP_IF(!IsRunningOnGvisor());
+2 -2
View File
@@ -123,8 +123,8 @@ TEST_P(WallClockNanosleepTest, SleepUntil) {
EXPECT_GE(after, until);
}
INSTANTIATE_TEST_CASE_P(Sleepers, WallClockNanosleepTest,
::testing::Values(CLOCK_REALTIME, CLOCK_MONOTONIC));
INSTANTIATE_TEST_SUITE_P(Sleepers, WallClockNanosleepTest,
::testing::Values(CLOCK_REALTIME, CLOCK_MONOTONIC));
TEST(ClockNanosleepProcessTest, SleepFiveSeconds) {
absl::Duration const kDuration = absl::Seconds(5);
+2 -2
View File
@@ -828,7 +828,7 @@ TEST_P(ElfInterpreterStaticTest, Test) {
}
}
INSTANTIATE_TEST_CASE_P(
INSTANTIATE_TEST_SUITE_P(
Cases, ElfInterpreterStaticTest,
::testing::ValuesIn({
// Simple NUL-terminator to run the interpreter as normal.
@@ -866,7 +866,7 @@ TEST_P(ElfInterpreterBadPathTest, Test) {
EXPECT_EQ(execve_errno, expected_errno);
}
INSTANTIATE_TEST_CASE_P(
INSTANTIATE_TEST_SUITE_P(
Cases, ElfInterpreterBadPathTest,
::testing::ValuesIn({
// NUL-terminated fake path in the PT_INTERP segment.
+2 -2
View File
@@ -503,8 +503,8 @@ TEST_P(PrivateAndSharedFutexTest, WakeWrongKind_NoRandomSave) {
EXPECT_THAT(futex_wake(!IsPrivate(), &a, 1), SyscallSucceedsWithValue(0));
}
INSTANTIATE_TEST_CASE_P(SharedPrivate, PrivateAndSharedFutexTest,
::testing::Bool());
INSTANTIATE_TEST_SUITE_P(SharedPrivate, PrivateAndSharedFutexTest,
::testing::Bool());
// Passing null as the address only works for private futexes.
+3 -3
View File
@@ -224,8 +224,8 @@ class GetdentsTest : public ::testing::Test {
FileDescriptor fd_;
};
// GUnit TYPED_TEST_CASE does not allow multiple template parameters, so we
// must use explicit template specialization to set the syscall number.
// Multiple template parameters are not allowed, so we must use explicit
// template specialization to set the syscall number.
template <>
int GetdentsTest<struct linux_dirent>::SyscallNum() {
return SYS_getdents;
@@ -239,7 +239,7 @@ int GetdentsTest<struct linux_dirent64>::SyscallNum() {
// Test both legacy getdents and getdents64.
typedef ::testing::Types<struct linux_dirent, struct linux_dirent64>
GetdentsTypes;
TYPED_TEST_CASE(GetdentsTest, GetdentsTypes);
TYPED_TEST_SUITE(GetdentsTest, GetdentsTypes);
// N.B. TYPED_TESTs require explicitly using this-> to access members of
// GetdentsTest, since we are inside of a derived class template.
+2 -2
View File
@@ -348,8 +348,8 @@ std::vector<SocketKind> IoctlSocketTypes() {
SimpleSocket(AF_INET6, SOCK_DGRAM, 0)};
}
INSTANTIATE_TEST_CASE_P(IoctlTest, IoctlTestSIOCGIFCONF,
::testing::ValuesIn(IoctlSocketTypes()));
INSTANTIATE_TEST_SUITE_P(IoctlTest, IoctlTestSIOCGIFCONF,
::testing::ValuesIn(IoctlSocketTypes()));
} // namespace
+2 -2
View File
@@ -377,8 +377,8 @@ TEST_P(MremapParamTest, Fixed_Expansion) {
EXPECT_THAT(InForkedProcess(rest), IsPosixErrorOkAndHolds(0));
}
INSTANTIATE_TEST_CASE_P(PrivateShared, MremapParamTest,
::testing::Values(MAP_PRIVATE, MAP_SHARED));
INSTANTIATE_TEST_SUITE_P(PrivateShared, MremapParamTest,
::testing::Values(MAP_PRIVATE, MAP_SHARED));
// mremap with old_size == 0 only works with MAP_SHARED after Linux 4.14
// (dba58d3b8c50 "mm/mremap: fail map duplication attempts for private
+5 -5
View File
@@ -93,9 +93,9 @@ TEST_P(MsyncNoMappingTest, UnmappedAddressWithNonzeroLengthFails) {
SyscallFailsWithErrno(ENOMEM));
}
INSTANTIATE_TEST_CASE_P(All, MsyncNoMappingTest,
::testing::Combine(::testing::ValuesIn(kMsyncFlags),
::testing::Values(NoMappings)));
INSTANTIATE_TEST_SUITE_P(All, MsyncNoMappingTest,
::testing::Combine(::testing::ValuesIn(kMsyncFlags),
::testing::Values(NoMappings)));
// "Fixture" for msync tests that are not parameterized by msync flags, but do
// create mappings.
@@ -107,7 +107,7 @@ TEST_P(MsyncNoFlagsTest, BothSyncAndAsyncFails) {
SyscallFailsWithErrno(EINVAL));
}
INSTANTIATE_TEST_CASE_P(
INSTANTIATE_TEST_SUITE_P(
All, MsyncNoFlagsTest,
::testing::Combine(::testing::Values(0), // ignored
::testing::ValuesIn(SyncableMappings())));
@@ -142,7 +142,7 @@ TEST_P(MsyncFullParamTest, InvalidateUnlockedSucceeds) {
// The test for MS_INVALIDATE on mlocked pages is in mlock.cc since it requires
// probing for mlock support.
INSTANTIATE_TEST_CASE_P(
INSTANTIATE_TEST_SUITE_P(
All, MsyncFullParamTest,
::testing::Combine(::testing::ValuesIn(kMsyncFlags),
::testing::ValuesIn(SyncableMappings())));
+4 -4
View File
@@ -904,8 +904,8 @@ TEST_P(ProcPidStatTest, HasBasicFields) {
EXPECT_GT(rsslim, 0);
}
INSTANTIATE_TEST_CASE_P(SelfAndNumericPid, ProcPidStatTest,
::testing::Values("self", absl::StrCat(getpid())));
INSTANTIATE_TEST_SUITE_P(SelfAndNumericPid, ProcPidStatTest,
::testing::Values("self", absl::StrCat(getpid())));
using ProcPidStatmTest = ::testing::TestWithParam<std::string>;
@@ -925,8 +925,8 @@ TEST_P(ProcPidStatmTest, HasBasicFields) {
EXPECT_GT(rss, 0);
}
INSTANTIATE_TEST_CASE_P(SelfAndNumericPid, ProcPidStatmTest,
::testing::Values("self", absl::StrCat(getpid())));
INSTANTIATE_TEST_SUITE_P(SelfAndNumericPid, ProcPidStatmTest,
::testing::Values("self", absl::StrCat(getpid())));
PosixErrorOr<uint64_t> CurrentRSS() {
ASSIGN_OR_RETURN_ERRNO(auto proc_self_stat, GetContents("/proc/self/stat"));
+6 -6
View File
@@ -253,9 +253,9 @@ TEST_P(ProcSelfUidGidMapTest, MapOtherID) {
IsPosixErrorOkAndHolds(0));
}
INSTANTIATE_TEST_CASE_P(All, ProcSelfUidGidMapTest,
::testing::ValuesIn(UidGidMapTestParams()),
DescribeTestParam);
INSTANTIATE_TEST_SUITE_P(All, ProcSelfUidGidMapTest,
::testing::ValuesIn(UidGidMapTestParams()),
DescribeTestParam);
TEST_P(ProcPidUidGidMapTest, MapOtherIDPrivileged) {
// Like ProcSelfUidGidMapTest_MapOtherID, but since we have CAP_SET*ID in the
@@ -302,9 +302,9 @@ TEST_P(ProcPidUidGidMapTest, MapAnyIDsPrivileged) {
SyscallSucceedsWithValue(sizeof(entries)));
}
INSTANTIATE_TEST_CASE_P(All, ProcPidUidGidMapTest,
::testing::ValuesIn(UidGidMapTestParams()),
DescribeTestParam);
INSTANTIATE_TEST_SUITE_P(All, ProcPidUidGidMapTest,
::testing::ValuesIn(UidGidMapTestParams()),
DescribeTestParam);
} // namespace testing
} // namespace gvisor
+1 -1
View File
@@ -625,7 +625,7 @@ TEST_P(PtraceExecveTest, Execve_GetRegs_PeekUser_SIGKILL_TraceClone_TraceExit) {
_exit(1);
}
INSTANTIATE_TEST_CASE_P(TraceExec, PtraceExecveTest, ::testing::Bool());
INSTANTIATE_TEST_SUITE_P(TraceExec, PtraceExecveTest, ::testing::Bool());
// This test has expectations on when syscall-enter/exit-stops occur that are
// violated if saving occurs, since saving interrupts all syscalls, causing
+2 -2
View File
@@ -30,11 +30,11 @@ std::vector<SocketPairKind> GetSocketPairs() {
List<int>{0, SOCK_NONBLOCK}));
}
INSTANTIATE_TEST_CASE_P(
INSTANTIATE_TEST_SUITE_P(
AllUnixDomainSockets, AllSocketPairTest,
::testing::ValuesIn(IncludeReversals(GetSocketPairs())));
INSTANTIATE_TEST_CASE_P(
INSTANTIATE_TEST_SUITE_P(
AllUnixDomainSockets, UnixSocketPairTest,
::testing::ValuesIn(IncludeReversals(GetSocketPairs())));
+2 -2
View File
@@ -30,11 +30,11 @@ std::vector<SocketPairKind> GetSocketPairs() {
List<int>{0, SOCK_NONBLOCK}));
}
INSTANTIATE_TEST_CASE_P(
INSTANTIATE_TEST_SUITE_P(
AllUnixDomainSockets, AllSocketPairTest,
::testing::ValuesIn(IncludeReversals(GetSocketPairs())));
INSTANTIATE_TEST_CASE_P(
INSTANTIATE_TEST_SUITE_P(
AllUnixDomainSockets, UnixSocketPairTest,
::testing::ValuesIn(IncludeReversals(GetSocketPairs())));
+7 -6
View File
@@ -144,7 +144,7 @@ TEST_P(SocketInetLoopbackTest, TCP) {
ASSERT_THAT(shutdown(conn_fd.get(), SHUT_RDWR), SyscallSucceeds());
}
INSTANTIATE_TEST_CASE_P(
INSTANTIATE_TEST_SUITE_P(
All, SocketInetLoopbackTest,
::testing::Values(
// Listeners bound to IPv4 addresses refuse connections using IPv6
@@ -394,7 +394,7 @@ TEST_P(SocketInetReusePortTest, UdpPortReuseMultiThread) {
EquivalentWithin((kConnectAttempts / kThreadCount), 0.10));
}
INSTANTIATE_TEST_CASE_P(
INSTANTIATE_TEST_SUITE_P(
All, SocketInetReusePortTest,
::testing::Values(
// Listeners bound to IPv4 addresses refuse connections using IPv6
@@ -1040,10 +1040,11 @@ TEST_P(SocketMultiProtocolInetLoopbackTest, PortReuseTwoSockets) {
}
}
INSTANTIATE_TEST_CASE_P(AllFamlies, SocketMultiProtocolInetLoopbackTest,
::testing::Values(ProtocolTestParam{"TCP", SOCK_STREAM},
ProtocolTestParam{"UDP", SOCK_DGRAM}),
DescribeProtocolTestParam);
INSTANTIATE_TEST_SUITE_P(
AllFamlies, SocketMultiProtocolInetLoopbackTest,
::testing::Values(ProtocolTestParam{"TCP", SOCK_STREAM},
ProtocolTestParam{"UDP", SOCK_DGRAM}),
DescribeProtocolTestParam);
} // namespace
@@ -38,7 +38,7 @@ std::vector<SocketPairKind> GetSocketPairs() {
}));
}
INSTANTIATE_TEST_CASE_P(
INSTANTIATE_TEST_SUITE_P(
AllUnixDomainSockets, BlockingSocketPairTest,
::testing::ValuesIn(IncludeReversals(GetSocketPairs())));

Some files were not shown because too many files have changed in this diff Show More