diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-04-04 15:06:57 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-04-04 19:49:50 +0200 |
commit | f8ab79e68af20e18e1d868b64d6dfd0c429bc554 (patch) | |
tree | a9d2df2e2df939c189135b1c36a01e06b37b80b2 /tests | |
parent | 53317bbe146dd19a919685df8d846c55568daba1 (diff) |
Zero initialize all pointer class and struct members
This prevents the pitfall of UB when checking if they have been
assigned something valid by comparing to nullptr.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/core/math/test_geometry_3d.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/core/math/test_geometry_3d.h b/tests/core/math/test_geometry_3d.h index 1b8d2eee34..99a4ef2d46 100644 --- a/tests/core/math/test_geometry_3d.h +++ b/tests/core/math/test_geometry_3d.h @@ -288,7 +288,7 @@ TEST_CASE("[Geometry3D] Is Point in Projected Triangle") { TEST_CASE("[Geometry3D] Does Ray Intersect Triangle") { struct Case { Vector3 from, direction, v_1, v_2, v_3; - Vector3 *result; + Vector3 *result = nullptr; bool want; Case(){}; Case(Vector3 p_from, Vector3 p_direction, Vector3 p_v_1, Vector3 p_v_2, Vector3 p_v_3, bool p_want) : @@ -390,7 +390,7 @@ TEST_CASE("[Geometry3D] Triangle and Box Overlap") { struct Case { Vector3 box_centre; Vector3 box_half_size; - Vector3 *tri_verts; + Vector3 *tri_verts = nullptr; bool want; Case(){}; Case(Vector3 p_centre, Vector3 p_half_size, Vector3 *p_verts, bool p_want) : |