Переход на версию 0.3: изменение подхода к именованию сущностей, добавление, изменение и удаление ряда функций
This commit is contained in:
parent
d33daf4e2d
commit
f7e41645fe
87 changed files with 4580 additions and 4051 deletions
|
|
@ -7,35 +7,35 @@
|
|||
static const int _TEST_FP32_ZERO_VECTOR3_AMOUNT = 7;
|
||||
static const int _TEST_FP32_NONZERO_VECTOR3_AMOUNT = 9;
|
||||
|
||||
static const BgcVector3FP32 _TEST_FP32_ZERO_VECTOR3_LIST[] = {
|
||||
static const BGC_FP32_Vector3 _TEST_FP32_ZERO_VECTOR3_LIST[] = {
|
||||
{ 0.0f, 0.0f, 0.0f },
|
||||
{ 0.75f * BGC_EPSYLON_FP32, 0.0f, 0.0f },
|
||||
{ -0.75f * BGC_EPSYLON_FP32, 0.0f, 0.0f },
|
||||
{ 0.0f, 0.75f * BGC_EPSYLON_FP32, 0.0f },
|
||||
{ 0.0f, -0.75f * BGC_EPSYLON_FP32, 0.0f },
|
||||
{ 0.0f, 0.0f, 0.75f * BGC_EPSYLON_FP32 },
|
||||
{ 0.0f, 0.0f, -0.75f * BGC_EPSYLON_FP32 }
|
||||
{ 0.75f * BGC_FP32_EPSYLON, 0.0f, 0.0f },
|
||||
{ -0.75f * BGC_FP32_EPSYLON, 0.0f, 0.0f },
|
||||
{ 0.0f, 0.75f * BGC_FP32_EPSYLON, 0.0f },
|
||||
{ 0.0f, -0.75f * BGC_FP32_EPSYLON, 0.0f },
|
||||
{ 0.0f, 0.0f, 0.75f * BGC_FP32_EPSYLON },
|
||||
{ 0.0f, 0.0f, -0.75f * BGC_FP32_EPSYLON }
|
||||
};
|
||||
|
||||
static const BgcVector3FP32 _TEST_FP32_NONZERO_VECTOR3_LIST[] = {
|
||||
static const BGC_FP32_Vector3 _TEST_FP32_NONZERO_VECTOR3_LIST[] = {
|
||||
{ 0.0f, 1.0f, 0.0f },
|
||||
{ 1.25f * BGC_EPSYLON_FP32, 0.0f, 0.0f },
|
||||
{ -1.25f * BGC_EPSYLON_FP32, 0.0f, 0.0f },
|
||||
{ 0.0f, 1.25f * BGC_EPSYLON_FP32, 0.0f },
|
||||
{ 0.0f, -1.25f * BGC_EPSYLON_FP32, 0.0f },
|
||||
{ 0.0f, 0.0f, 1.25f * BGC_EPSYLON_FP32 },
|
||||
{ 0.0f, 0.0f, -1.25f * BGC_EPSYLON_FP32 },
|
||||
{ 1.25f * BGC_EPSYLON_FP32, 1.25f * BGC_EPSYLON_FP32, 0.0f },
|
||||
{ -1.25f * BGC_EPSYLON_FP32, -1.25f * BGC_EPSYLON_FP32, 0.0f }
|
||||
{ 1.25f * BGC_FP32_EPSYLON, 0.0f, 0.0f },
|
||||
{ -1.25f * BGC_FP32_EPSYLON, 0.0f, 0.0f },
|
||||
{ 0.0f, 1.25f * BGC_FP32_EPSYLON, 0.0f },
|
||||
{ 0.0f, -1.25f * BGC_FP32_EPSYLON, 0.0f },
|
||||
{ 0.0f, 0.0f, 1.25f * BGC_FP32_EPSYLON },
|
||||
{ 0.0f, 0.0f, -1.25f * BGC_FP32_EPSYLON },
|
||||
{ 1.25f * BGC_FP32_EPSYLON, 1.25f * BGC_FP32_EPSYLON, 0.0f },
|
||||
{ -1.25f * BGC_FP32_EPSYLON, -1.25f * BGC_FP32_EPSYLON, 0.0f }
|
||||
};
|
||||
|
||||
void test_vector3_is_zero_fp32()
|
||||
{
|
||||
print_testing_name("bgc_vector3_is_zero_fp32");
|
||||
print_testing_name("bgc_fp32_vector3_is_zero");
|
||||
|
||||
// Testing zero values:
|
||||
for (int i = 0; i < _TEST_FP32_ZERO_VECTOR3_AMOUNT; i++) {
|
||||
if (!bgc_vector3_is_zero_fp32(&_TEST_FP32_ZERO_VECTOR3_LIST[i])) {
|
||||
if (!bgc_fp32_vector3_is_zero(&_TEST_FP32_ZERO_VECTOR3_LIST[i])) {
|
||||
print_testing_error("A zero vector was not recongized");
|
||||
return;
|
||||
}
|
||||
|
|
@ -43,7 +43,7 @@ void test_vector3_is_zero_fp32()
|
|||
|
||||
// Testing non-zero values:
|
||||
for (int i = 0; i < _TEST_FP32_NONZERO_VECTOR3_AMOUNT; i++) {
|
||||
if (bgc_vector3_is_zero_fp32(&_TEST_FP32_NONZERO_VECTOR3_LIST[i])) {
|
||||
if (bgc_fp32_vector3_is_zero(&_TEST_FP32_NONZERO_VECTOR3_LIST[i])) {
|
||||
print_testing_error("A non-zero vector was recongized as a zero vector");
|
||||
return;
|
||||
}
|
||||
|
|
@ -57,35 +57,35 @@ void test_vector3_is_zero_fp32()
|
|||
static const int _TEST_FP64_ZERO_VECTOR3_AMOUNT = 7;
|
||||
static const int _TEST_FP64_NONZERO_VECTOR3_AMOUNT = 9;
|
||||
|
||||
static const BgcVector3FP64 _TEST_FP64_ZERO_VECTOR3_LIST[] = {
|
||||
static const BGC_FP64_Vector3 _TEST_FP64_ZERO_VECTOR3_LIST[] = {
|
||||
{ 0.0, 0.0, 0.0 },
|
||||
{ 0.75 * BGC_EPSYLON_FP64, 0.0, 0.0 },
|
||||
{ -0.75 * BGC_EPSYLON_FP64, 0.0, 0.0 },
|
||||
{ 0.0, 0.75 * BGC_EPSYLON_FP64, 0.0 },
|
||||
{ 0.0, -0.75 * BGC_EPSYLON_FP64, 0.0 },
|
||||
{ 0.0, 0.0, 0.75 * BGC_EPSYLON_FP64 },
|
||||
{ 0.0, 0.0, -0.75 * BGC_EPSYLON_FP64 }
|
||||
{ 0.75 * BGC_FP64_EPSYLON, 0.0, 0.0 },
|
||||
{ -0.75 * BGC_FP64_EPSYLON, 0.0, 0.0 },
|
||||
{ 0.0, 0.75 * BGC_FP64_EPSYLON, 0.0 },
|
||||
{ 0.0, -0.75 * BGC_FP64_EPSYLON, 0.0 },
|
||||
{ 0.0, 0.0, 0.75 * BGC_FP64_EPSYLON },
|
||||
{ 0.0, 0.0, -0.75 * BGC_FP64_EPSYLON }
|
||||
};
|
||||
|
||||
static const BgcVector3FP64 _TEST_FP64_NONZERO_VECTOR3_LIST[] = {
|
||||
static const BGC_FP64_Vector3 _TEST_FP64_NONZERO_VECTOR3_LIST[] = {
|
||||
{ 0.0, 1.0, 0.0 },
|
||||
{ 1.25 * BGC_EPSYLON_FP64, 0.0, 0.0 },
|
||||
{ -1.25 * BGC_EPSYLON_FP64, 0.0, 0.0 },
|
||||
{ 0.0, 1.25 * BGC_EPSYLON_FP64, 0.0 },
|
||||
{ 0.0, -1.25 * BGC_EPSYLON_FP64, 0.0 },
|
||||
{ 0.0, 0.0, 1.25 * BGC_EPSYLON_FP64 },
|
||||
{ 0.0, 0.0, -1.25 * BGC_EPSYLON_FP64 },
|
||||
{ 1.25 * BGC_EPSYLON_FP64, 1.25 * BGC_EPSYLON_FP64, 0.0 },
|
||||
{ -BGC_EPSYLON_FP64, -BGC_EPSYLON_FP64, 0.0 }
|
||||
{ 1.25 * BGC_FP64_EPSYLON, 0.0, 0.0 },
|
||||
{ -1.25 * BGC_FP64_EPSYLON, 0.0, 0.0 },
|
||||
{ 0.0, 1.25 * BGC_FP64_EPSYLON, 0.0 },
|
||||
{ 0.0, -1.25 * BGC_FP64_EPSYLON, 0.0 },
|
||||
{ 0.0, 0.0, 1.25 * BGC_FP64_EPSYLON },
|
||||
{ 0.0, 0.0, -1.25 * BGC_FP64_EPSYLON },
|
||||
{ 1.25 * BGC_FP64_EPSYLON, 1.25 * BGC_FP64_EPSYLON, 0.0 },
|
||||
{ -BGC_FP64_EPSYLON, -BGC_FP64_EPSYLON, 0.0 }
|
||||
};
|
||||
|
||||
void test_vector3_is_zero_fp64()
|
||||
{
|
||||
print_testing_name("bgc_vector3_is_zero_fp64");
|
||||
print_testing_name("bgc_fp64_vector3_is_zero");
|
||||
|
||||
// Testing zero values:
|
||||
for (int i = 0; i < _TEST_FP64_ZERO_VECTOR3_AMOUNT; i++) {
|
||||
if (!bgc_vector3_is_zero_fp64(&_TEST_FP64_ZERO_VECTOR3_LIST[i])) {
|
||||
if (!bgc_fp64_vector3_is_zero(&_TEST_FP64_ZERO_VECTOR3_LIST[i])) {
|
||||
print_testing_error("A zero vector was not recongized");
|
||||
return;
|
||||
}
|
||||
|
|
@ -93,7 +93,7 @@ void test_vector3_is_zero_fp64()
|
|||
|
||||
// Testing non-zero values:
|
||||
for (int i = 0; i < _TEST_FP64_NONZERO_VECTOR3_AMOUNT; i++) {
|
||||
if (bgc_vector3_is_zero_fp64(&_TEST_FP64_NONZERO_VECTOR3_LIST[i])) {
|
||||
if (bgc_fp64_vector3_is_zero(&_TEST_FP64_NONZERO_VECTOR3_LIST[i])) {
|
||||
print_testing_error("A non-zero vector was recongized as a zero vector");
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue