Commit 60a226b7 authored by Victor Costan's avatar Victor Costan Committed by Commit Bot

test: Replace _TEST_CASE_ with _TEST_SUITE_ in /media/audio.

Googletest is (at last) converging with industry-standard terminology
[1]. We previously called test suites "test cases", which was rather
confusing for folks coming from any other testing framework.

Chrome now has a googltest version that supports _TEST_SUITE_ macros
instead of _TEST_CASE_, so this CL cleans up some of the outdated usage.

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

This CL was uploaded by git cl split.

R=miu@chromium.org

Bug: 925652
Change-Id: Id6e26777299128d504dce525ba87883254a93631
Reviewed-on: https://chromium-review.googlesource.com/c/1438360Reviewed-by: default avatarYuri Wiitala <miu@chromium.org>
Commit-Queue: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#626887}
parent 3a561b6b
......@@ -974,8 +974,8 @@ TEST_P(AudioAndroidInputTest,
StopAndCloseAudioInputStreamOnAudioThread();
}
INSTANTIATE_TEST_CASE_P(AudioAndroidInputTest,
AudioAndroidInputTest,
testing::Bool());
INSTANTIATE_TEST_SUITE_P(AudioAndroidInputTest,
AudioAndroidInputTest,
testing::Bool());
} // namespace media
......@@ -295,7 +295,7 @@ TEST_P(AudioDebugFileWriterBehavioralTest, DestroyStarted) {
debug_writer_.reset();
}
INSTANTIATE_TEST_CASE_P(
INSTANTIATE_TEST_SUITE_P(
AudioDebugFileWriterTest,
AudioDebugFileWriterTest,
// Using 10ms frames per buffer everywhere.
......@@ -331,23 +331,23 @@ INSTANTIATE_TEST_CASE_P(
48000 / 100,
1500)));
INSTANTIATE_TEST_CASE_P(AudioDebugFileWriterBehavioralTest,
AudioDebugFileWriterBehavioralTest,
// Using 10ms frames per buffer everywhere.
testing::Values(
// No writes.
std::make_tuple(ChannelLayout::CHANNEL_LAYOUT_MONO,
44100,
44100 / 100,
100)));
INSTANTIATE_TEST_CASE_P(AudioDebugFileWriterSingleThreadTest,
AudioDebugFileWriterSingleThreadTest,
// Using 10ms frames per buffer everywhere.
testing::Values(
// No writes.
std::make_tuple(ChannelLayout::CHANNEL_LAYOUT_MONO,
44100,
44100 / 100,
100)));
INSTANTIATE_TEST_SUITE_P(AudioDebugFileWriterBehavioralTest,
AudioDebugFileWriterBehavioralTest,
// Using 10ms frames per buffer everywhere.
testing::Values(
// No writes.
std::make_tuple(ChannelLayout::CHANNEL_LAYOUT_MONO,
44100,
44100 / 100,
100)));
INSTANTIATE_TEST_SUITE_P(AudioDebugFileWriterSingleThreadTest,
AudioDebugFileWriterSingleThreadTest,
// Using 10ms frames per buffer everywhere.
testing::Values(
// No writes.
std::make_tuple(ChannelLayout::CHANNEL_LAYOUT_MONO,
44100,
44100 / 100,
100)));
} // namespace media
......@@ -299,6 +299,6 @@ TEST_P(AudioInputControllerTest, SetVolume) {
CloseAudioController();
}
INSTANTIATE_TEST_CASE_P(SyncAsync, AudioInputControllerTest, testing::Bool());
INSTANTIATE_TEST_SUITE_P(SyncAsync, AudioInputControllerTest, testing::Bool());
} // namespace media
......@@ -520,6 +520,6 @@ TEST_P(AudioOutputControllerTest, DuplicateDivertInteract) {
Close();
}
INSTANTIATE_TEST_CASE_P(AOC, AudioOutputControllerTest, Bool());
INSTANTIATE_TEST_SUITE_P(AOC, AudioOutputControllerTest, Bool());
} // namespace media
......@@ -273,33 +273,58 @@ static const float kStereoMixed2[] = {
0.25f, -0.25f, 0.5f, -0.5f, 0.75f, -0.75f, 1.0f, -1.0f
};
INSTANTIATE_TEST_CASE_P(
Scenarios, AudioPowerMonitorTest,
INSTANTIATE_TEST_SUITE_P(
Scenarios,
AudioPowerMonitorTest,
::testing::Values(
TestScenario(kMonoSilentNoise, 1, 2, -40, false),
TestScenario(kMonoMaxAmplitude, 1, 1,
AudioPowerMonitor::max_power(), false),
TestScenario(kMonoMaxAmplitude2, 1, 2,
AudioPowerMonitor::max_power(), false),
TestScenario(kMonoHalfMaxAmplitude, 1, 4, -6, false),
TestScenario(kMonoAmplitudeClipped, 1, 2,
AudioPowerMonitor::max_power(), true),
TestScenario(kMonoMaxAmplitudeWithClip, 1, 4,
AudioPowerMonitor::max_power(), true),
TestScenario(kMonoMaxAmplitudeWithClip2, 1, 4,
AudioPowerMonitor::max_power(), true),
TestScenario(kMonoSilentNoise, 1, 2,
AudioPowerMonitor::zero_power(), false).
WithABadSample(std::numeric_limits<float>::infinity()),
TestScenario(kMonoHalfMaxAmplitude, 1, 4,
AudioPowerMonitor::zero_power(), false).
WithABadSample(std::numeric_limits<float>::quiet_NaN()),
TestScenario(kStereoSilentNoise, 2, 2, -46, false),
TestScenario(kStereoMaxAmplitude, 2, 2,
AudioPowerMonitor::max_power(), false),
TestScenario(kRightChannelMaxAmplitude, 2, 4, -3, false),
TestScenario(kLeftChannelHalfMaxAmplitude, 2, 4, -9, false),
TestScenario(kStereoMixed, 2, 4, -2, false),
TestScenario(kStereoMixed2, 2, 8, -3, false)));
TestScenario(kMonoSilentNoise, 1, 2, -40, false),
TestScenario(kMonoMaxAmplitude,
1,
1,
AudioPowerMonitor::max_power(),
false),
TestScenario(kMonoMaxAmplitude2,
1,
2,
AudioPowerMonitor::max_power(),
false),
TestScenario(kMonoHalfMaxAmplitude, 1, 4, -6, false),
TestScenario(kMonoAmplitudeClipped,
1,
2,
AudioPowerMonitor::max_power(),
true),
TestScenario(kMonoMaxAmplitudeWithClip,
1,
4,
AudioPowerMonitor::max_power(),
true),
TestScenario(kMonoMaxAmplitudeWithClip2,
1,
4,
AudioPowerMonitor::max_power(),
true),
TestScenario(kMonoSilentNoise,
1,
2,
AudioPowerMonitor::zero_power(),
false)
.WithABadSample(std::numeric_limits<float>::infinity()),
TestScenario(kMonoHalfMaxAmplitude,
1,
4,
AudioPowerMonitor::zero_power(),
false)
.WithABadSample(std::numeric_limits<float>::quiet_NaN()),
TestScenario(kStereoSilentNoise, 2, 2, -46, false),
TestScenario(kStereoMaxAmplitude,
2,
2,
AudioPowerMonitor::max_power(),
false),
TestScenario(kRightChannelMaxAmplitude, 2, 4, -3, false),
TestScenario(kLeftChannelHalfMaxAmplitude, 2, 4, -9, false),
TestScenario(kStereoMixed, 2, 4, -2, false),
TestScenario(kStereoMixed2, 2, 8, -3, false)));
} // namespace media
......@@ -103,8 +103,8 @@ TEST_P(AudioSyncReaderBitstreamTest, BitstreamBufferOverflow_DoesNotWriteOOB) {
reader->Read(output_bus.get());
}
INSTANTIATE_TEST_CASE_P(AudioSyncReaderTest,
AudioSyncReaderBitstreamTest,
::testing::ValuesIn(overflow_test_case_values));
INSTANTIATE_TEST_SUITE_P(AudioSyncReaderTest,
AudioSyncReaderBitstreamTest,
::testing::ValuesIn(overflow_test_case_values));
} // namespace media
......@@ -45,8 +45,8 @@ using AudioSystemTestBaseVariations =
testing::Types<AudioSystemImplTestBase<false>,
AudioSystemImplTestBase<true>>;
INSTANTIATE_TYPED_TEST_CASE_P(AudioSystemImpl,
AudioSystemTestTemplate,
AudioSystemTestBaseVariations);
INSTANTIATE_TYPED_TEST_SUITE_P(AudioSystemImpl,
AudioSystemTestTemplate,
AudioSystemTestBaseVariations);
} // namespace media
......@@ -141,7 +141,7 @@ class AudioSystemTestTemplate : public T {
DISALLOW_COPY_AND_ASSIGN(AudioSystemTestTemplate);
};
TYPED_TEST_CASE_P(AudioSystemTestTemplate);
TYPED_TEST_SUITE_P(AudioSystemTestTemplate);
TYPED_TEST_P(AudioSystemTestTemplate, GetInputStreamParametersNormal) {
base::RunLoop wait_loop;
......@@ -340,7 +340,7 @@ TYPED_TEST_P(AudioSystemTestTemplate, GetInputDeviceInfoWithAssociation) {
wait_loop.Run();
}
REGISTER_TYPED_TEST_CASE_P(
REGISTER_TYPED_TEST_SUITE_P(
AudioSystemTestTemplate,
GetInputStreamParametersNormal,
GetInputStreamParametersNoDevice,
......
......@@ -353,8 +353,8 @@ TEST_P(VirtualAudioInputStreamTest, ComprehensiveTest) {
WaitUntilClosed();
}
INSTANTIATE_TEST_CASE_P(SingleVersusMultithreaded,
VirtualAudioInputStreamTest,
::testing::Values(false, true));
INSTANTIATE_TEST_SUITE_P(SingleVersusMultithreaded,
VirtualAudioInputStreamTest,
::testing::Values(false, true));
} // namespace media
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment