Переход на версию 0.3: изменение подхода к именованию сущностей, добавление, изменение и удаление ряда функций
This commit is contained in:
parent
d33daf4e2d
commit
f7e41645fe
87 changed files with 4580 additions and 4051 deletions
|
|
@ -9,24 +9,24 @@ static const int _TEST_FP32_NONUNIT_NUMBERS_AMOUNT = 4;
|
|||
|
||||
static const float _TEST_FP32_UNIT_NUMBERS[] = {
|
||||
1.0f,
|
||||
1.0f + 0.75f * BGC_EPSYLON_FP32,
|
||||
1.0f - 0.75f * BGC_EPSYLON_FP32
|
||||
1.0f + 0.75f * BGC_FP32_EPSYLON,
|
||||
1.0f - 0.75f * BGC_FP32_EPSYLON
|
||||
};
|
||||
|
||||
static const float _TEST_FP32_NONUNIT_NUMBERS[] = {
|
||||
0.0f,
|
||||
-1.0f,
|
||||
1.0f + 1.25f * BGC_EPSYLON_FP32,
|
||||
1.0f - 1.25f * BGC_EPSYLON_FP32
|
||||
1.0f + 1.25f * BGC_FP32_EPSYLON,
|
||||
1.0f - 1.25f * BGC_FP32_EPSYLON
|
||||
};
|
||||
|
||||
void test_is_unit_fp32()
|
||||
{
|
||||
print_testing_name("bgc_is_unit_fp32");
|
||||
print_testing_name("bgc_fp32_is_unit");
|
||||
|
||||
// Testing unit values:
|
||||
for (int i = 0; i < _TEST_FP32_UNIT_NUMBERS_AMOUNT; i++) {
|
||||
if (!bgc_is_unit_fp32(_TEST_FP32_UNIT_NUMBERS[i])) {
|
||||
if (!bgc_fp32_is_unit(_TEST_FP32_UNIT_NUMBERS[i])) {
|
||||
print_testing_error("A unit value was not recognized");
|
||||
return;
|
||||
}
|
||||
|
|
@ -34,7 +34,7 @@ void test_is_unit_fp32()
|
|||
|
||||
// Testing non-unit values:
|
||||
for (int i = 0; i < _TEST_FP32_NONUNIT_NUMBERS_AMOUNT; i++) {
|
||||
if (bgc_is_unit_fp32(_TEST_FP32_NONUNIT_NUMBERS[i])) {
|
||||
if (bgc_fp32_is_unit(_TEST_FP32_NONUNIT_NUMBERS[i])) {
|
||||
print_testing_error("A non-unit value was recognized as a unit value");
|
||||
return;
|
||||
}
|
||||
|
|
@ -50,24 +50,24 @@ static const int _TEST_FP64_NONUNIT_NUMBERS_AMOUNT = 4;
|
|||
|
||||
static const double _TEST_FP64_UNIT_NUMBERS[] = {
|
||||
1.0,
|
||||
1.0 + 0.75 * BGC_EPSYLON_FP64,
|
||||
1.0 - 0.75 * BGC_EPSYLON_FP64
|
||||
1.0 + 0.75 * BGC_FP64_EPSYLON,
|
||||
1.0 - 0.75 * BGC_FP64_EPSYLON
|
||||
};
|
||||
|
||||
static const double _TEST_FP64_NONUNIT_NUMBERS[] = {
|
||||
0.0,
|
||||
-1.0,
|
||||
1.0 + 1.25 * BGC_EPSYLON_FP64,
|
||||
1.0 - 1.25 * BGC_EPSYLON_FP64
|
||||
1.0 + 1.25 * BGC_FP64_EPSYLON,
|
||||
1.0 - 1.25 * BGC_FP64_EPSYLON
|
||||
};
|
||||
|
||||
void test_is_unit_fp64()
|
||||
{
|
||||
print_testing_name("bgc_is_unit_fp64");
|
||||
print_testing_name("bgc_fp64_is_unit");
|
||||
|
||||
// Testing unit values:
|
||||
for (int i = 0; i < _TEST_FP64_UNIT_NUMBERS_AMOUNT; i++) {
|
||||
if (!bgc_is_unit_fp64(_TEST_FP64_UNIT_NUMBERS[i])) {
|
||||
if (!bgc_fp64_is_unit(_TEST_FP64_UNIT_NUMBERS[i])) {
|
||||
print_testing_error("A unit value was not recognized");
|
||||
return;
|
||||
}
|
||||
|
|
@ -75,7 +75,7 @@ void test_is_unit_fp64()
|
|||
|
||||
// Testing non-unit values:
|
||||
for (int i = 0; i < _TEST_FP64_NONUNIT_NUMBERS_AMOUNT; i++) {
|
||||
if (bgc_is_unit_fp64(_TEST_FP64_NONUNIT_NUMBERS[i])) {
|
||||
if (bgc_fp64_is_unit(_TEST_FP64_NONUNIT_NUMBERS[i])) {
|
||||
print_testing_error("A non-unit value was recognized as a unit value");
|
||||
return;
|
||||
}
|
||||
|
|
@ -91,24 +91,24 @@ static const int _TEST_FP32_DATA_SQUARE_NONUNIT_AMOUNT = 4;
|
|||
|
||||
static const float _TEST_FP32_DATA_SQUARE_UNIT[] = {
|
||||
1.0f,
|
||||
1.0f + 1.75f * BGC_EPSYLON_FP32,
|
||||
1.0f - 1.75f * BGC_EPSYLON_FP32
|
||||
1.0f + 1.75f * BGC_FP32_EPSYLON,
|
||||
1.0f - 1.75f * BGC_FP32_EPSYLON
|
||||
};
|
||||
|
||||
static const float _TEST_FP32_DATA_SQUARE_NONUNIT[] = {
|
||||
0.0f,
|
||||
-1.0f,
|
||||
1.0f + 2.25f * BGC_EPSYLON_FP32,
|
||||
1.0f - 2.25f * BGC_EPSYLON_FP32
|
||||
1.0f + 2.25f * BGC_FP32_EPSYLON,
|
||||
1.0f - 2.25f * BGC_FP32_EPSYLON
|
||||
};
|
||||
|
||||
void test_is_sqare_unit_fp32()
|
||||
void test_is_square_unit_fp32()
|
||||
{
|
||||
print_testing_name("bgc_is_sqare_unit_fp32");
|
||||
print_testing_name("bgc_fp32_is_square_unit");
|
||||
|
||||
// Testing unit values:
|
||||
for (int i = 0; i < _TEST_FP32_DATA_SQUARE_UNIT_AMOUNT; i++) {
|
||||
if (!bgc_is_sqare_unit_fp32(_TEST_FP32_DATA_SQUARE_UNIT[i])) {
|
||||
if (!bgc_fp32_is_square_unit(_TEST_FP32_DATA_SQUARE_UNIT[i])) {
|
||||
print_testing_error("A square unit value was not recognized");
|
||||
return;
|
||||
}
|
||||
|
|
@ -116,7 +116,7 @@ void test_is_sqare_unit_fp32()
|
|||
|
||||
// Testing non-unit values:
|
||||
for (int i = 0; i < _TEST_FP32_DATA_SQUARE_NONUNIT_AMOUNT; i++) {
|
||||
if (bgc_is_sqare_unit_fp32(_TEST_FP32_DATA_SQUARE_NONUNIT[i])) {
|
||||
if (bgc_fp32_is_square_unit(_TEST_FP32_DATA_SQUARE_NONUNIT[i])) {
|
||||
print_testing_error("A non-unit value was recognized as a square unit value");
|
||||
return;
|
||||
}
|
||||
|
|
@ -132,24 +132,24 @@ static const int _TEST_FP64_DATA_SQUARE_NONUNIT_AMOUNT = 4;
|
|||
|
||||
static const double _TEST_FP64_DATA_SQUARE_UNIT[] = {
|
||||
1.0,
|
||||
1.0 + 1.75 * BGC_EPSYLON_FP64,
|
||||
1.0 - 1.75 * BGC_EPSYLON_FP64
|
||||
1.0 + 1.75 * BGC_FP64_EPSYLON,
|
||||
1.0 - 1.75 * BGC_FP64_EPSYLON
|
||||
};
|
||||
|
||||
static const double _TEST_FP64_DATA_SQUARE_NONUNIT[] = {
|
||||
0.0,
|
||||
-1.0,
|
||||
1.0 + 2.25 * BGC_EPSYLON_FP64,
|
||||
1.0 - 2.25 * BGC_EPSYLON_FP64
|
||||
1.0 + 2.25 * BGC_FP64_EPSYLON,
|
||||
1.0 - 2.25 * BGC_FP64_EPSYLON
|
||||
};
|
||||
|
||||
void test_is_sqare_unit_fp64()
|
||||
void test_is_square_unit_fp64()
|
||||
{
|
||||
print_testing_name("bgc_is_sqare_unit_fp64");
|
||||
print_testing_name("bgc_fp64_is_square_unit");
|
||||
|
||||
// Testing unit values:
|
||||
for (int i = 0; i < _TEST_FP64_DATA_SQUARE_UNIT_AMOUNT; i++) {
|
||||
if (!bgc_is_sqare_unit_fp64(_TEST_FP64_DATA_SQUARE_UNIT[i])) {
|
||||
if (!bgc_fp64_is_square_unit(_TEST_FP64_DATA_SQUARE_UNIT[i])) {
|
||||
print_testing_error("A square unit value was not recognized");
|
||||
return;
|
||||
}
|
||||
|
|
@ -157,7 +157,7 @@ void test_is_sqare_unit_fp64()
|
|||
|
||||
// Testing non-unit values:
|
||||
for (int i = 0; i < _TEST_FP64_DATA_SQUARE_NONUNIT_AMOUNT; i++) {
|
||||
if (bgc_is_sqare_unit_fp64(_TEST_FP64_DATA_SQUARE_NONUNIT[i])) {
|
||||
if (bgc_fp64_is_square_unit(_TEST_FP64_DATA_SQUARE_NONUNIT[i])) {
|
||||
print_testing_error("A non-unit value was recognized as a square unit value");
|
||||
return;
|
||||
}
|
||||
|
|
@ -171,6 +171,6 @@ void test_is_unit()
|
|||
test_is_unit_fp32();
|
||||
test_is_unit_fp64();
|
||||
|
||||
test_is_sqare_unit_fp32();
|
||||
test_is_sqare_unit_fp64();
|
||||
test_is_square_unit_fp32();
|
||||
test_is_square_unit_fp64();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue