OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "media/base/audio_bus.h" | |
6 #include "media/base/channel_mixer.h" | |
7 #include "testing/gtest/include/gtest/gtest.h" | |
8 | |
9 namespace media { | |
10 | |
11 // Test flush resets the internal state properly. | |
12 TEST(ChannelMixerTest, Construction) { | |
13 static const int kFrames = 16; | |
14 | |
15 for (ChannelLayout input_layout = CHANNEL_LAYOUT_MONO; | |
16 input_layout < CHANNEL_LAYOUT_MAX; input_layout++) { | |
17 for (ChannelLayout output_layout = CHANNEL_LAYOUT_MONO; | |
18 output_layout < CHANNEL_LAYOUT_STEREO_DOWNMIX; output_layout++) { | |
19 ChannelMixer mixer(input_layout, output_layout); | |
scherkus (not reviewing)
2012/10/18 01:30:39
should consider using SCOPED_TRACE() to document t
DaleCurtis
2012/10/18 05:22:04
Done.
| |
20 scoped_ptr<AudioBus> input_bus = AudioBus::Create( | |
21 ChannelLayoutToChannelCount(input_layout), kFrames); | |
22 scoped_ptr<AudioBus> output_bus = AudioBus::Create( | |
23 ChannelLayoutToChannelCount(output_layout), kFrames); | |
24 for(int ch = 0; ch < input_bus->channels(); ++ch) | |
25 std::fill(input_bus->channel(ch), input_bus->channel(ch) + kFrames, 1); | |
26 | |
27 mixer.Rematrix(input_bus.get(), output_bus.get()); | |
scherkus (not reviewing)
2012/10/18 01:30:39
what exactly are we testing?
DaleCurtis
2012/10/18 01:56:44
Just that construction of all layouts is possible
scherkus (not reviewing)
2012/10/18 02:24:03
How about naming this "AllLayoutCombinations" inst
DaleCurtis
2012/10/18 05:22:04
Done.
| |
28 } | |
29 } | |
30 } | |
31 | |
32 } // namespace media | |
OLD | NEW |