#include "modules/audio_processing/capture_levels_adjuster/audio_samples_scaler.h"
#include <tuple>
#include "modules/audio_processing/test/audio_buffer_tools.h"
#include "rtc_base/strings/string_builder.h"
#include "test/gtest.h"
namespace webrtc {
namespace {
float SampleValueForChannel(int channel) { … }
void PopulateBuffer(AudioBuffer& audio_buffer) { … }
constexpr int kNumFramesToProcess = …;
class AudioSamplesScalerTest
: public ::testing::Test,
public ::testing::WithParamInterface<std::tuple<int, int, float>> { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(AudioSamplesScalerTest, InitialGainIsRespected) { … }
TEST_P(AudioSamplesScalerTest, VerifyGainAdjustment) { … }
TEST(AudioSamplesScaler, UpwardsClamping) { … }
TEST(AudioSamplesScaler, DownwardsClamping) { … }
}
}