Skip to content

Commit

Permalink
Filters: make sure waveforms have valid timescale (now required by so…
Browse files Browse the repository at this point in the history
…me of the ones we have tests for). Print delta and tolerance on failure
  • Loading branch information
azonenberg committed Oct 2, 2023
1 parent 0f82ffb commit 2c261ad
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/Filters/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ void FillRandomWaveform(UniformAnalogWaveform* wfm, size_t size, float fmin, flo
wfm->MarkModifiedFromCpu();

wfm->m_revision ++;
if(wfm->m_timescale == 0)
wfm->m_timescale = 1000;
}

void VerifyMatchingResult(AcceleratorBuffer<float>& golden, AcceleratorBuffer<float>& observed, float tolerance)
Expand All @@ -120,7 +122,7 @@ void VerifyMatchingResult(AcceleratorBuffer<float>& golden, AcceleratorBuffer<fl

if( (delta >= tolerance) && firstFail)
{
LogError("first fail at i=%zu\n", i);
LogError("first fail at i=%zu (delta=%f, tolerance=%f)\n", i, delta, tolerance);
firstFail = false;
}

Expand Down

0 comments on commit 2c261ad

Please sign in to comment.