From fd8bd276579faa02f678c3ff61a5ef8da615bfcd Mon Sep 17 00:00:00 2001 From: Aaron Franke Date: Mon, 19 Sep 2022 12:49:18 -0500 Subject: Remove set_axis and get_axis methods from Vector2/2i/3/3i/4/4i --- tests/core/math/test_vector3.h | 8 ++------ tests/core/math/test_vector3i.h | 8 ++------ tests/core/math/test_vector4.h | 8 ++------ tests/core/math/test_vector4i.h | 8 ++------ 4 files changed, 8 insertions(+), 24 deletions(-) (limited to 'tests') diff --git a/tests/core/math/test_vector3.h b/tests/core/math/test_vector3.h index 6f99fada2b..3aa91991c0 100644 --- a/tests/core/math/test_vector3.h +++ b/tests/core/math/test_vector3.h @@ -76,16 +76,12 @@ TEST_CASE("[Vector3] Axis methods") { vector.min_axis_index() == Vector3::Axis::AXIS_X, "Vector3 min_axis_index should work as expected."); CHECK_MESSAGE( - vector.get_axis(vector.max_axis_index()) == (real_t)5.6, - "Vector3 get_axis should work as expected."); + vector[vector.max_axis_index()] == (real_t)5.6, + "Vector3 array operator should work as expected."); CHECK_MESSAGE( vector[vector.min_axis_index()] == (real_t)1.2, "Vector3 array operator should work as expected."); - vector.set_axis(Vector3::Axis::AXIS_Y, 4.7); - CHECK_MESSAGE( - vector.get_axis(Vector3::Axis::AXIS_Y) == (real_t)4.7, - "Vector3 set_axis should work as expected."); vector[Vector3::Axis::AXIS_Y] = 3.7; CHECK_MESSAGE( vector[Vector3::Axis::AXIS_Y] == (real_t)3.7, diff --git a/tests/core/math/test_vector3i.h b/tests/core/math/test_vector3i.h index b1c6944eba..b7014c21cd 100644 --- a/tests/core/math/test_vector3i.h +++ b/tests/core/math/test_vector3i.h @@ -45,16 +45,12 @@ TEST_CASE("[Vector3i] Axis methods") { vector.min_axis_index() == Vector3i::Axis::AXIS_X, "Vector3i min_axis_index should work as expected."); CHECK_MESSAGE( - vector.get_axis(vector.max_axis_index()) == 3, - "Vector3i get_axis should work as expected."); + vector[vector.max_axis_index()] == 3, + "Vector3i array operator should work as expected."); CHECK_MESSAGE( vector[vector.min_axis_index()] == 1, "Vector3i array operator should work as expected."); - vector.set_axis(Vector3i::Axis::AXIS_Y, 4); - CHECK_MESSAGE( - vector.get_axis(Vector3i::Axis::AXIS_Y) == 4, - "Vector3i set_axis should work as expected."); vector[Vector3i::Axis::AXIS_Y] = 5; CHECK_MESSAGE( vector[Vector3i::Axis::AXIS_Y] == 5, diff --git a/tests/core/math/test_vector4.h b/tests/core/math/test_vector4.h index ccf991401b..e39f8c5ffc 100644 --- a/tests/core/math/test_vector4.h +++ b/tests/core/math/test_vector4.h @@ -47,16 +47,12 @@ TEST_CASE("[Vector4] Axis methods") { vector.min_axis_index() == Vector4::Axis::AXIS_W, "Vector4 min_axis_index should work as expected."); CHECK_MESSAGE( - vector.get_axis(vector.max_axis_index()) == (real_t)5.6, - "Vector4 get_axis should work as expected."); + vector[vector.max_axis_index()] == (real_t)5.6, + "Vector4 array operator should work as expected."); CHECK_MESSAGE( vector[vector.min_axis_index()] == (real_t)-0.9, "Vector4 array operator should work as expected."); - vector.set_axis(Vector4::Axis::AXIS_Y, 4.7); - CHECK_MESSAGE( - vector.get_axis(Vector4::Axis::AXIS_Y) == (real_t)4.7, - "Vector4 set_axis should work as expected."); vector[Vector4::Axis::AXIS_Y] = 3.7; CHECK_MESSAGE( vector[Vector4::Axis::AXIS_Y] == (real_t)3.7, diff --git a/tests/core/math/test_vector4i.h b/tests/core/math/test_vector4i.h index ac63001b24..8bf019c7e5 100644 --- a/tests/core/math/test_vector4i.h +++ b/tests/core/math/test_vector4i.h @@ -45,16 +45,12 @@ TEST_CASE("[Vector4i] Axis methods") { vector.min_axis_index() == Vector4i::Axis::AXIS_X, "Vector4i min_axis_index should work as expected."); CHECK_MESSAGE( - vector.get_axis(vector.max_axis_index()) == 4, - "Vector4i get_axis should work as expected."); + vector[vector.max_axis_index()] == 4, + "Vector4i array operator should work as expected."); CHECK_MESSAGE( vector[vector.min_axis_index()] == 1, "Vector4i array operator should work as expected."); - vector.set_axis(Vector4i::Axis::AXIS_Y, 5); - CHECK_MESSAGE( - vector.get_axis(Vector4i::Axis::AXIS_Y) == 5, - "Vector4i set_axis should work as expected."); vector[Vector4i::Axis::AXIS_Y] = 5; CHECK_MESSAGE( vector[Vector4i::Axis::AXIS_Y] == 5, -- cgit v1.2.3