#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "media/base/audio_bus.h"
#include <stddef.h>
#include <stdint.h>
#include <limits>
#include <memory>
#include "base/memory/aligned_memory.h"
#include "base/memory/raw_ptr.h"
#include "base/strings/stringprintf.h"
#include "base/test/bind.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "media/base/audio_parameters.h"
#include "media/base/audio_sample_types.h"
#include "media/base/channel_layout.h"
#include "media/base/fake_audio_render_callback.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace media {
static const int kChannels = …;
static constexpr ChannelLayout kChannelLayout = …;
static const int kFrameCount = …;
static const int kSampleRate = …;
class AudioBusTest : public testing::Test { … };
TEST_F(AudioBusTest, Create) { … }
TEST_F(AudioBusTest, CreateUsingAudioParameters) { … }
TEST_F(AudioBusTest, CreateWrapper) { … }
TEST_F(AudioBusTest, WrapVector) { … }
TEST_F(AudioBusTest, WrapMemory) { … }
TEST_F(AudioBusTest, CopyTo) { … }
TEST_F(AudioBusTest, Zero) { … }
static const int kTestVectorSize = …;
static const uint8_t kTestVectorUint8[kTestVectorSize] = …;
static const int16_t kTestVectorInt16[kTestVectorSize] = …;
static const int32_t kTestVectorInt32[kTestVectorSize] = …;
static const float kTestVectorFloat32[kTestVectorSize] = …;
static const float kTestVectorFloat32Invalid[kTestVectorSize] = …;
static const float kTestVectorFloat32Sanitized[kTestVectorSize] = …;
static const int kTestVectorFrameCount = …;
static const float kTestVectorResult[][kTestVectorFrameCount] = …;
static const int kTestVectorChannelCount = …;
TEST_F(AudioBusTest, FromInterleaved) { … }
TEST_F(AudioBusTest, FromInterleavedPartial) { … }
TEST_F(AudioBusTest, ToInterleaved) { … }
TEST_F(AudioBusTest, ToInterleavedSanitized) { … }
TEST_F(AudioBusTest, CopyAndClipTo) { … }
TEST_F(AudioBusTest, ToInterleavedPartial) { … }
struct ZeroingOutTestData { … };
TEST_F(AudioBusTest, FromInterleavedZerosOutUntouchedFrames) { … }
TEST_F(AudioBusTest, FromInterleavedPartialDoesNotZeroOutUntouchedFrames) { … }
TEST_F(AudioBusTest, Scale) { … }
TEST_F(AudioBusTest, Bitstream) { … }
}