chromium/media/base/channel_mixer_unittest.cc

// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "media/base/channel_mixer.h"

#include <memory>

#include "base/memory/raw_ptr.h"
#include "base/strings/stringprintf.h"
#include "media/base/audio_bus.h"
#include "media/base/audio_parameters.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace media {

// Number of frames to test with.
enum {};

// Test all possible layout conversions can be constructed and mixed.
TEST(ChannelMixerTest, ConstructAllPossibleLayouts) {}

struct ChannelMixerTestData {};

std::ostream& operator<<(std::ostream& os, const ChannelMixerTestData& data) {}

class ChannelMixerTest : public testing::TestWithParam<ChannelMixerTestData> {};

// Verify channels are mixed and scaled correctly.  The test only works if all
// output channels have the same value.
TEST_P(ChannelMixerTest, Mixing) {}

static float kStereoToMonoValues[] =;
static float kMonoToStereoValues[] =;
// Zero the center channel since it will be mixed at scale 1 vs 1/sqrt(2).
static float kFiveOneToMonoValues[] =;
static float kFiveDiscreteValues[] =;

// Run through basic sanity tests for some common conversions.
INSTANTIATE_TEST_SUITE_P();

}  // namespace media