test boilerplate

This commit is contained in:
Marcin
2025-01-14 17:32:56 +00:00
parent 3e52d90ecb
commit 98f53c750d
3 changed files with 26 additions and 0 deletions

16
test/src/test_perlin.h Normal file
View File

@@ -0,0 +1,16 @@
/*
* 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"
TEST_IMPL(GLM_PREFIX, perlin) {
vec4 p = {1.0f, 2.0f, 3.0f, 4.0f};
float out = GLM(perlin)(p);
ASSERT(test_eq(out, 10.0f))
TEST_SUCCESS
}

View File

@@ -30,6 +30,7 @@
#include "test_quat.h" #include "test_quat.h"
#include "test_project.h" #include "test_project.h"
#include "test_plane.h" #include "test_plane.h"
#include "test_perlin.h"
#include "test_affine.h" #include "test_affine.h"
#include "test_affine2d.h" #include "test_affine2d.h"
#include "test_affine_mat.h" #include "test_affine_mat.h"
@@ -69,6 +70,7 @@
#include "test_quat.h" #include "test_quat.h"
#include "test_project.h" #include "test_project.h"
#include "test_plane.h" #include "test_plane.h"
#include "test_perlin.h"
#include "test_affine.h" #include "test_affine.h"
#include "test_affine2d.h" #include "test_affine2d.h"
#include "test_affine_mat.h" #include "test_affine_mat.h"

View File

@@ -356,6 +356,10 @@ TEST_DECLARE(glmc_project)
TEST_DECLARE(glm_plane_normalize) TEST_DECLARE(glm_plane_normalize)
TEST_DECLARE(glmc_plane_normalize) TEST_DECLARE(glmc_plane_normalize)
/* perlin */
TEST_DECLARE(glm_perlin)
TEST_DECLARE(glmc_perlin)
/* utils */ /* utils */
TEST_DECLARE(clamp) TEST_DECLARE(clamp)
@@ -1533,6 +1537,10 @@ TEST_LIST {
/* plane */ /* plane */
TEST_ENTRY(glm_plane_normalize) TEST_ENTRY(glm_plane_normalize)
TEST_ENTRY(glmc_plane_normalize) TEST_ENTRY(glmc_plane_normalize)
/* perlin */
TEST_ENTRY(glm_perlin)
TEST_ENTRY(glmc_perlin)
/* utils */ /* utils */
TEST_ENTRY(clamp) TEST_ENTRY(clamp)