Fixed intermittent unit test failures. (#7651)

The problem is that SurfacePoint doesn't have default values when constructed, and a few of the unit tests weren't setting m_position because the values weren't strictly needed for the test. However, the SurfacePointList checks them for validity and asserted when they couldn't be found, which was hit-and-miss due to it being uninitialized memory that was usually but not always 0xCCCCCCCC.
Improved the assert message and set the position values everywhere.

Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
This commit is contained in:
Mike Balfour
2022-02-15 17:59:04 -06:00
committed by GitHub
parent f2378fc8d8
commit 16d6cbca2a
3 changed files with 21 additions and 13 deletions
@@ -108,6 +108,7 @@ namespace GradientSignal
// Create a fake surface point with the position we're sampling.
AzFramework::SurfaceData::SurfacePoint point;
point.m_position = params.m_position;
point.m_normal = AZ::Vector3::CreateAxisZ();
SurfaceData::SurfacePointList pointList = AZStd::span<const AzFramework::SurfaceData::SurfacePoint>(&point, 1);
// Send it into the component, see what emerges