- Finished non-natural Exponential Tests
- Finished Common Tests TODO: Math Constants exp tests log tests
This commit is contained in:
80
test/tests/math/test_exponential.h
Normal file
80
test/tests/math/test_exponential.h
Normal file
@@ -0,0 +1,80 @@
|
||||
// =====================================================================================================================
|
||||
// fennec, a free and open source game engine
|
||||
// Copyright © 2025 Medusa Slockbower
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
// =====================================================================================================================
|
||||
|
||||
#ifndef FENNEC_TEST_MATH_EXPONENTIAL_H
|
||||
#define FENNEC_TEST_MATH_EXPONENTIAL_H
|
||||
|
||||
#include <fennec/math/exponential.h>
|
||||
|
||||
namespace fennec
|
||||
{
|
||||
|
||||
namespace test
|
||||
{
|
||||
|
||||
inline void fennec_test_math_exponential()
|
||||
{
|
||||
fennec_test_spacer(1);
|
||||
|
||||
fennec_test_run(fennec::pow(1.0f, 2.0f), 1.0f);
|
||||
fennec_test_run(fennec::pow(2.0f, 0.0f), 1.0f);
|
||||
fennec_test_run(fennec::pow(2.0f, 1.0f), 1.0f);
|
||||
fennec_test_run(fennec::pow(2.0f, 2.0f), 4.0f);
|
||||
|
||||
fennec_test_spacer(1);
|
||||
|
||||
//fennec_test_run(fennec::exp())
|
||||
|
||||
fennec_test_spacer(1);
|
||||
|
||||
fennec_test_run(fennec::exp2(-1.0f), 0.5f);
|
||||
fennec_test_run(fennec::exp2( 0.0f), 1.0f);
|
||||
fennec_test_run(fennec::exp2( 1.0f), 2.0f);
|
||||
fennec_test_run(fennec::exp2( 2.0f), 4.0f);
|
||||
|
||||
fennec_test_spacer(1);
|
||||
|
||||
//fennec_test_run(fennec::log())
|
||||
|
||||
fennec_test_spacer(1);
|
||||
|
||||
fennec_test_run(fennec::log2(1.0f), 0.0f);
|
||||
fennec_test_run(fennec::log2(2.0f), 1.0f);
|
||||
fennec_test_run(fennec::log2(4.0f), 2.0f);
|
||||
|
||||
fennec_test_spacer(1);
|
||||
|
||||
fennec_test_run(fennec::sqrt(1.0f), 1.0f);
|
||||
fennec_test_run(fennec::sqrt(4.0f), 2.0f);
|
||||
fennec_test_run(fennec::sqrt(9.0f), 3.0f);
|
||||
|
||||
fennec_test_spacer(1);
|
||||
|
||||
fennec_test_run(fennec::inversesqrt(1.0f), 1.0f / 1.0f);
|
||||
fennec_test_run(fennec::inversesqrt(4.0f), 1.0f / 2.0f);
|
||||
fennec_test_run(fennec::inversesqrt(9.0f), 1.0f / 3.0f);
|
||||
|
||||
fennec_test_spacer(2);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif // FENNEC_TEST_MATH_EXPONENTIAL_H
|
||||
Reference in New Issue
Block a user