Skip to content

Commit

Permalink
Tests: Fixed test if no transient detected
Browse files Browse the repository at this point in the history
  • Loading branch information
drowaudio committed Jul 17, 2024
1 parent 91825a1 commit c277920
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions modules/tracktion_engine/plugins/tracktion_Plugins.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,22 @@ TEST_SUITE ("tracktion_engine")
if (shouldCheck)
{
CHECK (transient);
CHECK_LT (std::abs (transient->first - expectedTransientSample), 5); // 5 sample tolerance
CHECK_GT (transient->first, 0.5f);

if (transient)
{
CHECK_LT (std::abs (transient->first - expectedTransientSample), 5); // 5 sample tolerance
CHECK_GT (transient->first, 0.5f);
}
}
else
{
MESSAGE (std::to_string (transient.has_value()));
MESSAGE (std::to_string (std::abs (transient->first - expectedTransientSample) < 5)); // 5 sample tolerance
MESSAGE (std::to_string (transient->first > 0.5f));

if (transient)
{
MESSAGE (std::to_string (std::abs (transient->first - expectedTransientSample) < 5)); // 5 sample tolerance
MESSAGE (std::to_string (transient->first > 0.5f));
}
}
};

Expand Down

0 comments on commit c277920

Please sign in to comment.