Модульные тесты для арифметических операций с векторами и комплексными числами

This commit is contained in:
Andrey Pokidov 2025-03-13 02:41:21 +07:00
parent 2e902bc040
commit f06b35ae34
14 changed files with 1317 additions and 0 deletions

View file

@ -11,4 +11,9 @@ void test_complex()
test_complex_is_zero();
test_complex_is_unit();
test_complex_modulus();
test_complex_add();
test_complex_subtract();
test_complex_multiply();
test_complex_divide();
}

View file

@ -9,6 +9,7 @@
#include "./complex/complex_is_zero.h"
#include "./complex/complex_is_unit.h"
#include "./complex/complex_modulus.h"
#include "./complex/complex_arithmetics.h"
void test_complex();

View file

Internal server error - Personal Git Server: Beyond coding. We Forge.

500

Internal server error

Forgejo version: 11.0.1+gitea-1.22.0

@ -0,0 +1,380 @@
#include "./complex_arithmetics.h"
#include "./../../helpers.h"
// ==================== Add ===================== //
void test_complex_add_fp32()
{
BgcComplexFP32 vector1, vector2, result;
print_testing_name("bgc_complex_add_fp32");
bgc_complex_set_values_fp32(10.0f, -20.0f, &vector1);
bgc_complex_set_values_fp32(4.0f, 5.0f, &vector2);
bgc_complex_add_fp32(&vector1, &vector2, &result);