зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1761511 - Part 5: Fix gtest deprecation warnings, r=ahal
The TEST_CASE_P macros are deprecated in newer versions of gtest. Differential Revision: https://phabricator.services.mozilla.com/D142612
This commit is contained in:
Родитель
ab856dbf40
Коммит
f1c3a8f87c
|
@ -35,5 +35,5 @@ static const PrincipalAttributesParam kAttributes[] = {
|
|||
{nsAutoCString("https://[::1]"), true},
|
||||
};
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(TestPrincipalAttributes, PrincipalAttributesTest,
|
||||
::testing::ValuesIn(kAttributes));
|
||||
INSTANTIATE_TEST_SUITE_P(TestPrincipalAttributes, PrincipalAttributesTest,
|
||||
::testing::ValuesIn(kAttributes));
|
||||
|
|
|
@ -191,7 +191,7 @@ TEST_P(TestWithParam_CString_ArrayBuffer_Pair, Ctor_EncodedBinary) {
|
|||
static const uint8_t zeroLengthBinaryEncodedBuffer[] = {Key::eBinary};
|
||||
static const uint8_t nonZeroLengthBinaryEncodedBuffer[] = {Key::eBinary,
|
||||
'a' + 1, 'b' + 1};
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
DOM_IndexedDB_Key, TestWithParam_CString_ArrayBuffer_Pair,
|
||||
::testing::Values(
|
||||
std::make_pair(BufferAsCString(zeroLengthBinaryEncodedBuffer), ""_ns),
|
||||
|
@ -210,7 +210,7 @@ static const uint8_t zeroLengthStringEncodedBuffer[] = {Key::eString};
|
|||
static const uint8_t nonZeroLengthStringEncodedBuffer[] = {Key::eString,
|
||||
'a' + 1, 'b' + 1};
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
DOM_IndexedDB_Key, TestWithParam_CString_String_Pair,
|
||||
::testing::Values(
|
||||
std::make_pair(BufferAsCString(zeroLengthStringEncodedBuffer), u""_ns),
|
||||
|
@ -227,11 +227,11 @@ TEST_P(TestWithParam_LiteralString, SetFromString) {
|
|||
EXPECT_EQ(GetParam(), key.ToString());
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(DOM_IndexedDB_Key, TestWithParam_LiteralString,
|
||||
::testing::Values(u""_ns, u"abc"_ns, u"\u007f"_ns,
|
||||
u"\u0080"_ns, u"\u1fff"_ns,
|
||||
u"\u7fff"_ns, u"\u8000"_ns,
|
||||
u"\uffff"_ns));
|
||||
INSTANTIATE_TEST_SUITE_P(DOM_IndexedDB_Key, TestWithParam_LiteralString,
|
||||
::testing::Values(u""_ns, u"abc"_ns, u"\u007f"_ns,
|
||||
u"\u0080"_ns, u"\u1fff"_ns,
|
||||
u"\u7fff"_ns, u"\u8000"_ns,
|
||||
u"\uffff"_ns));
|
||||
|
||||
static JS::Value CreateArrayBufferValue(JSContext* const aContext,
|
||||
const size_t aSize, char* const aData) {
|
||||
|
@ -322,7 +322,7 @@ TEST_P(TestWithParam_ArrayBufferArray, SetFromJSVal) {
|
|||
}
|
||||
|
||||
const uint8_t element2[] = "foo";
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
DOM_IndexedDB_Key, TestWithParam_ArrayBufferArray,
|
||||
testing::Values(std::vector<nsCString>{}, std::vector<nsCString>{""_ns},
|
||||
std::vector<nsCString>{""_ns, BufferAsCString(element2)}));
|
||||
|
@ -370,7 +370,7 @@ TEST_P(TestWithParam_StringArray, SetFromJSVal) {
|
|||
});
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
DOM_IndexedDB_Key, TestWithParam_StringArray,
|
||||
testing::Values(std::vector<nsString>{u""_ns, u"abc\u0080\u1fff"_ns},
|
||||
std::vector<nsString>{u"abc\u0080\u1fff"_ns,
|
||||
|
|
|
@ -1383,7 +1383,7 @@ class TransportSrtpParameterTest
|
|||
: public TransportTest,
|
||||
public ::testing::WithParamInterface<uint16_t> {};
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
SrtpParamInit, TransportSrtpParameterTest,
|
||||
::testing::ValuesIn(TransportLayerDtls::GetDefaultSrtpCiphers()));
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ TEST_F(CheckedUnsafePtrTest, PointeeWithNoCheckedUnsafePtrs) {
|
|||
template <typename PointerType>
|
||||
class TypedCheckedUnsafePtrTest : public CheckedUnsafePtrTest {};
|
||||
|
||||
TYPED_TEST_CASE_P(TypedCheckedUnsafePtrTest);
|
||||
TYPED_TEST_SUITE_P(TypedCheckedUnsafePtrTest);
|
||||
|
||||
TYPED_TEST_P(TypedCheckedUnsafePtrTest, PointeeWithOneCheckedUnsafePtr) {
|
||||
{
|
||||
|
@ -129,14 +129,14 @@ TYPED_TEST_P(TypedCheckedUnsafePtrTest,
|
|||
ASSERT_TRUE(dangling2);
|
||||
}
|
||||
|
||||
REGISTER_TYPED_TEST_CASE_P(TypedCheckedUnsafePtrTest,
|
||||
PointeeWithOneCheckedUnsafePtr,
|
||||
CheckedUnsafePtrCopyConstructed,
|
||||
CheckedUnsafePtrCopyAssigned,
|
||||
PointeeWithOneDanglingCheckedUnsafePtr,
|
||||
PointeeWithOneCopiedDanglingCheckedUnsafePtr,
|
||||
PointeeWithOneCopyAssignedDanglingCheckedUnsafePtr);
|
||||
REGISTER_TYPED_TEST_SUITE_P(TypedCheckedUnsafePtrTest,
|
||||
PointeeWithOneCheckedUnsafePtr,
|
||||
CheckedUnsafePtrCopyConstructed,
|
||||
CheckedUnsafePtrCopyAssigned,
|
||||
PointeeWithOneDanglingCheckedUnsafePtr,
|
||||
PointeeWithOneCopiedDanglingCheckedUnsafePtr,
|
||||
PointeeWithOneCopyAssignedDanglingCheckedUnsafePtr);
|
||||
|
||||
using BothTypes = ::testing::Types<BasePointee, DerivedPointee>;
|
||||
INSTANTIATE_TYPED_TEST_CASE_P(InstantiationOf, TypedCheckedUnsafePtrTest,
|
||||
BothTypes);
|
||||
INSTANTIATE_TYPED_TEST_SUITE_P(InstantiationOf, TypedCheckedUnsafePtrTest,
|
||||
BothTypes);
|
||||
|
|
|
@ -740,7 +740,7 @@ TEST_P(ParametrizedSeekCryptTest, DummyCipherStrategy_Seek) {
|
|||
Span{readData}.First(read).AsConst());
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
DOM_Quota_EncryptedStream_Parametrized, ParametrizedCryptTest,
|
||||
testing::Combine(
|
||||
/* dataSize */ testing::Values(0u, 16u, 256u, 512u, 513u),
|
||||
|
@ -755,7 +755,7 @@ INSTANTIATE_TEST_CASE_P(
|
|||
testing::Values(FlushMode::Never, FlushMode::AfterEachChunk)),
|
||||
TestParamToString);
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
DOM_IndexedDB_EncryptedStream_ParametrizedSeek, ParametrizedSeekCryptTest,
|
||||
testing::Combine(
|
||||
/* dataSize */ testing::Values(0u, 16u, 256u, 512u, 513u),
|
||||
|
|
|
@ -1536,7 +1536,7 @@ TEST_P(StringPairParameterized, AnonymizedOriginString) {
|
|||
EXPECT_STREQ(anonymized.get(), expectedAnonymized);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
QuotaCommon, StringPairParameterized,
|
||||
::testing::Values(
|
||||
// XXX Do we really want to anonymize about: origins?
|
||||
|
|
|
@ -158,7 +158,7 @@ class VP8CodecFactory : public CodecFactory {
|
|||
const libvpx_test::VP8CodecFactory kVP8;
|
||||
|
||||
#define VP8_INSTANTIATE_TEST_CASE(test, ...) \
|
||||
INSTANTIATE_TEST_CASE_P( \
|
||||
INSTANTIATE_TEST_SUITE_P( \
|
||||
VP8, test, \
|
||||
::testing::Combine( \
|
||||
::testing::Values(static_cast<const libvpx_test::CodecFactory *>( \
|
||||
|
@ -254,7 +254,7 @@ class VP9CodecFactory : public CodecFactory {
|
|||
const libvpx_test::VP9CodecFactory kVP9;
|
||||
|
||||
#define VP9_INSTANTIATE_TEST_CASE(test, ...) \
|
||||
INSTANTIATE_TEST_CASE_P( \
|
||||
INSTANTIATE_TEST_SUITE_P( \
|
||||
VP9, test, \
|
||||
::testing::Combine( \
|
||||
::testing::Values(static_cast<const libvpx_test::CodecFactory *>( \
|
||||
|
|
|
@ -3021,7 +3021,7 @@ TEST_P(JsepSessionTest, RenegotiationAnswererInactive) {
|
|||
ASSERT_EQ(types.size(), mSessionOff->GetTransceivers().size());
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Variants, JsepSessionTest,
|
||||
::testing::Values("audio", "video", "datachannel", "audio,video",
|
||||
"video,audio", "audio,datachannel", "video,datachannel",
|
||||
|
|
|
@ -3391,9 +3391,9 @@ TEST_P(NewSdpTest, NewSctpportSdpParse) {
|
|||
ParseSdp(kNewSctpportOfferDraft21, false);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(RoundTripSerialize, NewSdpTest,
|
||||
::testing::Combine(::testing::Bool(),
|
||||
::testing::Bool()));
|
||||
INSTANTIATE_TEST_SUITE_P(RoundTripSerialize, NewSdpTest,
|
||||
::testing::Combine(::testing::Bool(),
|
||||
::testing::Bool()));
|
||||
|
||||
const std::string kCandidateInSessionSDP =
|
||||
"v=0" CRLF "o=Mozilla-SIPUA-35.0a1 5184 0 IN IP4 0.0.0.0" CRLF
|
||||
|
|
|
@ -241,5 +241,5 @@ const SimpleParseTestData simple_parse_tests[] = {
|
|||
u"prefetch"_ns, u""_ns},
|
||||
};
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(TestLinkHeader, SimpleParseTest,
|
||||
testing::ValuesIn(simple_parse_tests));
|
||||
INSTANTIATE_TEST_SUITE_P(TestLinkHeader, SimpleParseTest,
|
||||
testing::ValuesIn(simple_parse_tests));
|
||||
|
|
|
@ -199,8 +199,8 @@ TEST_P(BTSignedTreeHeadTest, BTSignedTreeHeadSimpleTest) {
|
|||
}
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(BTSignedTreeHeadTest, BTSignedTreeHeadTest,
|
||||
testing::ValuesIn(BT_SIGNED_TREE_HEAD_TEST_PARAMS));
|
||||
INSTANTIATE_TEST_SUITE_P(BTSignedTreeHeadTest, BTSignedTreeHeadTest,
|
||||
testing::ValuesIn(BT_SIGNED_TREE_HEAD_TEST_PARAMS));
|
||||
|
||||
TEST_F(BTSignedTreeHeadTest, BTSignedTreeHeadTamperedSignatureTest) {
|
||||
Buffer subjectPublicKeyInfoBuffer(HexToBytes(ValidSTH::kSPKIHex));
|
||||
|
|
|
@ -250,8 +250,8 @@ TEST_P(BTVerificationTest, BTVerificationSimpleTest) {
|
|||
params.mDigestAlgorithm));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(BTVerificationTest, BTVerificationTest,
|
||||
testing::ValuesIn(BT_VERIFICATION_TEST_PARAMS));
|
||||
INSTANTIATE_TEST_SUITE_P(BTVerificationTest, BTVerificationTest,
|
||||
testing::ValuesIn(BT_VERIFICATION_TEST_PARAMS));
|
||||
|
||||
} // namespace ct
|
||||
} // namespace mozilla
|
||||
|
|
|
@ -58,5 +58,5 @@ TEST_P(psm_MD4, RFC1320TestValues) {
|
|||
<< "MD4 hashes aren't equal for input: '" << params.data << "'";
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(psm_MD4, psm_MD4,
|
||||
testing::ValuesIn(RFC1320_TEST_PARAMS));
|
||||
INSTANTIATE_TEST_SUITE_P(psm_MD4, psm_MD4,
|
||||
testing::ValuesIn(RFC1320_TEST_PARAMS));
|
||||
|
|
|
@ -482,5 +482,5 @@ TEST_P(UrlClassifierPrefixSetTest, LoadSaveNoDelta) {
|
|||
|
||||
// To run the same test for different configurations of
|
||||
// "browser_safebrowsing_prefixset_max_array_size"
|
||||
INSTANTIATE_TEST_CASE_P(UrlClassifierPrefixSetTest, UrlClassifierPrefixSetTest,
|
||||
::testing::Values(0, UINT32_MAX));
|
||||
INSTANTIATE_TEST_SUITE_P(UrlClassifierPrefixSetTest, UrlClassifierPrefixSetTest,
|
||||
::testing::Values(0, UINT32_MAX));
|
||||
|
|
|
@ -608,7 +608,7 @@ TEST(Hashtable, Keys)
|
|||
template <typename TypeParam>
|
||||
class BaseHashtableTest : public ::testing::Test {};
|
||||
|
||||
TYPED_TEST_CASE_P(BaseHashtableTest);
|
||||
TYPED_TEST_SUITE_P(BaseHashtableTest);
|
||||
|
||||
TYPED_TEST_P(BaseHashtableTest, Contains) {
|
||||
auto table =
|
||||
|
@ -1012,7 +1012,7 @@ TYPED_TEST_P(BaseHashtableTest, MarkImmutable) {
|
|||
table.MarkImmutable();
|
||||
}
|
||||
|
||||
REGISTER_TYPED_TEST_CASE_P(
|
||||
REGISTER_TYPED_TEST_SUITE_P(
|
||||
BaseHashtableTest, Contains, GetGeneration, SizeOfExcludingThis,
|
||||
SizeOfIncludingThis, Count, IsEmpty, Get_OutputParam, Get, MaybeGet,
|
||||
LookupOrInsert_Default, LookupOrInsert_NonDefault,
|
||||
|
@ -1031,8 +1031,8 @@ using BaseHashtableTestTypes =
|
|||
NonDefaultConstructible_NonDefaultConstructible,
|
||||
NonDefaultConstructible_MovingNonDefaultConstructible>;
|
||||
|
||||
INSTANTIATE_TYPED_TEST_CASE_P(Hashtables, BaseHashtableTest,
|
||||
BaseHashtableTestTypes, TypeNames);
|
||||
INSTANTIATE_TYPED_TEST_SUITE_P(Hashtables, BaseHashtableTest,
|
||||
BaseHashtableTestTypes, TypeNames);
|
||||
|
||||
TEST(Hashtables, DataHashtable)
|
||||
{
|
||||
|
|
|
@ -485,7 +485,7 @@ TEST(TArray, test_move_array)
|
|||
template <typename TypeParam>
|
||||
class TArray_MoveOnlyTest : public ::testing::Test {};
|
||||
|
||||
TYPED_TEST_CASE_P(TArray_MoveOnlyTest);
|
||||
TYPED_TEST_SUITE_P(TArray_MoveOnlyTest);
|
||||
|
||||
static constexpr size_t kMoveOnlyTestArrayLength = 4;
|
||||
|
||||
|
@ -639,7 +639,7 @@ TYPED_TEST_P(TArray_MoveOnlyTest,
|
|||
ASSERT_EQ(kMoveOnlyTestArrayLength, autoMoveOnlyArray.Length());
|
||||
}
|
||||
|
||||
REGISTER_TYPED_TEST_CASE_P(
|
||||
REGISTER_TYPED_TEST_SUITE_P(
|
||||
TArray_MoveOnlyTest, nsTArray_MoveConstruct, nsTArray_MoveAssign,
|
||||
nsTArray_MoveReAssign, nsTArray_to_FallibleTArray_MoveConstruct,
|
||||
nsTArray_to_FallibleTArray_MoveAssign,
|
||||
|
@ -656,8 +656,8 @@ REGISTER_TYPED_TEST_CASE_P(
|
|||
using BothMoveOnlyTypes =
|
||||
::testing::Types<MoveOnly_RelocateUsingMemutils,
|
||||
MoveOnly_RelocateUsingMoveConstructor>;
|
||||
INSTANTIATE_TYPED_TEST_CASE_P(InstantiationOf, TArray_MoveOnlyTest,
|
||||
BothMoveOnlyTypes);
|
||||
INSTANTIATE_TYPED_TEST_SUITE_P(InstantiationOf, TArray_MoveOnlyTest,
|
||||
BothMoveOnlyTypes);
|
||||
|
||||
//----
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче