Модульные тесты для Vector2, Vector3, Quaternion и Versor: is unit, is zero, is identity

This commit is contained in:
Andrey Pokidov 2025-02-11 23:54:38 +07:00
parent 47ba771b68
commit 2d8240265c
74 changed files with 999 additions and 348 deletions

View file

@ -61,7 +61,7 @@ static const _TestNumberPairFP32 _TEST_FP32_DATA_DIFFERENT[] = {
{-100.0f, -100.0f * (1.0f - 1.25f * BGC_EPSYLON_FP32)}
};
int test_bgc_are_close_fp32()
int test_are_close_fp32()
{
print_testing_name("bgc_are_close_fp32");
@ -137,7 +137,7 @@ static const _TestNumberPairFP64 _TEST_FP64_DATA_DIFFERENT[] = {
{-100.0, -100.0 * (1.0 - 1.25 * BGC_EPSYLON_FP64)}
};
int test_bgc_are_close_fp64()
int test_are_close_fp64()
{
print_testing_name("bgc_are_close_fp64");
@ -162,13 +162,13 @@ int test_bgc_are_close_fp64()
return TEST_SUCCES;
}
int test_bgc_are_close()
int test_are_close()
{
if (test_bgc_are_close_fp32() != TEST_SUCCES) {
if (test_are_close_fp32() != TEST_SUCCES) {
return TEST_FAILED;
}
if (test_bgc_are_close_fp64() != TEST_SUCCES) {
if (test_are_close_fp64() != TEST_SUCCES) {
return TEST_FAILED;
}

View file

@ -1,10 +1,10 @@
#ifndef _TEST_UTILITIES_ARE_CLOSE_H_
#define _TEST_UTILITIES_ARE_CLOSE_H_
int test_bgc_are_close_fp32();
int test_are_close_fp32();
int test_bgc_are_close_fp64();
int test_are_close_fp64();
int test_bgc_are_close();
int test_are_close();
#endif

View file

@ -20,7 +20,7 @@ static const float _TEST_FP32_NONUNIT_NUMBERS[] = {
1.0f - 2.0f * BGC_EPSYLON_FP32
};
int test_bgc_is_unit_fp32()
int test_is_unit_fp32()
{
print_testing_name("bgc_is_unit_fp32");
@ -63,7 +63,7 @@ static const double _TEST_FP64_NONUNIT_NUMBERS[] = {
1.0 - 2.0 * BGC_EPSYLON_FP64
};
int test_bgc_is_unit_fp64()
int test_is_unit_fp64()
{
print_testing_name("bgc_is_unit_fp64");
@ -108,7 +108,7 @@ static const float _TEST_FP32_DATA_SQUARE_NONUNIT[] = {
1.0f - 2.5f * BGC_EPSYLON_FP32
};
int test_bgc_is_sqare_value_unit_fp32()
int test_is_sqare_value_unit_fp32()
{
print_testing_name("bgc_is_sqare_value_unit_fp32");
@ -153,7 +153,7 @@ static const double _TEST_FP64_DATA_SQUARE_NONUNIT[] = {
1.0 - 2.5 * BGC_EPSYLON_FP64
};
int test_bgc_is_sqare_value_unit_fp64()
int test_is_sqare_value_unit_fp64()
{
print_testing_name("bgc_is_sqare_value_unit_fp64");
@ -178,21 +178,21 @@ int test_bgc_is_sqare_value_unit_fp64()
return TEST_SUCCES;
}
int test_bgc_is_unit()
int test_is_unit()
{
if (test_bgc_is_unit_fp32() != TEST_SUCCES) {
if (test_is_unit_fp32() != TEST_SUCCES) {
return TEST_FAILED;
}
if (test_bgc_is_unit_fp64() != TEST_SUCCES) {
if (test_is_unit_fp64() != TEST_SUCCES) {
return TEST_FAILED;
}
if (test_bgc_is_sqare_value_unit_fp32() != TEST_SUCCES) {
if (test_is_sqare_value_unit_fp32() != TEST_SUCCES) {
return TEST_FAILED;
}
if (test_bgc_is_sqare_value_unit_fp64() != TEST_SUCCES) {
if (test_is_sqare_value_unit_fp64() != TEST_SUCCES) {
return TEST_FAILED;
}

View file

@ -1,14 +1,14 @@
#ifndef _TEST_UTILITIES_IS_UNIT_H_
#define _TEST_UTILITIES_IS_UNIT_H_
int test_bgc_is_unit_fp32();
int test_is_unit_fp32();
int test_bgc_is_unit_fp64();
int test_is_unit_fp64();
int test_bgc_is_sqare_value_unit_fp32();
int test_is_sqare_value_unit_fp32();
int test_bgc_is_sqare_value_unit_fp64();
int test_is_sqare_value_unit_fp64();
int test_bgc_is_unit();
int test_is_unit();
#endif

View file

@ -22,7 +22,7 @@ static const float _TEST_FP32_NONZERO_NUMBERS[] = {
-(1.5f * BGC_EPSYLON_FP32)
};
int test_bgc_is_zero_fp32()
int test_is_zero_fp32()
{
print_testing_name("bgc_is_zero_fp32");
@ -67,7 +67,7 @@ static const double _TEST_FP64_NONZERO_NUMBERS[] = {
-(1.5 * BGC_EPSYLON_FP64)
};
int test_bgc_is_zero_fp64()
int test_is_zero_fp64()
{
print_testing_name("bgc_is_zero_fp64");
@ -92,13 +92,13 @@ int test_bgc_is_zero_fp64()
return TEST_SUCCES;
}
int test_bgc_is_zero()
int test_is_zero()
{
if (test_bgc_is_zero_fp32() != TEST_SUCCES) {
if (test_is_zero_fp32() != TEST_SUCCES) {
return TEST_FAILED;
}
if (test_bgc_is_zero_fp64() != TEST_SUCCES) {
if (test_is_zero_fp64() != TEST_SUCCES) {
return TEST_FAILED;
}

View file

@ -1,10 +1,10 @@
#ifndef _TEST_UTILITIES_IS_ZERO_H_
#define _TEST_UTILITIES_IS_ZERO_H_
int test_bgc_is_zero_fp32();
int test_is_zero_fp32();
int test_bgc_is_zero_fp64();
int test_is_zero_fp64();
int test_bgc_is_zero();
int test_is_zero();
#endif