rename struct/aabb2d.h functions to match aabb2d.h, add tests

This commit is contained in:
duarm
2025-01-20 13:29:21 -03:00
parent 5861c37a93
commit f815918a74
6 changed files with 59 additions and 2 deletions

28
test/src/test_aabb2d.h Normal file
View File

@@ -0,0 +1,28 @@
/*
* Copyright (c), Recep Aslantas.
*
* MIT License (MIT), http://opensource.org/licenses/MIT
* Full license can be found in the LICENSE file
*/
#include "test_common.h"
#ifndef CGLM_TEST_AABB2D_ONCE
#define CGLM_TEST_AABB2D_ONCE
/* Macros */
/* Deprecated */
#endif /* CGLM_TEST_VEC4_ONCE */
/* --- */
TEST_IMPL(GLM_PREFIX, aabb2d_sizev) {
vec2 a[2] = {{10.0f, 10.0f}, {20.0f, 20.0f}};
vec2 size = {0};
GLM(aabb2d_sizev)(a, size);
ASSERTIFY(test_assert_vec2_eq(size, (vec2){10.0f, 10.0f}))
TEST_SUCCESS
}

View File

@@ -33,6 +33,7 @@
#include "test_affine.h"
#include "test_affine2d.h"
#include "test_affine_mat.h"
#include "test_aabb2d.h"
#include "test_ray.h"
#include "test_cam.h"
#include "test_cam_lh_no.h"
@@ -72,6 +73,7 @@
#include "test_affine.h"
#include "test_affine2d.h"
#include "test_affine_mat.h"
#include "test_aabb2d.h"
#include "test_ray.h"
#include "test_cam.h"
#include "test_cam_lh_no.h"

View File

@@ -97,6 +97,9 @@ TEST_DECLARE(glmc_rotate2d_make)
TEST_DECLARE(glmc_rotate2d)
TEST_DECLARE(glmc_rotate2d_to)
/* aabb2d */
TEST_DECLARE(glm_aabb2d_sizev)
/* mat4 */
TEST_DECLARE(glm_mat4_ucopy)
TEST_DECLARE(glm_mat4_copy)
@@ -1274,6 +1277,9 @@ TEST_LIST {
TEST_ENTRY(glmc_rotate2d_make)
TEST_ENTRY(glmc_rotate2d)
TEST_ENTRY(glmc_rotate2d_to)
/* aabb2d */
TEST_ENTRY(glm_aabb2d_sizev)
/* mat4 */
TEST_ENTRY(glm_mat4_ucopy)