Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1065)

Unified Diff: media/base/channel_mixer_unittest.cc

Issue 672793002: Expose the internal MatrixBuilder class as ChannelMixingMatrix. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: List expected_value first in ASSERT_FLOAT_EQ Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/base/channel_mixer.cc ('k') | media/base/channel_mixing_matrix.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/channel_mixer_unittest.cc
diff --git a/media/base/channel_mixer_unittest.cc b/media/base/channel_mixer_unittest.cc
index ac228e661dd39bb5869b4e98ddafa624807cdc4a..07d64eb0359865265e05712bbce10eae1d0ddb7f 100644
--- a/media/base/channel_mixer_unittest.cc
+++ b/media/base/channel_mixer_unittest.cc
@@ -24,14 +24,16 @@ TEST(ChannelMixerTest, ConstructAllPossibleLayouts) {
input_layout <= CHANNEL_LAYOUT_MAX;
input_layout = static_cast<ChannelLayout>(input_layout + 1)) {
for (ChannelLayout output_layout = CHANNEL_LAYOUT_MONO;
- output_layout < CHANNEL_LAYOUT_STEREO_DOWNMIX;
+ output_layout <= CHANNEL_LAYOUT_MAX;
output_layout = static_cast<ChannelLayout>(output_layout + 1)) {
// DISCRETE can't be tested here based on the current approach.
// CHANNEL_LAYOUT_STEREO_AND_KEYBOARD_MIC is not mixable.
+ // Stereo down mix should never be the output layout.
if (input_layout == CHANNEL_LAYOUT_DISCRETE ||
input_layout == CHANNEL_LAYOUT_STEREO_AND_KEYBOARD_MIC ||
output_layout == CHANNEL_LAYOUT_DISCRETE ||
- output_layout == CHANNEL_LAYOUT_STEREO_AND_KEYBOARD_MIC) {
+ output_layout == CHANNEL_LAYOUT_STEREO_AND_KEYBOARD_MIC ||
+ output_layout == CHANNEL_LAYOUT_STEREO_DOWNMIX) {
continue;
}
@@ -141,7 +143,7 @@ TEST_P(ChannelMixerTest, Mixing) {
if (input_layout != CHANNEL_LAYOUT_DISCRETE) {
for (int ch = 0; ch < output_bus->channels(); ++ch) {
for (int frame = 0; frame < output_bus->frames(); ++frame) {
- ASSERT_FLOAT_EQ(output_bus->channel(ch)[frame], expected_value);
+ ASSERT_FLOAT_EQ(expected_value, output_bus->channel(ch)[frame]);
}
}
} else {
@@ -151,7 +153,7 @@ TEST_P(ChannelMixerTest, Mixing) {
for (int ch = 0; ch < output_bus->channels(); ++ch) {
expected_value = (ch < input_channels) ? channel_values[ch] : 0;
for (int frame = 0; frame < output_bus->frames(); ++frame) {
- ASSERT_FLOAT_EQ(output_bus->channel(ch)[frame], expected_value);
+ ASSERT_FLOAT_EQ(expected_value, output_bus->channel(ch)[frame]);
}
}
}
« no previous file with comments | « media/base/channel_mixer.cc ('k') | media/base/channel_mixing_matrix.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698