From 98f53c750dcd6416ebd7185d311af5e75bc52c9f Mon Sep 17 00:00:00 2001 From: Marcin Date: Tue, 14 Jan 2025 17:32:56 +0000 Subject: [PATCH] test boilerplate --- test/src/test_perlin.h | 16 ++++++++++++++++ test/src/tests.c | 2 ++ test/tests.h | 8 ++++++++ 3 files changed, 26 insertions(+) create mode 100644 test/src/test_perlin.h diff --git a/test/src/test_perlin.h b/test/src/test_perlin.h new file mode 100644 index 0000000..3c9f2dc --- /dev/null +++ b/test/src/test_perlin.h @@ -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 +} diff --git a/test/src/tests.c b/test/src/tests.c index 4d93294..a32dc97 100644 --- a/test/src/tests.c +++ b/test/src/tests.c @@ -30,6 +30,7 @@ #include "test_quat.h" #include "test_project.h" #include "test_plane.h" +#include "test_perlin.h" #include "test_affine.h" #include "test_affine2d.h" #include "test_affine_mat.h" @@ -69,6 +70,7 @@ #include "test_quat.h" #include "test_project.h" #include "test_plane.h" +#include "test_perlin.h" #include "test_affine.h" #include "test_affine2d.h" #include "test_affine_mat.h" diff --git a/test/tests.h b/test/tests.h index bcb2fda..62e7d07 100644 --- a/test/tests.h +++ b/test/tests.h @@ -356,6 +356,10 @@ TEST_DECLARE(glmc_project) TEST_DECLARE(glm_plane_normalize) TEST_DECLARE(glmc_plane_normalize) +/* perlin */ +TEST_DECLARE(glm_perlin) +TEST_DECLARE(glmc_perlin) + /* utils */ TEST_DECLARE(clamp) @@ -1533,6 +1537,10 @@ TEST_LIST { /* plane */ TEST_ENTRY(glm_plane_normalize) TEST_ENTRY(glmc_plane_normalize) + + /* perlin */ + TEST_ENTRY(glm_perlin) + TEST_ENTRY(glmc_perlin) /* utils */ TEST_ENTRY(clamp)