Модульные тесты для арифметических операций с векторами и комплексными числами
This commit is contained in:
parent
2e902bc040
commit
f06b35ae34
14 changed files with 1317 additions and 0 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
380
basic-geometry-test/tests/complex/complex_arithmetics.c
Normal file
380
basic-geometry-test/tests/complex/complex_arithmetics.c
Normal file
|
|
@ -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);
|
||||
|
||||