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:
@@ -32,7 +32,11 @@ namespace SurfaceData
|
||||
inPositionIndex = (inPositionIndex + 1) % m_inputPositions.size();
|
||||
}
|
||||
|
||||
AZ_Assert(foundMatch, "Couldn't find input position!");
|
||||
AZ_Assert(
|
||||
foundMatch,
|
||||
"Couldn't find input position: (%0.7f, %0.7f, %0.7f), m_lastInputPositionIndex = %zu, m_inputPositions.size() = %zu",
|
||||
inPosition.GetX(), inPosition.GetY(), inPosition.GetZ(), m_lastInputPositionIndex, m_inputPositions.size());
|
||||
|
||||
m_lastInputPositionIndex = inPositionIndex;
|
||||
return inPositionIndex;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user