Переход на версию 0.3: изменение подхода к именованию сущностей, добавление, изменение и удаление ряда функций
This commit is contained in:
parent
d33daf4e2d
commit
f7e41645fe
87 changed files with 4580 additions and 4051 deletions
|
|
@ -7,7 +7,7 @@
|
|||
// ==================== FP32 ==================== //
|
||||
|
||||
static const int _TEST_FP32_VECTOR2_AMOUNT = 4;
|
||||
static const BgcVector2FP32 _TEST_FP32_VECTOR2_LIST[] = {
|
||||
static const BGC_FP32_Vector2 _TEST_FP32_VECTOR2_LIST[] = {
|
||||
{ 1.0f, 2.0f },
|
||||
{ -2.0f, -1.0f },
|
||||
{ 100.0f, -100.0f },
|
||||
|
|
@ -16,13 +16,13 @@ static const BgcVector2FP32 _TEST_FP32_VECTOR2_LIST[] = {
|
|||
|
||||
void test_vector2_copy_fp32()
|
||||
{
|
||||
BgcVector2FP32 vector;
|
||||
BGC_FP32_Vector2 vector;
|
||||
|
||||
print_testing_name("bgc_vector2_copy_fp32");
|
||||
print_testing_name("bgc_fp32_vector2_copy");
|
||||
|
||||
for (int i = 0; i < _TEST_FP32_VECTOR2_AMOUNT; i++) {
|
||||
|
||||
bgc_vector2_copy_fp32(&_TEST_FP32_VECTOR2_LIST[i], &vector);
|
||||
bgc_fp32_vector2_copy(&_TEST_FP32_VECTOR2_LIST[i], &vector);
|
||||
|
||||
if (vector.x1 != _TEST_FP32_VECTOR2_LIST[i].x1 || vector.x2 != _TEST_FP32_VECTOR2_LIST[i].x2) {
|
||||
print_testing_failed();
|
||||
|
|
@ -36,7 +36,7 @@ void test_vector2_copy_fp32()
|
|||
// ==================== FP64 ==================== //
|
||||
|
||||
static const int _TEST_FP64_VECTOR2_AMOUNT = 4;
|
||||
static const BgcVector2FP64 _TEST_FP64_VECTOR2_LIST[] = {
|
||||
static const BGC_FP64_Vector2 _TEST_FP64_VECTOR2_LIST[] = {
|
||||
{ 1.0, 2.0 },
|
||||
{ -2.0, -1.0 },
|
||||
{ 100.0, -100.0 },
|
||||
|
|
@ -45,13 +45,13 @@ static const BgcVector2FP64 _TEST_FP64_VECTOR2_LIST[] = {
|
|||
|
||||
void test_vector2_copy_fp64()
|
||||
{
|
||||
BgcVector2FP64 vector;
|
||||
BGC_FP64_Vector2 vector;
|
||||
|
||||
print_testing_name("bgc_vector2_copy_fp64");
|
||||
print_testing_name("bgc_fp64_vector2_copy");
|
||||
|
||||
for (int i = 0; i < _TEST_FP64_VECTOR2_AMOUNT; i++) {
|
||||
|
||||
bgc_vector2_copy_fp64(&_TEST_FP64_VECTOR2_LIST[i], &vector);
|
||||
bgc_fp64_vector2_copy(&_TEST_FP64_VECTOR2_LIST[i], &vector);
|
||||
|
||||
if (vector.x1 != _TEST_FP64_VECTOR2_LIST[i].x1 || vector.x2 != _TEST_FP64_VECTOR2_LIST[i].x2) {
|
||||
print_testing_failed();
|
||||
|
|
|
|||
|
|
@ -7,32 +7,32 @@
|
|||
static const int _TEST_FP32_UNIT_VECTOR2_AMOUNT = 6;
|
||||
static const int _TEST_FP32_NONUNIT_VECTOR2_AMOUNT = 7;
|
||||
|
||||
static const BgcVector2FP32 _TEST_FP32_UNIT_VECTOR2_LIST[] = {
|
||||
static const BGC_FP32_Vector2 _TEST_FP32_UNIT_VECTOR2_LIST[] = {
|
||||
{ 1.0f, 0.0f },
|
||||
{ 0.0f, -1.0f },
|
||||
{ 1.0f + 0.75f * BGC_EPSYLON_FP32, 0.0f },
|
||||
{ 1.0f - 0.75f * BGC_EPSYLON_FP32, 0.0f },
|
||||
{ 0.0f, 1.0f + 0.75f * BGC_EPSYLON_FP32 },
|
||||
{ 0.0f, 1.0f - 0.75f * BGC_EPSYLON_FP32 }
|
||||
{ 1.0f + 0.75f * BGC_FP32_EPSYLON, 0.0f },
|
||||
{ 1.0f - 0.75f * BGC_FP32_EPSYLON, 0.0f },
|
||||
{ 0.0f, 1.0f + 0.75f * BGC_FP32_EPSYLON },
|
||||
{ 0.0f, 1.0f - 0.75f * BGC_FP32_EPSYLON }
|
||||
};
|
||||
|
||||
static const BgcVector2FP32 _TEST_FP32_NONUNIT_VECTOR2_LIST[] = {
|
||||
static const BGC_FP32_Vector2 _TEST_FP32_NONUNIT_VECTOR2_LIST[] = {
|
||||
{ 0.0f, 0.0f },
|
||||
{ 1.0f + 1.25f * BGC_EPSYLON_FP32, 0.0f },
|
||||
{ 1.0f - 1.25f * BGC_EPSYLON_FP32, 0.0f },
|
||||
{ 0.0f, 1.0f + 1.25f * BGC_EPSYLON_FP32 },
|
||||
{ 0.0f, 1.0f - 1.25f * BGC_EPSYLON_FP32 },
|
||||
{ 0.8f + 1.25f * BGC_EPSYLON_FP32, 0.6f + 1.25f * BGC_EPSYLON_FP32 },
|
||||
{ 0.6f - 1.25f * BGC_EPSYLON_FP32, 0.8f - 1.25f * BGC_EPSYLON_FP32 }
|
||||
{ 1.0f + 1.25f * BGC_FP32_EPSYLON, 0.0f },
|
||||
{ 1.0f - 1.25f * BGC_FP32_EPSYLON, 0.0f },
|
||||
{ 0.0f, 1.0f + 1.25f * BGC_FP32_EPSYLON },
|
||||
{ 0.0f, 1.0f - 1.25f * BGC_FP32_EPSYLON },
|
||||
{ 0.8f + 1.25f * BGC_FP32_EPSYLON, 0.6f + 1.25f * BGC_FP32_EPSYLON },
|
||||
{ 0.6f - 1.25f * BGC_FP32_EPSYLON, 0.8f - 1.25f * BGC_FP32_EPSYLON }
|
||||
};
|
||||
|
||||
void test_vector2_is_unit_fp32()
|
||||
{
|
||||
print_testing_name("bgc_vector2_is_unit_fp32");
|
||||
print_testing_name("bgc_fp32_vector2_is_unit");
|
||||
|
||||
// Testing zero values:
|
||||
for (int i = 0; i < _TEST_FP32_UNIT_VECTOR2_AMOUNT; i++) {
|
||||
if (!bgc_vector2_is_unit_fp32(&_TEST_FP32_UNIT_VECTOR2_LIST[i])) {
|
||||
if (!bgc_fp32_vector2_is_unit(&_TEST_FP32_UNIT_VECTOR2_LIST[i])) {
|
||||
print_testing_error("A unit vector was not recognized");
|
||||
return;
|
||||
}
|
||||
|
|
@ -40,7 +40,7 @@ void test_vector2_is_unit_fp32()
|
|||
|
||||
// Testing non-zero values:
|
||||
for (int i = 0; i < _TEST_FP32_NONUNIT_VECTOR2_AMOUNT; i++) {
|
||||
if (bgc_vector2_is_unit_fp32(&_TEST_FP32_NONUNIT_VECTOR2_LIST[i])) {
|
||||
if (bgc_fp32_vector2_is_unit(&_TEST_FP32_NONUNIT_VECTOR2_LIST[i])) {
|
||||
print_testing_error("A non-unit vector was recognized as a unit vector");
|
||||
return;
|
||||
}
|
||||
|
|
@ -54,32 +54,32 @@ void test_vector2_is_unit_fp32()
|
|||
static const int _TEST_FP64_UNIT_VECTOR2_AMOUNT = 6;
|
||||
static const int _TEST_FP64_NONUNIT_VECTOR2_AMOUNT = 7;
|
||||
|
||||
static const BgcVector2FP64 _TEST_FP64_UNIT_VECTOR2_LIST[] = {
|
||||
static const BGC_FP64_Vector2 _TEST_FP64_UNIT_VECTOR2_LIST[] = {
|
||||
{ -1.0, 0.0 },
|
||||
{ 0.0, 1.0 },
|
||||
{ 1.0 + 0.75 * BGC_EPSYLON_FP64, 0.0 },
|
||||
{ 1.0 - 0.75 * BGC_EPSYLON_FP64, 0.0 },
|
||||
{ 0.0, 1.0 + 0.75 * BGC_EPSYLON_FP64 },
|
||||
{ 0.0, 1.0 - 0.75 * BGC_EPSYLON_FP64 }
|
||||
{ 1.0 + 0.75 * BGC_FP64_EPSYLON, 0.0 },
|
||||
{ 1.0 - 0.75 * BGC_FP64_EPSYLON, 0.0 },
|
||||
{ 0.0, 1.0 + 0.75 * BGC_FP64_EPSYLON },
|
||||
{ 0.0, 1.0 - 0.75 * BGC_FP64_EPSYLON }
|
||||
};
|
||||
|
||||
static const BgcVector2FP64 _TEST_FP64_NONUNIT_VECTOR2_LIST[] = {
|
||||
static const BGC_FP64_Vector2 _TEST_FP64_NONUNIT_VECTOR2_LIST[] = {
|
||||
{ 0.0, 0.0 },
|
||||
{ 1.0 + 1.25 * BGC_EPSYLON_FP64, 0.0 },
|
||||
{ 1.0 - 1.25 * BGC_EPSYLON_FP64, 0.0 },
|
||||
{ 0.0, 1.0 + 1.25 * BGC_EPSYLON_FP64 },
|
||||
{ 0.0, 1.0 - 1.25 * BGC_EPSYLON_FP64 },
|
||||
{ 0.6 + 1.25 * BGC_EPSYLON_FP64, 0.8 + 1.25 * BGC_EPSYLON_FP64 },
|
||||
{ 0.8 - 1.25 * BGC_EPSYLON_FP64, 0.6 - 1.25 * BGC_EPSYLON_FP64 }
|
||||
{ 1.0 + 1.25 * BGC_FP64_EPSYLON, 0.0 },
|
||||
{ 1.0 - 1.25 * BGC_FP64_EPSYLON, 0.0 },
|
||||
{ 0.0, 1.0 + 1.25 * BGC_FP64_EPSYLON },
|
||||
{ 0.0, 1.0 - 1.25 * BGC_FP64_EPSYLON },
|
||||
{ 0.6 + 1.25 * BGC_FP64_EPSYLON, 0.8 + 1.25 * BGC_FP64_EPSYLON },
|
||||
{ 0.8 - 1.25 * BGC_FP64_EPSYLON, 0.6 - 1.25 * BGC_FP64_EPSYLON }
|
||||
};
|
||||
|
||||
void test_vector2_is_unit_fp64()
|
||||
{
|
||||
print_testing_name("bgc_vector2_is_unit_fp64");
|
||||
print_testing_name("bgc_fp64_vector2_is_unit");
|
||||
|
||||
// Testing zero values:
|
||||
for (int i = 0; i < _TEST_FP64_UNIT_VECTOR2_AMOUNT; i++) {
|
||||
if (!bgc_vector2_is_unit_fp64(&_TEST_FP64_UNIT_VECTOR2_LIST[i])) {
|
||||
if (!bgc_fp64_vector2_is_unit(&_TEST_FP64_UNIT_VECTOR2_LIST[i])) {
|
||||
print_testing_error("A unit vector was not recognized");
|
||||
return;
|
||||
}
|
||||
|
|
@ -87,7 +87,7 @@ void test_vector2_is_unit_fp64()
|
|||
|
||||
// Testing non-zero values:
|
||||
for (int i = 0; i < _TEST_FP64_NONUNIT_VECTOR2_AMOUNT; i++) {
|
||||
if (bgc_vector2_is_unit_fp64(&_TEST_FP64_NONUNIT_VECTOR2_LIST[i])) {
|
||||
if (bgc_fp64_vector2_is_unit(&_TEST_FP64_NONUNIT_VECTOR2_LIST[i])) {
|
||||
print_testing_error("A non-unit vector was recognized as a unit vector");
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,31 +7,31 @@
|
|||
static const int _TEST_FP32_ZERO_VECTOR2_AMOUNT = 5;
|
||||
static const int _TEST_FP32_NONZERO_VECTOR2_AMOUNT = 7;
|
||||
|
||||
static const BgcVector2FP32 _TEST_FP32_ZERO_VECTOR2_LIST[] = {
|
||||
static const BGC_FP32_Vector2 _TEST_FP32_ZERO_VECTOR2_LIST[] = {
|
||||
{ 0.0f, 0.0f },
|
||||
{ 0.75f * BGC_EPSYLON_FP32, 0.0f },
|
||||
{ -0.75f * BGC_EPSYLON_FP32, 0.0f },
|
||||
{ 0.0f, 0.75f * BGC_EPSYLON_FP32 },
|
||||
{ 0.0f, -0.75f * BGC_EPSYLON_FP32 }
|
||||
{ 0.75f * BGC_FP32_EPSYLON, 0.0f },
|
||||
{ -0.75f * BGC_FP32_EPSYLON, 0.0f },
|
||||
{ 0.0f, 0.75f * BGC_FP32_EPSYLON },
|
||||
{ 0.0f, -0.75f * BGC_FP32_EPSYLON }
|
||||
};
|
||||
|
||||
static const BgcVector2FP32 _TEST_FP32_NONZERO_VECTOR2_LIST[] = {
|
||||
static const BGC_FP32_Vector2 _TEST_FP32_NONZERO_VECTOR2_LIST[] = {
|
||||
{ 0.0f, 1.0f },
|
||||
{ 1.25f * BGC_EPSYLON_FP32, 0.0f },
|
||||
{ -1.25f * BGC_EPSYLON_FP32, 0.0f },
|
||||
{ 0.0f, 1.25f * BGC_EPSYLON_FP32 },
|
||||
{ 0.0f, -1.25f * BGC_EPSYLON_FP32 },
|
||||
{ 1.25f * BGC_EPSYLON_FP32, 1.25f * BGC_EPSYLON_FP32 },
|
||||
{ -1.25f * BGC_EPSYLON_FP32, -1.25f * BGC_EPSYLON_FP32 }
|
||||
{ 1.25f * BGC_FP32_EPSYLON, 0.0f },
|
||||
{ -1.25f * BGC_FP32_EPSYLON, 0.0f },
|
||||
{ 0.0f, 1.25f * BGC_FP32_EPSYLON },
|
||||
{ 0.0f, -1.25f * BGC_FP32_EPSYLON },
|
||||
{ 1.25f * BGC_FP32_EPSYLON, 1.25f * BGC_FP32_EPSYLON },
|
||||
{ -1.25f * BGC_FP32_EPSYLON, -1.25f * BGC_FP32_EPSYLON }
|
||||
};
|
||||
|
||||
void test_vector2_is_zero_fp32()
|
||||
{
|
||||
print_testing_name("bgc_vector2_is_zero_fp32");
|
||||
print_testing_name("bgc_fp32_vector2_is_zero");
|
||||
|
||||
// Testing zero values:
|
||||
for (int i = 0; i < _TEST_FP32_ZERO_VECTOR2_AMOUNT; i++) {
|
||||
if (!bgc_vector2_is_zero_fp32(&_TEST_FP32_ZERO_VECTOR2_LIST[i])) {
|
||||
if (!bgc_fp32_vector2_is_zero(&_TEST_FP32_ZERO_VECTOR2_LIST[i])) {
|
||||
print_testing_error("A zero vector was not recongized");
|
||||
return;
|
||||
}
|
||||
|
|
@ -39,7 +39,7 @@ void test_vector2_is_zero_fp32()
|
|||
|
||||
// Testing non-zero values:
|
||||
for (int i = 0; i < _TEST_FP32_NONZERO_VECTOR2_AMOUNT; i++) {
|
||||
if (bgc_vector2_is_zero_fp32(&_TEST_FP32_NONZERO_VECTOR2_LIST[i])) {
|
||||
if (bgc_fp32_vector2_is_zero(&_TEST_FP32_NONZERO_VECTOR2_LIST[i])) {
|
||||
print_testing_error("A non-zero vector was recongized as a zero vector");
|
||||
return;
|
||||
}
|
||||
|
|
@ -53,31 +53,31 @@ void test_vector2_is_zero_fp32()
|
|||
static const int _TEST_FP64_ZERO_VECTOR2_AMOUNT = 5;
|
||||
static const int _TEST_FP64_NONZERO_VECTOR2_AMOUNT = 7;
|
||||
|
||||
static const BgcVector2FP64 _TEST_FP64_ZERO_VECTOR2_LIST[] = {
|
||||
static const BGC_FP64_Vector2 _TEST_FP64_ZERO_VECTOR2_LIST[] = {
|
||||
{ 0.0, 0.0 },
|
||||
{ 0.75 * BGC_EPSYLON_FP64, 0.0 },
|
||||
{ -0.75 * BGC_EPSYLON_FP64, 0.0 },
|
||||
{ 0.0, 0.75 * BGC_EPSYLON_FP64 },
|
||||
{ 0.0, -0.75 * BGC_EPSYLON_FP64 }
|
||||
{ 0.75 * BGC_FP64_EPSYLON, 0.0 },
|
||||
{ -0.75 * BGC_FP64_EPSYLON, 0.0 },
|
||||
{ 0.0, 0.75 * BGC_FP64_EPSYLON },
|
||||
{ 0.0, -0.75 * BGC_FP64_EPSYLON }
|
||||
};
|
||||
|
||||
static const BgcVector2FP64 _TEST_FP64_NONZERO_VECTOR2_LIST[] = {
|
||||
static const BGC_FP64_Vector2 _TEST_FP64_NONZERO_VECTOR2_LIST[] = {
|
||||
{ 0.0, 1.0 },
|
||||
{ 1.25 * BGC_EPSYLON_FP64, 0.0 },
|
||||
{ -1.25 * BGC_EPSYLON_FP64, 0.0 },
|
||||
{ 0.0, 1.25 * BGC_EPSYLON_FP64 },
|
||||
{ 0.0, -1.25 * BGC_EPSYLON_FP64 },
|
||||
{ 1.25 * BGC_EPSYLON_FP64, 1.25 * BGC_EPSYLON_FP64 },
|
||||
{ -1.25 * BGC_EPSYLON_FP64, -1.25 * BGC_EPSYLON_FP64 }
|
||||
{ 1.25 * BGC_FP64_EPSYLON, 0.0 },
|
||||
{ -1.25 * BGC_FP64_EPSYLON, 0.0 },
|
||||
{ 0.0, 1.25 * BGC_FP64_EPSYLON },
|
||||
{ 0.0, -1.25 * BGC_FP64_EPSYLON },
|
||||
{ 1.25 * BGC_FP64_EPSYLON, 1.25 * BGC_FP64_EPSYLON },
|
||||
{ -1.25 * BGC_FP64_EPSYLON, -1.25 * BGC_FP64_EPSYLON }
|
||||
};
|
||||
|
||||
void test_vector2_is_zero_fp64()
|
||||
{
|
||||
print_testing_name("bgc_vector2_is_zero_fp64");
|
||||
print_testing_name("bgc_fp64_vector2_is_zero");
|
||||
|
||||
// Testing zero values:
|
||||
for (int i = 0; i < _TEST_FP64_ZERO_VECTOR2_AMOUNT; i++) {
|
||||
if (!bgc_vector2_is_zero_fp64(&_TEST_FP64_ZERO_VECTOR2_LIST[i])) {
|
||||
if (!bgc_fp64_vector2_is_zero(&_TEST_FP64_ZERO_VECTOR2_LIST[i])) {
|
||||
print_testing_error("A zero vector was not recongized");
|
||||
return;
|
||||
}
|
||||
|
|
@ -85,7 +85,7 @@ void test_vector2_is_zero_fp64()
|
|||
|
||||
// Testing non-zero values:
|
||||
for (int i = 0; i < _TEST_FP64_NONZERO_VECTOR2_AMOUNT; i++) {
|
||||
if (bgc_vector2_is_zero_fp64(&_TEST_FP64_NONZERO_VECTOR2_LIST[i])) {
|
||||
if (bgc_fp64_vector2_is_zero(&_TEST_FP64_NONZERO_VECTOR2_LIST[i])) {
|
||||
print_testing_error("A non-zero vector was recongized as a zero vector");
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
static const int _TEST_FP32_VECTOR2_AMOUNT = 4;
|
||||
|
||||
static const BgcVector2FP32 _TEST_FP32_VECTOR2_LIST[] = {
|
||||
static const BGC_FP32_Vector2 _TEST_FP32_VECTOR2_LIST[] = {
|
||||
{ 4.0f, 3.0f },
|
||||
{ -3.0f, -4.0f },
|
||||
{ 100.0f, -100.0f },
|
||||
|
|
@ -29,10 +29,10 @@ static const float _TEST_FP32_MODULUS_LIST[] = {
|
|||
|
||||
void test_vector2_square_modulus_fp32()
|
||||
{
|
||||
print_testing_name("bgc_vector2_get_square_modulus_fp32");
|
||||
print_testing_name("bgc_fp32_vector2_get_square_modulus");
|
||||
|
||||
for (int i = 0; i < _TEST_FP32_VECTOR2_AMOUNT; i++) {
|
||||
if (!bgc_are_close_fp32(bgc_vector2_get_square_modulus_fp32(&_TEST_FP32_VECTOR2_LIST[i]), _TEST_FP32_SQUARE_MODULUS_LIST[i])) {
|
||||
if (!bgc_fp32_are_close(bgc_fp32_vector2_get_square_modulus(&_TEST_FP32_VECTOR2_LIST[i]), _TEST_FP32_SQUARE_MODULUS_LIST[i])) {
|
||||
print_testing_failed();
|
||||
return;
|
||||
}
|
||||
|
|
@ -43,10 +43,10 @@ void test_vector2_square_modulus_fp32()
|
|||
|
||||
void test_vector2_modulus_fp32()
|
||||
{
|
||||
print_testing_name("bgc_vector2_get_modulus_fp32");
|
||||
print_testing_name("bgc_fp32_vector2_get_modulus");
|
||||
|
||||
for (int i = 0; i < _TEST_FP32_VECTOR2_AMOUNT; i++) {
|
||||
if (!bgc_are_close_fp32(bgc_vector2_get_modulus_fp32(&_TEST_FP32_VECTOR2_LIST[i]), _TEST_FP32_MODULUS_LIST[i])) {
|
||||
if (!bgc_fp32_are_close(bgc_fp32_vector2_get_modulus(&_TEST_FP32_VECTOR2_LIST[i]), _TEST_FP32_MODULUS_LIST[i])) {
|
||||
print_testing_failed();
|
||||
return;
|
||||
}
|
||||
|
|
@ -59,7 +59,7 @@ void test_vector2_modulus_fp32()
|
|||
|
||||
static const int _TEST_FP64_VECTOR2_AMOUNT = 4;
|
||||
|
||||
static const BgcVector2FP64 _TEST_FP64_VECTOR2_LIST[] = {
|
||||
static const BGC_FP64_Vector2 _TEST_FP64_VECTOR2_LIST[] = {
|
||||
{ 4.0, 3.0 },
|
||||
{ -3.0, -4.0 },
|
||||
{ 100.0, -100.0 },
|
||||
|
|
@ -82,10 +82,10 @@ static const double _TEST_FP64_MODULUS_LIST[] = {
|
|||
|
||||
void test_vector2_square_modulus_fp64()
|
||||
{
|
||||
print_testing_name("bgc_vector2_get_square_modulus_fp64");
|
||||
print_testing_name("bgc_fp64_vector2_get_square_modulus");
|
||||
|
||||
for (int i = 0; i < _TEST_FP64_VECTOR2_AMOUNT; i++) {
|
||||
if (!bgc_are_close_fp64(bgc_vector2_get_square_modulus_fp64(&_TEST_FP64_VECTOR2_LIST[i]), _TEST_FP64_SQUARE_MODULUS_LIST[i])) {
|
||||
if (!bgc_fp64_are_close(bgc_fp64_vector2_get_square_modulus(&_TEST_FP64_VECTOR2_LIST[i]), _TEST_FP64_SQUARE_MODULUS_LIST[i])) {
|
||||
print_testing_failed();
|
||||
return;
|
||||
}
|
||||
|
|
@ -96,10 +96,10 @@ void test_vector2_square_modulus_fp64()
|
|||
|
||||
void test_vector2_modulus_fp64()
|
||||
{
|
||||
print_testing_name("bgc_vector2_get_modulus_fp64");
|
||||
print_testing_name("bgc_fp64_vector2_get_modulus");
|
||||
|
||||
for (int i = 0; i < _TEST_FP64_VECTOR2_AMOUNT; i++) {
|
||||
if (!bgc_are_close_fp64(bgc_vector2_get_modulus_fp64(&_TEST_FP64_VECTOR2_LIST[i]), _TEST_FP64_MODULUS_LIST[i])) {
|
||||
if (!bgc_fp64_are_close(bgc_fp64_vector2_get_modulus(&_TEST_FP64_VECTOR2_LIST[i]), _TEST_FP64_MODULUS_LIST[i])) {
|
||||
print_testing_failed();
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,11 +4,11 @@
|
|||
|
||||
void test_vector2_reset_fp32()
|
||||
{
|
||||
BgcVector2FP32 vector;
|
||||
BGC_FP32_Vector2 vector;
|
||||
|
||||
print_testing_name("bgc_vector2_reset_fp32");
|
||||
print_testing_name("bgc_fp32_vector2_reset");
|
||||
|
||||
bgc_vector2_reset_fp32(&vector);
|
||||
bgc_fp32_vector2_reset(&vector);
|
||||
|
||||
if (vector.x1 != 0.0f || vector.x2 != 0.0f) {
|
||||
print_testing_failed();
|
||||
|
|
@ -20,11 +20,11 @@ void test_vector2_reset_fp32()
|
|||
|
||||
void test_vector2_reset_fp64()
|
||||
{
|
||||
BgcVector2FP64 vector;
|
||||
BGC_FP64_Vector2 vector;
|
||||
|
||||
print_testing_name("bgc_vector2_reset_fp64");
|
||||
print_testing_name("bgc_fp64_vector2_reset");
|
||||
|
||||
bgc_vector2_reset_fp64(&vector);
|
||||
bgc_fp64_vector2_reset(&vector);
|
||||
|
||||
if (vector.x1 != 0.0 || vector.x2 != 0.0) {
|
||||
print_testing_failed();
|
||||
|
|
|
|||
|
|
@ -8,25 +8,25 @@
|
|||
|
||||
void test_vector2_set_values_fp32()
|
||||
{
|
||||
BgcVector2FP32 vector;
|
||||
BGC_FP32_Vector2 vector;
|
||||
|
||||
print_testing_name("bgc_vector2_set_values_fp32");
|
||||
print_testing_name("bgc_fp32_vector2_make");
|
||||
|
||||
bgc_vector2_set_values_fp32(1.0f, 2.0f, &vector);
|
||||
bgc_fp32_vector2_make(1.0f, 2.0f, &vector);
|
||||
|
||||
if (vector.x1 != 1.0f || vector.x2 != 2.0f) {
|
||||
print_testing_error("First step failed");
|
||||
return;
|
||||
}
|
||||
|
||||
bgc_vector2_set_values_fp32(-3.0f, -5.0f, &vector);
|
||||
bgc_fp32_vector2_make(-3.0f, -5.0f, &vector);
|
||||
|
||||
if (vector.x1 != -3.0f || vector.x2 != -5.0f) {
|
||||
print_testing_error("Second step failed");
|
||||
return;
|
||||
}
|
||||
|
||||
bgc_vector2_set_values_fp32(-2.0f, 2.0f, &vector);
|
||||
bgc_fp32_vector2_make(-2.0f, 2.0f, &vector);
|
||||
|
||||
if (vector.x1 != -2.0f || vector.x2 != 2.0f) {
|
||||
print_testing_error("Third step failed");
|
||||
|
|
@ -40,26 +40,26 @@ void test_vector2_set_values_fp32()
|
|||
|
||||
void test_vector2_set_values_fp64()
|
||||
{
|
||||
BgcVector2FP64 vector;
|
||||
BGC_FP64_Vector2 vector;
|
||||
|
||||
print_testing_name("bgc_vector2_set_values_fp64");
|
||||
print_testing_name("bgc_fp64_vector2_make");
|
||||
|
||||
|
||||
bgc_vector2_set_values_fp64(1.0, 2.0, &vector);
|
||||
bgc_fp64_vector2_make(1.0, 2.0, &vector);
|
||||
|
||||
if (vector.x1 != 1.0 || vector.x2 != 2.0) {
|
||||
print_testing_error("First step failed");
|
||||
return;
|
||||
}
|
||||
|
||||
bgc_vector2_set_values_fp64(-3.0, -5.0, &vector);
|
||||
bgc_fp64_vector2_make(-3.0, -5.0, &vector);
|
||||
|
||||
if (vector.x1 != -3.0 || vector.x2 != -5.0) {
|
||||
print_testing_error("Second step failed");
|
||||
return;
|
||||
}
|
||||
|
||||
bgc_vector2_set_values_fp64(-2.0, 2.0, &vector);
|
||||
bgc_fp64_vector2_make(-2.0, 2.0, &vector);
|
||||
|
||||
if (vector.x1 != -2.0 || vector.x2 != 2.0) {
|
||||
print_testing_error("Third step failed");
|
||||
|
|
|
|||
|
|
@ -8,14 +8,14 @@
|
|||
|
||||
static const int _TEST_FP32_VECTOR2_AMOUNT = 4;
|
||||
|
||||
static const BgcVector2FP32 _TEST_FP32_VECTOR2_LIST1[] = {
|
||||
static const BGC_FP32_Vector2 _TEST_FP32_VECTOR2_LIST1[] = {
|
||||
{ 1.0f, 2.0f },
|
||||
{ -2.0f, -1.0f },
|
||||
{ 100.0f, -100.0f },
|
||||
{ -100.1f, 100.2f }
|
||||
};
|
||||
|
||||
static const BgcVector2FP32 _TEST_FP32_VECTOR2_LIST2[] = {
|
||||
static const BGC_FP32_Vector2 _TEST_FP32_VECTOR2_LIST2[] = {
|
||||
{ 3.6f, 5.3f },
|
||||
{ 204.07f, -781.89f },
|
||||
{ -20.02f, -1.0003f },
|
||||
|
|
@ -24,15 +24,15 @@ static const BgcVector2FP32 _TEST_FP32_VECTOR2_LIST2[] = {
|
|||
|
||||
void test_vector2_swap_fp32()
|
||||
{
|
||||
BgcVector2FP32 vector1, vector2;
|
||||
BGC_FP32_Vector2 vector1, vector2;
|
||||
|
||||
print_testing_name("bgc_vector2_swap_fp32");
|
||||
print_testing_name("bgc_fp32_vector2_swap");
|
||||
|
||||
for (int i = 0; i < _TEST_FP32_VECTOR2_AMOUNT; i++) {
|
||||
bgc_vector2_copy_fp32(&_TEST_FP32_VECTOR2_LIST1[i], &vector1);
|
||||
bgc_vector2_copy_fp32(&_TEST_FP32_VECTOR2_LIST2[i], &vector2);
|
||||
bgc_fp32_vector2_copy(&_TEST_FP32_VECTOR2_LIST1[i], &vector1);
|
||||
bgc_fp32_vector2_copy(&_TEST_FP32_VECTOR2_LIST2[i], &vector2);
|
||||
|
||||
bgc_vector2_swap_fp32(&vector1, &vector2);
|
||||
bgc_fp32_vector2_swap(&vector1, &vector2);
|
||||
|
||||
if (vector1.x1 != _TEST_FP32_VECTOR2_LIST2[i].x1 ||
|
||||
vector1.x2 != _TEST_FP32_VECTOR2_LIST2[i].x2 ||
|
||||
|
|
@ -50,14 +50,14 @@ void test_vector2_swap_fp32()
|
|||
|
||||
static const int _TEST_FP64_VECTOR2_AMOUNT = 4;
|
||||
|
||||
static const BgcVector2FP64 _TEST_FP64_VECTOR2_LIST1[] = {
|
||||
static const BGC_FP64_Vector2 _TEST_FP64_VECTOR2_LIST1[] = {
|
||||
{ 1.0, 2.0 },
|
||||
{ -2.0, -1.0 },
|
||||
{ 100.0, -100.0 },
|
||||
{ -100.1, 100.2 }
|
||||
};
|
||||
|
||||
static const BgcVector2FP64 _TEST_FP64_VECTOR2_LIST2[] = {
|
||||
static const BGC_FP64_Vector2 _TEST_FP64_VECTOR2_LIST2[] = {
|
||||
{ 3.6, 5.3 },
|
||||
{ 204.07, -781.89 },
|
||||
{ -20.02, -1.0003 },
|
||||
|
|
@ -66,15 +66,15 @@ static const BgcVector2FP64 _TEST_FP64_VECTOR2_LIST2[] = {
|
|||
|
||||
void test_vector2_swap_fp64()
|
||||
{
|
||||
BgcVector2FP64 vector1, vector2;
|
||||
BGC_FP64_Vector2 vector1, vector2;
|
||||
|
||||
print_testing_name("bgc_vector2_swap_fp64");
|
||||
print_testing_name("bgc_fp64_vector2_swap");
|
||||
|
||||
for (int i = 0; i < _TEST_FP64_VECTOR2_AMOUNT; i++) {
|
||||
bgc_vector2_copy_fp64(&_TEST_FP64_VECTOR2_LIST1[i], &vector1);
|
||||
bgc_vector2_copy_fp64(&_TEST_FP64_VECTOR2_LIST2[i], &vector2);
|
||||
bgc_fp64_vector2_copy(&_TEST_FP64_VECTOR2_LIST1[i], &vector1);
|
||||
bgc_fp64_vector2_copy(&_TEST_FP64_VECTOR2_LIST2[i], &vector2);
|
||||
|
||||
bgc_vector2_swap_fp64(&vector1, &vector2);
|
||||
bgc_fp64_vector2_swap(&vector1, &vector2);
|
||||
|
||||
if (vector1.x1 != _TEST_FP64_VECTOR2_LIST2[i].x1 ||
|
||||
vector1.x2 != _TEST_FP64_VECTOR2_LIST2[i].x2 ||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue