15#include "dsp/hart_dsp_all.hpp"
16#include "dsp/hart_dsp_function.hpp"
18#include "matchers/hart_matcher.hpp"
19#include "matchers/hart_matcher_function.hpp"
24#include "signals/hart_signals_all.hpp"
51template <
typename SampleType>
60 template <
typename DSPType>
62 typename std::enable_if<
63 ! std::is_lvalue_reference<DSPType&&>::value &&
64 std::is_base_of<
DSPBase<SampleType>,
typename std::decay<DSPType>::type>::value
66 : m_processor (std::forward<DSPType> (dsp).move())
75 : m_processor (std::move (dsp))
84 if (sampleRateHz <= 0)
87 if (! m_processor->supportsSampleRate (sampleRateHz))
90 m_sampleRateHz = sampleRateHz;
98 if (blockSizeFrames == 0)
101 m_blockSizeFrames = blockSizeFrames;
112 paramValues.emplace_back (ParamValue { id, value });
120 if (durationSeconds < 0)
123 m_testDurationSeconds = durationSeconds;
133 m_dspPreparationBeforeWarmUp = dspPreparation;
143 m_signalPreparationBeforeWarmUp = signalPreparation;
162 double warmUpDurationSeconds,
167 if (warmUpDurationSeconds < 0)
170 m_warmUpDurationSeconds = warmUpDurationSeconds;
171 m_signalPreparationAfterWarmUp = signalPreparation;
172 m_dspPreparationAfterWarmUp = dspPreparation;
180 m_inputSignal = std::move (signal.copy());
188 m_inputSignal = std::move (signal.move());
197 m_inputSignal = std::move (signal);
219 std::function<
void (
AudioBuffer<SampleType>&)> signalFunction,
220 const std::string& label = {},
224 std::move (signalFunction),
238 if (numInputChannels == 0)
241 if (numInputChannels > 128)
244 m_numInputChannels = numInputChannels;
254 if (numOutputChannels == 0)
257 if (numOutputChannels > 128)
260 m_numOutputChannels = numOutputChannels;
267 return this->withInputChannels (2);
273 return this->withOutputChannels (2);
279 return this->withInputChannels (1);
285 return this->withOutputChannels (1);
291 return this->withMonoInput().withMonoOutput();
297 return this->withStereoInput().withStereoOutput();
302 template<
typename MatcherType>
305 addCheck (std::forward<MatcherType> (matcher), SignalAssertionLevel::expect,
true);
311 template<
typename MatcherType>
314 addCheck (std::forward<MatcherType> (matcher), SignalAssertionLevel::expect,
false);
320 template<
typename MatcherType>
323 addCheck (std::forward<MatcherType> (matcher), SignalAssertionLevel::assert,
true);
329 template<
typename MatcherType>
332 addCheck (std::forward<MatcherType> (matcher), SignalAssertionLevel::assert,
false);
354 return expectTrue (
MatcherFunction<SampleType> (std::move (matcherFunction), label));
379 return expectTrue (
MatcherFunction<SampleType> (std::move (matcherFunction), label));
398 return expectFalse (
MatcherFunction<SampleType> (std::move (matcherFunction), label));
423 return expectFalse (
MatcherFunction<SampleType> (std::move (matcherFunction), label));
442 return assertTrue (
MatcherFunction<SampleType> (std::move (matcherFunction), label));
467 return assertTrue (
MatcherFunction<SampleType> (std::move (matcherFunction), label));
486 return assertFalse (
MatcherFunction<SampleType> (std::move (matcherFunction), label));
511 return assertFalse (
MatcherFunction<SampleType> (std::move (matcherFunction), label));
526 m_saveOutputMode = mode;
527 m_saveOutputWavFormat = wavFormat;
538 m_outputBufferSink = [&receivingBuffer] (
AudioBuffer<SampleType>&& outputBuffer)
540 receivingBuffer = std::move (outputBuffer);
553 m_outputBufferSink = std::move (outputBufferSink);
570 m_savePlotMode = mode;
580 m_inputSignalSink = [&receivingSignal] (std::unique_ptr<SignalBase<SampleType>>&& usedSignal)
582 receivingSignal = std::move (usedSignal);
594 m_inputSignalSink = std::move (inputSignalSink);
605 m_testLabel = testLabel;
613 const size_t totalDurationFrames = (size_t) std::round (m_sampleRateHz * (m_testDurationSeconds + m_warmUpDurationSeconds));
614 const size_t warmUpDurationFrames = (size_t) std::round (m_sampleRateHz * m_warmUpDurationSeconds);
615 const size_t testDurationFrames = totalDurationFrames - warmUpDurationFrames;
617 if (totalDurationFrames == 0)
620 const bool perBlockChecksPreparationSuccessful = prepareChecks (perBlockChecks);
621 const bool fullSignalChecksPreparationSuccessful = prepareChecks (fullSignalChecks);
623 if (! perBlockChecksPreparationSuccessful || ! fullSignalChecksPreparationSuccessful)
624 return std::move (m_processor);
626 if (! m_processor->supportsSampleRate (m_sampleRateHz))
629 if (! m_processor->supportsChannelLayout (m_numInputChannels, m_numOutputChannels))
633 m_processor->reset();
636 m_processor->prepareWithEnvelopes (m_sampleRateHz, m_numInputChannels, m_numOutputChannels, m_blockSizeFrames);
638 for (
const ParamValue& paramValue : paramValues)
641 m_processor->setValue (paramValue.id, paramValue.value);
644 if (m_inputSignal ==
nullptr)
645 m_inputSignal = std::move (
hart::make_unique<
Silence<SampleType>>());
647 if (! m_inputSignal->supportsSampleRateWithDSPChain (m_sampleRateHz))
650 if (! m_inputSignal->supportsNumChannelsWithDSPChain (m_numInputChannels))
654 m_inputSignal->resetWithDSPChain();
657 m_inputSignal->prepareWithDSPChain (m_sampleRateHz, m_numInputChannels, m_blockSizeFrames);
662 AudioBuffer<SampleType> fullInputBuffer (m_numInputChannels, 0, m_sampleRateHz);
663 AudioBuffer<SampleType> fullOutputBuffer (m_numOutputChannels, 0, m_sampleRateHz);
664 bool atLeastOneCheckFailed =
false;
667 while (offsetFrames < warmUpDurationFrames)
669 const size_t blockSizeFrames = std::min (m_blockSizeFrames, warmUpDurationFrames - offsetFrames);
671 hart::
AudioBuffer<SampleType> inputBlock (m_numInputChannels, blockSizeFrames, m_sampleRateHz);
672 hart::
AudioBuffer<SampleType> outputBlock (m_numOutputChannels, blockSizeFrames, m_sampleRateHz);
673 m_inputSignal->renderNextBlockWithDSPChain (inputBlock);
674 m_processor->processWithEnvelopes (inputBlock, outputBlock);
676 fullInputBuffer.appendFrom (inputBlock);
677 fullOutputBuffer.appendFrom (outputBlock);
679 offsetFrames += blockSizeFrames;
683 m_processor->reset();
686 m_processor->prepareWithEnvelopes (m_sampleRateHz, m_numInputChannels, m_numOutputChannels, m_blockSizeFrames);
689 m_inputSignal->resetWithDSPChain();
692 m_inputSignal->prepareWithDSPChain (m_sampleRateHz, m_numInputChannels, m_blockSizeFrames);
695 while (offsetFrames < totalDurationFrames)
700 const size_t blockSizeFrames = std::min (m_blockSizeFrames, totalDurationFrames - offsetFrames);
702 hart::
AudioBuffer<SampleType> inputBlock (m_numInputChannels, blockSizeFrames, m_sampleRateHz);
703 hart::
AudioBuffer<SampleType> outputBlock (m_numOutputChannels, blockSizeFrames, m_sampleRateHz);
704 m_inputSignal->renderNextBlockWithDSPChain (inputBlock);
705 m_processor->processWithEnvelopes (inputBlock, outputBlock);
707 const bool allChecksPassed = processChecks (perBlockChecks, inputBlock, outputBlock, offsetFrames);
708 atLeastOneCheckFailed |= ! allChecksPassed;
709 fullInputBuffer.appendFrom (inputBlock);
710 fullOutputBuffer.appendFrom (outputBlock);
712 offsetFrames += blockSizeFrames;
715 if (testDurationFrames != 0 && ! fullSignalChecks.empty())
719 AudioBuffer<SampleType> fullInputNoWarmUpBuffer (m_numInputChannels, testDurationFrames, m_sampleRateHz);
720 AudioBuffer<SampleType> fullOutputNoWarmUpBuffer (m_numOutputChannels, testDurationFrames, m_sampleRateHz);
722 for (size_t channel = 0; channel < m_numInputChannels; ++channel)
723 fullInputNoWarmUpBuffer.copyFrom (channel, 0, fullInputBuffer, channel, warmUpDurationFrames, testDurationFrames);
725 for (size_t channel = 0; channel < m_numOutputChannels; ++channel)
726 fullOutputNoWarmUpBuffer.copyFrom (channel, 0, fullOutputBuffer, channel, warmUpDurationFrames, testDurationFrames);
728 const bool allChecksPassed = processChecks (fullSignalChecks, fullInputNoWarmUpBuffer, fullOutputNoWarmUpBuffer, warmUpDurationFrames);
729 atLeastOneCheckFailed |= ! allChecksPassed;
733 WavWriter<SampleType>::writeBuffer (fullOutputBuffer, m_saveOutputPath, m_saveOutputWavFormat);
736 plotData (fullInputBuffer, fullOutputBuffer, m_savePlotPath);
738 if (m_outputBufferSink !=
nullptr)
739 m_outputBufferSink (std::move (fullOutputBuffer));
741 if (m_inputSignalSink !=
nullptr)
742 m_inputSignalSink (std::move (m_inputSignal));
744 return std::move (m_processor);
754 enum class SignalAssertionLevel
763 SignalAssertionLevel signalAssertionLevel;
768 std::unique_ptr<
DSPBase<SampleType>> m_processor;
769 std::unique_ptr<SignalBase<SampleType>> m_inputSignal;
774 std::vector<ParamValue> paramValues;
776 double m_warmUpDurationSeconds = 0.0;
777 size_t offsetFrames = 0;
778 std::string m_testLabel = {};
785 std::vector<Check> perBlockChecks;
786 std::vector<Check> fullSignalChecks;
788 std::string m_saveOutputPath;
792 std::string m_savePlotPath;
795 std::function<
void (
AudioBuffer<SampleType>&&)> m_outputBufferSink =
nullptr;
796 std::function<
void (std::unique_ptr<SignalBase<SampleType>>&&)> m_inputSignalSink =
nullptr;
799 typename MatcherType,
800 typename =
typename std::enable_if<
802 typename std::decay<MatcherType>::type,
806 void addCheck (MatcherType&& matcher, SignalAssertionLevel assertionLevel,
bool shouldPass)
808 using Derived =
typename std::decay<MatcherType>::type;
809 static_assert (std::is_base_of<
MatcherBase<SampleType>, Derived>::value,
"matcher argument must derive from hart::Matcher");
811 const bool forceFullSignal = !shouldPass;
812 auto& group = (matcher.canOperatePerBlock() && !forceFullSignal)
818 std::forward<MatcherType>(matcher).move(),
825 void addCheck (
const MatcherBase<SampleType>& matcher, SignalAssertionLevel assertionLevel,
bool shouldPass)
827 const bool forceFullSignal = ! shouldPass;
828 auto& group = (matcher.canOperatePerBlock() && ! forceFullSignal)
833 group.push_back({ matcher.copy(), assertionLevel,
false, shouldPass });
836 bool prepareChecks (std::vector<Check>& checks)
838 for (
auto& check : checks)
840 if (! check.matcher->supportsSampleRate (m_sampleRateHz))
843 if (! check.matcher->supportsChannelLayout (m_numInputChannels, m_numOutputChannels))
846 check.matcher->prepareWithActiveChannels (m_sampleRateHz, m_numInputChannels, m_numOutputChannels, m_blockSizeFrames);
847 check.shouldSkip =
false;
853 bool processChecks (std::vector<Check>& checksGroup,
const AudioBuffer<SampleType>& inputAudio,
const AudioBuffer<SampleType>& outputAudio, size_t baseFrameOffset)
855 for (
auto& check : checksGroup)
857 if (check.shouldSkip)
860 auto& assertionLevel = check.signalAssertionLevel;
861 auto& matcher = check.matcher;
863 const AnalysisContext<SampleType> analysisContext (inputAudio, outputAudio);
864 const bool matchPassed = matcher->match (analysisContext);
866 if (matchPassed != check.shouldPass)
868 check.shouldSkip =
true;
870 if (assertionLevel == SignalAssertionLevel::assert)
872 std::stringstream stream;
873 stream << (check.shouldPass ?
"assertTrue() failed" :
"assertFalse() failed");
875 if (! m_testLabel.empty())
876 stream <<
" at \"" << m_testLabel <<
"\"";
878 stream << std::endl <<
"Condition: " << *matcher;
879 appendFailureDetails (stream, matcher->getFailureDetails(), inputAudio, outputAudio, baseFrameOffset);
885 std::stringstream stream;
886 stream << (check.shouldPass ?
"expectTrue() failed" :
"expectFalse() failed");
888 if (!m_testLabel.empty())
889 stream <<
" at \"" << m_testLabel <<
"\"";
891 stream << std::endl <<
"Condition: " << * matcher;
892 appendFailureDetails (stream, matcher->getFailureDetails(), inputAudio, outputAudio, baseFrameOffset);
894 hart::ExpectationFailureMessages::get().emplace_back (stream.str());
909 const size_t frameOverall = baseFrameOffset + details
.frame;
910 const double timestampOverall =
static_cast<
double> (frameOverall) / m_sampleRateHz;
911 const size_t warmUpDurationFrames = (size_t) std::round (m_sampleRateHz * m_warmUpDurationSeconds);
912 const SampleType inputSampleValue = inputAudio[details
.channel][details
.frame];
913 const SampleType outputSampleValue = observedOutputAudio[details
.channel][details
.frame];
916 <<
"Input signal: " << *m_inputSignal << std::endl
917 <<
"Channel: " << details
.channel << std::endl;
919 if (warmUpDurationFrames == 0)
922 <<
"Frame: " << frameOverall << std::endl
923 <<
secPrecision <<
"Timestamp: " << timestampOverall <<
" seconds";
927 const size_t framePostWarmUp = frameOverall - warmUpDurationFrames;
928 const double timestampPostWarmUp =
static_cast<
double> (framePostWarmUp) / m_sampleRateHz;
930 <<
"Frame (overall): " << frameOverall << std::endl
931 <<
"Frame (post warm-up): " << framePostWarmUp << std::endl
933 <<
"Timestamp (overall): " << timestampOverall <<
" seconds" << std::endl
934 <<
"Timestamp (post warm-up): " << timestampPostWarmUp <<
" seconds";
938 <<
linPrecision <<
"Input sample value: " << inputSampleValue
939 <<
dbPrecision <<
" (" << ratioToDecibels (std::abs (inputSampleValue)) <<
" dB)" << std::endl
940 <<
linPrecision <<
"Output sample value: " << outputSampleValue
941 <<
dbPrecision <<
" (" << ratioToDecibels (std::abs (outputSampleValue)) <<
" dB)" << std::endl
950template <
typename DSPType>
953 return AudioTestBuilder<
typename std::decay<DSPType>::type::SampleTypePublicAlias> (std::forward<DSPType>(dsp));
961template <
typename DSPType>
964 using SampleType =
typename DSPType::SampleTypePublicAlias;
1053using hart::processAudioWith;
1081using hart::processAudioWith;
Contains audio-related artefacts useful for analysis by matchers.
Container for audio data.
A DSP host used for building and running tests inside a test case.
AudioTestBuilder & assertTrue(std::function< Condition(const AudioBuffer< SampleType > &)> matcherFunction, const std::string &label={})
Adds an "assert" check using a function matcher.
AudioTestBuilder & withInputSignal(std::function< void(AudioBuffer< SampleType > &)> signalFunction, const std::string &label={}, Loop loop=Loop::yes)
Sets the input signal using a function-based signal definition.
AudioTestBuilder & expectTrue(std::function< Condition(const AudioBuffer< SampleType > &)> matcherFunction, const std::string &label={})
Adds an "expect" check using a function matcher.
AudioTestBuilder & inMono()
Sets number of input and output channels to one.
AudioTestBuilder & expectFalse(std::function< Condition(const AudioBuffer< SampleType > &)> matcherFunction, const std::string &label={})
Adds a reversed "expect" check using a function matcher.
AudioTestBuilder & withDspPreparation(Preparation dspPreparation)
Sets whether to call reset() and/or prepare() on DSP testee before rendering audio.
AudioTestBuilder & assertFalse(std::function< Condition(const AudioBuffer< SampleType > &, const AudioBuffer< SampleType > &)> matcherFunction, const std::string &label={})
Adds a reversed "assert" check using a function matcher.
AudioTestBuilder & expectFalse(std::function< Condition(const AudioBuffer< SampleType > &, const AudioBuffer< SampleType > &)> matcherFunction, const std::string &label={})
Adds a reversed "expect" check using a function matcher.
AudioTestBuilder & withLabel(const std::string &testLabel)
Adds a label to the test.
AudioTestBuilder & withDuration(double durationSeconds)
Sets the total duration of the input signal to be processed.
AudioTestBuilder & withStereoInput()
Sets number of input channels to two.
AudioTestBuilder & expectFalse(MatcherType &&matcher)
Adds a reversed "expect" check using a Matcher object.
AudioTestBuilder & assertFalse(MatcherType &&matcher)
Adds a reversed "assert" check using a Matcher object.
AudioTestBuilder & withInputChannels(size_t numInputChannels)
Sets arbitrary number of input channels.
AudioTestBuilder & expectTrue(std::function< Condition(const AudioBuffer< SampleType > &, const AudioBuffer< SampleType > &)> matcherFunction, const std::string &label={})
Adds an "expect" check using a function matcher.
AudioTestBuilder(DSPType &&dsp, typename std::enable_if< ! std::is_lvalue_reference< DSPType && >::value &&std::is_base_of< DSPBase< SampleType >, typename std::decay< DSPType >::type >::value >::type *=0)
Moves the DSP instance into the host.
AudioTestBuilder & withSignalPreparation(Preparation signalPreparation)
Sets whether to call reset() and/or prepare() on the input Signal before rendering audio.
AudioTestBuilder(std::unique_ptr< DSPBase< SampleType > > dsp)
Transfers the DSP smart pointer into the host.
AudioTestBuilder & expectTrue(MatcherType &&matcher)
Adds an "expect" check using a Matcher object.
AudioTestBuilder & withSampleRate(double sampleRateHz)
Sets the sample rate for the test.
AudioTestBuilder & withInputSignal(SignalBase< SampleType > &&signal)
Sets the input signal for the test by moving it.
AudioTestBuilder & saveOutputTo(AudioBuffer< SampleType > &receivingBuffer)
Enables saving output audio to a provided buffer.
AudioTestBuilder & withInputSignal(std::unique_ptr< SignalBase< SampleType > > signal)
Sets the input signal for the test by transfering its smart pointer.
AudioTestBuilder & savePlotTo(const std::string &path, Save mode=Save::always)
Enables saving a plot to an SVG file.
AudioTestBuilder & saveInputSignalTo(std::unique_ptr< SignalBase< SampleType > > &receivingSignal)
Moves the input signal after the processing into the provided smart pointer.
AudioTestBuilder & withMonoOutput()
Sets number of output channels to one.
AudioTestBuilder & assertTrue(std::function< Condition(const AudioBuffer< SampleType > &, const AudioBuffer< SampleType > &)> matcherFunction, const std::string &label={})
Adds an "assert" check using a function matcher.
AudioTestBuilder & assertTrue(MatcherType &&matcher)
Adds an "assert" check using a Matcher object.
AudioTestBuilder & withValue(int id, double value)
Sets the initial param value for the tested DSP.
AudioTestBuilder & assertFalse(std::function< Condition(const AudioBuffer< SampleType > &)> matcherFunction, const std::string &label={})
Adds a reversed "assert" check using a function matcher.
AudioTestBuilder & withWarmUp(double warmUpDurationSeconds, Preparation signalPreparation=Preparation::none, Preparation dspPreparation=Preparation::none)
Adds a warm‑up period before the main test.
AudioTestBuilder & saveOutputTo(const std::string &path, Save mode=Save::always, WavFormat wavFormat=WavFormat::pcm24)
Enables saving output audio to a wav file.
AudioTestBuilder & withInputSignal(const SignalBase< SampleType > &signal)
Sets the input signal for the test by copying it.
AudioTestBuilder & withMonoInput()
Sets number of input channels to one.
AudioTestBuilder & saveOutputTo(std::function< void(AudioBuffer< SampleType > &&)> outputBufferSink)
Enables saving output audio via provided callback.
AudioTestBuilder & withStereoOutput()
Sets number of output channels to two.
AudioTestBuilder & inStereo()
Sets number of input and output channels to two.
AudioTestBuilder & withOutputChannels(size_t numOutputChannels)
Sets arbitrary number of output channels.
std::unique_ptr< DSPBase< SampleType > > process()
Performs the test.
AudioTestBuilder & withBlockSize(size_t blockSizeFrames)
Sets the block size for the test.
AudioTestBuilder & saveInputSignalTo(std::function< void(std::unique_ptr< SignalBase< SampleType > > &&)> inputSignalSink)
Moves the input signal after the processing via provided callback.
Thrown when a numbers of channels is mismatched.
A class representing some condition.
Polymorphic base for all DSP.
A DSP processor defined by a user-provided function.
Polymorphic base for all matchers.
Matcher defined by a user-provided function.
Thrown when sample rate is mismatched.
Signal defined by a user-provided function.
Thrown when an unexpected container size is encountered.
Thrown by test asserts like HART_ASSERT_TRUE() and AudioTestBuilder::assertFalse()
Thrown when an inappropriate value is encountered.
Helper class for writing audio buffers to wav files.
#define HART_THROW_OR_RETURN(ExceptionType, message, returnValue)
Throws an exception if HART_DO_NOT_THROW_EXCEPTIONS is set, prints a message and returns a specified ...
std::ostream & linPrecision(std::ostream &stream)
Sets number of decimal places for linear (sample) values.
std::ostream & secPrecision(std::ostream &stream)
Sets number of decimal places for values in seconds.
std::ostream & dbPrecision(std::ostream &stream)
Sets number of decimal places for values in decibels.
AudioTestBuilder< double > processAudioWith(std::function< void(const AudioBuffer< double > &, AudioBuffer< double > &)> dspFunction, const std::string &label={})
See the description of the float version of this function.
ResetSignal
Determines whether to reset the Signal in a given context.
AudioTestBuilder< float > processAudioWith(std::function< void(const AudioBuffer< float > &, AudioBuffer< float > &)> dspFunction, const std::string &label={})
Call this to start building your test using a block-wise non-replacing function.
Save
Determines when to save a file.
AudioTestBuilder< double > processAudioWith(std::function< double(double)> dspFunction, const std::string &label={})
See the description of the float version of this function.
AudioTestBuilder< typename std::decay< DSPType >::type::SampleTypePublicAlias > processAudioWith(DSPType &&dsp)
Call this to start building your test using a DSP object.
AudioTestBuilder< typename DSPType::SampleTypePublicAlias > processAudioWith(std::unique_ptr< DSPType > &&dsp)
Call this to start building your test using a smart pointer to a DSP object.
AudioTestBuilder< float > processAudioWith(std::function< float(float)> dspFunction, const std::string &label={})
Call this to start building your test using a sample-wise function.
AudioTestBuilder< float > processAudioWith(std::function< void(AudioBuffer< float > &)> dspFunction, const std::string &label={})
Call this to start building your test using a block-wise in-place function.
AudioTestBuilder< double > processAudioWith(std::function< void(AudioBuffer< double > &)> dspFunction, const std::string &label={})
See the description of the float version of this function.
@ no
The signal will continue from whatever state it was in.
@ yes
The signal's state will be reset.
@ whenFails
File will be saved only when the test has failed.
@ never
File will not be saved.
@ always
File will be saved always, after the test is performed.
std::unique_ptr< ObjectType > make_unique(Args &&... args)
std::make_unique() replacement for C++11
static std::string toAbsolutePath(const std::string &path)
Converts path to absolute, if it's relative.
Loop
Helper values for something that could loop, like a Signal.
Preparation
Describes whether to call reset() and/or prepare() before rendering through DSP or a Signal.
WavFormat
Audio data storage format for the wav files.
Holds values set by the user via CLI interface.
double getDefaultRenderDurationSeconds() const
size_t getDefaultNumOutputChannels() const
size_t getDefaultNumInputChannels() const
double getDefaultSampleRateHz() const
size_t getGefaultBlockSizeFrames() const
static CLIConfig & getInstance()
Get the singleton instance.
Details about matcher failure.
size_t channel
Index of channel at which the failure was detected.
std::string description
Readable description of why the match has failed.
size_t frame
Index of frame at which the match has failed.