Stop using Googletest legacy APIs.

Googletest recently started replacing the term Test Case by Test Suite.
From now on, the preferred API is TestSuite*; the older TestCase* API
will be slowly deprecated.

This CL moves WebRTC to the new set of APIs.

More info in [1].

This CL has been generated with this script:

declare -A items
items[TYPED_TEST_CASE]=TYPED_TEST_SUITE
items[TYPED_TEST_CASE_P]=TYPED_TEST_SUITE_P
items[REGISTER_TYPED_TEST_CASE_P]=REGISTER_TYPED_TEST_SUITE_P
items[INSTANTIATE_TYPED_TEST_CASE_P]=INSTANTIATE_TYPED_TEST_SUITE_P
items[INSTANTIATE_TEST_CASE_P]=INSTANTIATE_TEST_SUITE_P
for i in "${!items[@]}"
do
  git ls-files | xargs sed -i "s/\b$i\b/${items[$i]}/g"
done
git cl format

[1] - https://github.com/google/googletest/blob/master/googletest/docs/primer.md#beware-of-the-nomenclature

Bug: None
Change-Id: I5ae191e3046caf347aeee01554d5743548ab0e3f
Reviewed-on: https://webrtc-review.googlesource.com/c/118701
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26494}
This commit is contained in:
Mirko Bonadei
2019-01-31 12:20:57 +01:00
committed by Commit Bot
parent 12e5d392cc
commit c84f661b10
77 changed files with 354 additions and 347 deletions

View File

@ -103,9 +103,9 @@ TEST_P(AudioEncoderFactoryTest, CanRunAllSupportedEncoders) {
}
}
INSTANTIATE_TEST_CASE_P(BuiltinAudioEncoderFactoryTest,
AudioEncoderFactoryTest,
::testing::Values(CreateBuiltinAudioEncoderFactory()));
INSTANTIATE_TEST_SUITE_P(BuiltinAudioEncoderFactoryTest,
AudioEncoderFactoryTest,
::testing::Values(CreateBuiltinAudioEncoderFactory()));
TEST(BuiltinAudioEncoderFactoryTest, SupportsTheExpectedFormats) {
using ::testing::ElementsAreArray;

View File

@ -103,7 +103,7 @@ TEST_P(SplitIlbcTest, NumFrames) {
// Also test the maximum number of frames in one packet for 20 and 30 ms.
// The maximum is defined by the largest payload length that can be uniquely
// resolved to a frame size of either 38 bytes (20 ms) or 50 bytes (30 ms).
INSTANTIATE_TEST_CASE_P(
INSTANTIATE_TEST_SUITE_P(
IlbcTest,
SplitIlbcTest,
::testing::Values(std::pair<int, int>(1, 20), // 1 frame, 20 ms.

View File

@ -112,6 +112,8 @@ const coding_param param_set[] = {
string("pcm"),
true)};
INSTANTIATE_TEST_CASE_P(AllTest, IsacSpeedTest, ::testing::ValuesIn(param_set));
INSTANTIATE_TEST_SUITE_P(AllTest,
IsacSpeedTest,
::testing::ValuesIn(param_set));
} // namespace webrtc

View File

@ -252,6 +252,6 @@ std::vector<IsacTestParam> TestCases() {
return cases;
}
INSTANTIATE_TEST_CASE_P(, IsacCommonTest, testing::ValuesIn(TestCases()));
INSTANTIATE_TEST_SUITE_P(, IsacCommonTest, testing::ValuesIn(TestCases()));
} // namespace webrtc

View File

@ -160,7 +160,7 @@ TEST_P(SplitBySamplesTest, PayloadSizes) {
}
}
INSTANTIATE_TEST_CASE_P(
INSTANTIATE_TEST_SUITE_P(
LegacyEncodedAudioFrame,
SplitBySamplesTest,
::testing::Values(NetEqDecoder::kDecoderPCMu,

View File

@ -238,6 +238,6 @@ const coding_param param_set[] = {
string("pcm"))};
// 64 kbps, stereo
INSTANTIATE_TEST_CASE_P(AllTest, OpusFecTest, ::testing::ValuesIn(param_set));
INSTANTIATE_TEST_SUITE_P(AllTest, OpusFecTest, ::testing::ValuesIn(param_set));
} // namespace webrtc

View File

@ -140,6 +140,8 @@ const coding_param param_set[] = {
string("pcm"),
true)};
INSTANTIATE_TEST_CASE_P(AllTest, OpusSpeedTest, ::testing::ValuesIn(param_set));
INSTANTIATE_TEST_SUITE_P(AllTest,
OpusSpeedTest,
::testing::ValuesIn(param_set));
} // namespace webrtc

View File

@ -810,8 +810,8 @@ TEST_P(OpusTest, OpusDecodeRepacketized) {
EXPECT_EQ(0, WebRtcOpus_DecoderFree(opus_decoder_));
}
INSTANTIATE_TEST_CASE_P(VariousMode,
OpusTest,
Combine(Values(1, 2, 4), Values(0, 1)));
INSTANTIATE_TEST_SUITE_P(VariousMode,
OpusTest,
Combine(Values(1, 2, 4), Values(0, 1)));
} // namespace webrtc

View File

@ -82,7 +82,7 @@ TEST_P(AudioRingBufferTest, ReadDataMatchesWrittenData) {
EXPECT_EQ(input.channels()[i][j], output.channels()[i][j]);
}
INSTANTIATE_TEST_CASE_P(
INSTANTIATE_TEST_SUITE_P(
AudioRingBufferTest,
AudioRingBufferTest,
::testing::Combine(::testing::Values(10, 20, 42), // num_write_chunk_frames

View File

@ -309,9 +309,9 @@ TEST_P(AudioMultiVectorTest, CopyChannel) {
}
}
INSTANTIATE_TEST_CASE_P(TestNumChannels,
AudioMultiVectorTest,
::testing::Values(static_cast<size_t>(1),
static_cast<size_t>(2),
static_cast<size_t>(5)));
INSTANTIATE_TEST_SUITE_P(TestNumChannels,
AudioMultiVectorTest,
::testing::Values(static_cast<size_t>(1),
static_cast<size_t>(2),
static_cast<size_t>(5)));
} // namespace webrtc

View File

@ -364,24 +364,24 @@ void PrintTo(const TestParameters& p, ::std::ostream* os) {
// Instantiate the tests. Each test is instantiated using the function above,
// so that all different parameter combinations are tested.
INSTANTIATE_TEST_CASE_P(MultiChannel,
NetEqStereoTestNoJitter,
::testing::ValuesIn(GetTestParameters()));
INSTANTIATE_TEST_SUITE_P(MultiChannel,
NetEqStereoTestNoJitter,
::testing::ValuesIn(GetTestParameters()));
INSTANTIATE_TEST_CASE_P(MultiChannel,
NetEqStereoTestPositiveDrift,
::testing::ValuesIn(GetTestParameters()));
INSTANTIATE_TEST_SUITE_P(MultiChannel,
NetEqStereoTestPositiveDrift,
::testing::ValuesIn(GetTestParameters()));
INSTANTIATE_TEST_CASE_P(MultiChannel,
NetEqStereoTestNegativeDrift,
::testing::ValuesIn(GetTestParameters()));
INSTANTIATE_TEST_SUITE_P(MultiChannel,
NetEqStereoTestNegativeDrift,
::testing::ValuesIn(GetTestParameters()));
INSTANTIATE_TEST_CASE_P(MultiChannel,
NetEqStereoTestDelays,
::testing::ValuesIn(GetTestParameters()));
INSTANTIATE_TEST_SUITE_P(MultiChannel,
NetEqStereoTestDelays,
::testing::ValuesIn(GetTestParameters()));
INSTANTIATE_TEST_CASE_P(MultiChannel,
NetEqStereoTestLosses,
::testing::ValuesIn(GetTestParameters()));
INSTANTIATE_TEST_SUITE_P(MultiChannel,
NetEqStereoTestLosses,
::testing::ValuesIn(GetTestParameters()));
} // namespace webrtc