Завершение большого переименования

This commit is contained in:
Andrey Pokidov 2025-01-15 15:08:12 +07:00
parent 120e651517
commit 3805354611
31 changed files with 1213 additions and 1255 deletions

View file

@ -2,7 +2,7 @@
const int TEST_FP32_VECTOR2_AMOUNT_1 = 5;
const vector2_fp32_t TEST_FP32_VECTOR2_COMMON_1[] = {
const bgc_vector2_fp32_t TEST_FP32_VECTOR2_COMMON_1[] = {
{ 3.0f, 4.0f },
{ -3.0f, -4.0f },
{ 10000.0f, -20000.0f },
@ -10,7 +10,7 @@ const vector2_fp32_t TEST_FP32_VECTOR2_COMMON_1[] = {
{ -123.5f, 3.7283f }
};
const vector2_fp32_t TEST_FP32_VECTOR2_COMMON_2[] = {
const bgc_vector2_fp32_t TEST_FP32_VECTOR2_COMMON_2[] = {
{ -3.0f, -4.0f },
{ -3.0f, -4.0f },
{ 0.002f, -0.05f },
@ -29,9 +29,9 @@ int test_vector2_fp32_square_modulus()
float square_modulus;
for (int i = 0; i < TEST_FP32_VECTOR2_AMOUNT_1; i++) {
square_modulus = vector2_get_square_modulus_fp32(&TEST_FP32_VECTOR2_COMMON_1[i]);
square_modulus = bgc_vector2_get_square_modulus_fp32(&TEST_FP32_VECTOR2_COMMON_1[i]);
if (!test_are_equal_fp32(square_modulus, FP32_VECTOR2_SQUARE_MODULUS_1[i], TEST_FP32_TWO_EPSYLON)) {
if (!test_are_equal_fp32(square_modulus, FP32_VECTOR2_SQUARE_MODULUS_1[i], TEST_BGC_TWO_EPSYLON_FP32)) {
print_test_failed();
return TEST_RESULT_FAILED;
}
@ -52,9 +52,9 @@ int test_vector2_fp32_modulus()
float square_modulus;
for (int i = 0; i < TEST_FP32_VECTOR2_AMOUNT_1; i++) {
square_modulus = vector2_get_modulus_fp32(&TEST_FP32_VECTOR2_COMMON_1[i]);
square_modulus = bgc_vector2_get_modulus_fp32(&TEST_FP32_VECTOR2_COMMON_1[i]);
if (!test_are_equal_fp32(square_modulus, FP32_VECTOR2_MODULUS_1[i], TEST_FP32_EPSYLON)) {
if (!test_are_equal_fp32(square_modulus, FP32_VECTOR2_MODULUS_1[i], TEST_BGC_EPSYLON_FP32)) {
print_test_failed();
return TEST_RESULT_FAILED;
}
@ -66,7 +66,7 @@ int test_vector2_fp32_modulus()
// ===================== Add ==================== //
const vector2_fp32_t TEST_FP32_VECTOR2_COMMON_1_2_SUM[] = {
const bgc_vector2_fp32_t TEST_FP32_VECTOR2_COMMON_1_2_SUM[] = {
{ 0.0f, 0.0f },
{ -6.0f, -8.0f },
{ 10000.002f, -20000.05f },
@ -78,13 +78,13 @@ int test_vector2_add_fp32()
{
print_test_name("vector2_fp32_t add");
vector2_fp32_t vector;
bgc_vector2_fp32_t vector;
for (int i = 0; i < TEST_FP32_VECTOR2_AMOUNT_1; i++) {
vector2_add_fp32(&TEST_FP32_VECTOR2_COMMON_1[i], &TEST_FP32_VECTOR2_COMMON_2[i], &vector);
bgc_vector2_add_fp32(&TEST_FP32_VECTOR2_COMMON_1[i], &TEST_FP32_VECTOR2_COMMON_2[i], &vector);
if (!test_are_equal_fp32(vector.x1, TEST_FP32_VECTOR2_COMMON_1_2_SUM[i].x1, TEST_FP32_EPSYLON) ||
!test_are_equal_fp32(vector.x2, TEST_FP32_VECTOR2_COMMON_1_2_SUM[i].x2, TEST_FP32_EPSYLON)) {
if (!test_are_equal_fp32(vector.x1, TEST_FP32_VECTOR2_COMMON_1_2_SUM[i].x1, TEST_BGC_EPSYLON_FP32) ||
!test_are_equal_fp32(vector.x2, TEST_FP32_VECTOR2_COMMON_1_2_SUM[i].x2, TEST_BGC_EPSYLON_FP32)) {
print_test_failed();
return TEST_RESULT_FAILED;
}
@ -96,7 +96,7 @@ int test_vector2_add_fp32()
// ================== Subtract ================== //
const vector2_fp32_t TEST_FP32_VECTOR2_COMMON_1_2_DIFF[] = {
const bgc_vector2_fp32_t TEST_FP32_VECTOR2_COMMON_1_2_DIFF[] = {
{ 6.0f, 8.0f },
{ 0.0f, 0.0f },
{ 9999.998f, -19999.95f },
@ -108,13 +108,13 @@ int test_vector2_subtract_fp32()
{
print_test_name("vector2_fp32_t subtract");
vector2_fp32_t vector;
bgc_vector2_fp32_t vector;
for (int i = 0; i < TEST_FP32_VECTOR2_AMOUNT_1; i++) {
vector2_subtract_fp32(&TEST_FP32_VECTOR2_COMMON_1[i], &TEST_FP32_VECTOR2_COMMON_2[i], &vector);
bgc_vector2_subtract_fp32(&TEST_FP32_VECTOR2_COMMON_1[i], &TEST_FP32_VECTOR2_COMMON_2[i], &vector);
if (!test_are_equal_fp32(vector.x1, TEST_FP32_VECTOR2_COMMON_1_2_DIFF[i].x1, TEST_FP32_EPSYLON) ||
!test_are_equal_fp32(vector.x2, TEST_FP32_VECTOR2_COMMON_1_2_DIFF[i].x2, TEST_FP32_EPSYLON)) {
if (!test_are_equal_fp32(vector.x1, TEST_FP32_VECTOR2_COMMON_1_2_DIFF[i].x1, TEST_BGC_EPSYLON_FP32) ||
!test_are_equal_fp32(vector.x2, TEST_FP32_VECTOR2_COMMON_1_2_DIFF[i].x2, TEST_BGC_EPSYLON_FP32)) {
print_test_failed();
return TEST_RESULT_FAILED;
}

View file

@ -6,13 +6,13 @@
#define TEST_RESULT_SUCCES 0
#define TEST_RESULT_FAILED 100
#define TEST_FP32_EPSYLON 1E-6f
#define TEST_FP32_TWO_EPSYLON 2E-6f
#define TEST_FP32_SQUARE_EPSYLON 1E-12f
#define TEST_BGC_EPSYLON_FP32 1E-6f
#define TEST_BGC_TWO_EPSYLON_FP32 2E-6f
#define TEST_BGC_SQUARE_EPSYLON_FP32 1E-12f
#define TEST_FP64_EPSYLON 1E-13f
#define TEST_FP64_TWO_EPSYLON 2E-13f
#define TEST_FP64_SQUARE_EPSYLON 1E-26f
#define TEST_BGC_EPSYLON_FP64 1E-13f
#define TEST_BGC_TWO_EPSYLON_FP64 2E-13f
#define TEST_BGC_SQUARE_EPSYLON_FP64 1E-26f
void print_test_section(const char * name);