Audacity 3.2.0
Functions
SilenceSegmentTest.cpp File Reference
#include "SilenceSegment.h"
#include "AudioContainer.h"
#include <catch2/catch.hpp>
Include dependency graph for SilenceSegmentTest.cpp:

Go to the source code of this file.

Functions

 TEST_CASE ("SilenceSegment", "behaves as expected")
 

Function Documentation

◆ TEST_CASE()

TEST_CASE ( "SilenceSegment"  ,
"behaves as expected"   
)

Audacity: A Digital Audio Editor

SilenceSegmentTest.cpp

Matthieu Hodgkinson

Definition at line 16 of file SilenceSegmentTest.cpp.

17{
18 // A quick test of an easy implementation.
19 const auto numChannels = GENERATE(1, 2);
20 constexpr auto silenceSegmentLength = 3u;
21 SilenceSegment sut(numChannels, silenceSegmentLength);
22 REQUIRE(!sut.Empty());
23 AudioContainer container(3u, numChannels);
24 REQUIRE(sut.GetFloats(container.channelPointers.data(), 1) == 1);
25 REQUIRE(!sut.Empty());
26 REQUIRE(sut.GetFloats(container.channelPointers.data(), 3) == 2);
27 REQUIRE(sut.Empty());
28}

References AudioContainer::channelPointers, SilenceSegment::Empty(), and SilenceSegment::GetFloats().

Here is the call graph for this function: