Продолжение переименования

This commit is contained in:
Andrey Pokidov 2025-01-15 03:37:48 +07:00
parent 3b6efaafa9
commit 120e651517
19 changed files with 457 additions and 421 deletions

View file

@ -1,4 +1,4 @@
#include "vector2_fp32_test.h"
#include "fp32_vector2_test.h"
const int TEST_FP32_VECTOR2_AMOUNT_1 = 5;
@ -31,7 +31,7 @@ int test_vector2_fp32_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]);
if (!test_fp32_are_equal(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_FP32_TWO_EPSYLON)) {
print_test_failed();
return TEST_RESULT_FAILED;
}
@ -54,7 +54,7 @@ int test_vector2_fp32_modulus()
for (int i = 0; i < TEST_FP32_VECTOR2_AMOUNT_1; i++) {
square_modulus = vector2_get_modulus_fp32(&TEST_FP32_VECTOR2_COMMON_1[i]);
if (!test_fp32_are_equal(square_modulus, FP32_VECTOR2_MODULUS_1[i], TEST_FP32_EPSYLON)) {
if (!test_are_equal_fp32(square_modulus, FP32_VECTOR2_MODULUS_1[i], TEST_FP32_EPSYLON)) {
print_test_failed();
return TEST_RESULT_FAILED;
}
@ -74,17 +74,17 @@ const vector2_fp32_t TEST_FP32_VECTOR2_COMMON_1_2_SUM[] = {
{ -122.0f, -19.6217f }
};
int test_vector2_fp32_add()
int test_vector2_add_fp32()
{
print_test_name("vector2_fp32_t add");
vector2_fp32_t vector;
for (int i = 0; i < TEST_FP32_VECTOR2_AMOUNT_1; i++) {
vector2_fp32_add(&TEST_FP32_VECTOR2_COMMON_1[i], &TEST_FP32_VECTOR2_COMMON_2[i], &vector);
vector2_add_fp32(&TEST_FP32_VECTOR2_COMMON_1[i], &TEST_FP32_VECTOR2_COMMON_2[i], &vector);
if (!test_fp32_are_equal(vector.x1, TEST_FP32_VECTOR2_COMMON_1_2_SUM[i].x1, TEST_FP32_EPSYLON) ||
!test_fp32_are_equal(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_FP32_EPSYLON) ||
!test_are_equal_fp32(vector.x2, TEST_FP32_VECTOR2_COMMON_1_2_SUM[i].x2, TEST_FP32_EPSYLON)) {
print_test_failed();
return TEST_RESULT_FAILED;
}
@ -104,17 +104,17 @@ const vector2_fp32_t TEST_FP32_VECTOR2_COMMON_1_2_DIFF[] = {
{ -125.0f, 27.0783f }
};
int test_vector2_fp32_subtract()
int test_vector2_subtract_fp32()
{
print_test_name("vector2_fp32_t subtract");
vector2_fp32_t vector;
for (int i = 0; i < TEST_FP32_VECTOR2_AMOUNT_1; i++) {
vector2_fp32_subtract(&TEST_FP32_VECTOR2_COMMON_1[i], &TEST_FP32_VECTOR2_COMMON_2[i], &vector);
vector2_subtract_fp32(&TEST_FP32_VECTOR2_COMMON_1[i], &TEST_FP32_VECTOR2_COMMON_2[i], &vector);
if (!test_fp32_are_equal(vector.x1, TEST_FP32_VECTOR2_COMMON_1_2_DIFF[i].x1, TEST_FP32_EPSYLON) ||
!test_fp32_are_equal(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_FP32_EPSYLON) ||
!test_are_equal_fp32(vector.x2, TEST_FP32_VECTOR2_COMMON_1_2_DIFF[i].x2, TEST_FP32_EPSYLON)) {
print_test_failed();
return TEST_RESULT_FAILED;
}
@ -138,11 +138,11 @@ int test_fp32_vector2()
return TEST_RESULT_FAILED;
}
if (test_vector2_fp32_add() != TEST_RESULT_SUCCES) {
if (test_vector2_add_fp32() != TEST_RESULT_SUCCES) {
return TEST_RESULT_FAILED;
}
if (test_vector2_fp32_subtract() != TEST_RESULT_SUCCES) {
if (test_vector2_subtract_fp32() != TEST_RESULT_SUCCES) {
return TEST_RESULT_FAILED;
}