Упрощение тестов
This commit is contained in:
parent
fcf793c758
commit
7f242c4b63
71 changed files with 518 additions and 943 deletions
|
@ -33,29 +33,27 @@ static const BgcQuaternionFP32 _TEST_FP32_NONZERO_QUATERION_LIST[] = {
|
|||
{ -1.25f * BGC_EPSYLON_FP32, -1.25f * BGC_EPSYLON_FP32, 0.0f, 0.0f }
|
||||
};
|
||||
|
||||
int test_quaternion_is_zero_fp32()
|
||||
void test_quaternion_is_zero_fp32()
|
||||
{
|
||||
print_testing_name("bgc_quaternion_is_zero_fp32");
|
||||
|
||||
// Testing zero values:
|
||||
for (int i = 0; i < _TEST_FP32_ZERO_QUATERNION_AMOUNT; i++) {
|
||||
if (!bgc_quaternion_is_zero_fp32(&_TEST_FP32_ZERO_QUATERNION_LIST[i])) {
|
||||
print_testing_failed();
|
||||
return TEST_FAILED;
|
||||
print_testing_error("A zero quaternion was not recognized");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Testing non-zero values:
|
||||
for (int i = 0; i < _TEST_FP32_NONZERO_QUATERNION_AMOUNT; i++) {
|
||||
if (bgc_quaternion_is_zero_fp32(&_TEST_FP32_NONZERO_QUATERION_LIST[i])) {
|
||||
print_testing_failed();
|
||||
return TEST_FAILED;
|
||||
print_testing_error("A non-zero quaternion was recognized as a zero quaternion");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
print_testing_success();
|
||||
|
||||
return TEST_SUCCESS;
|
||||
}
|
||||
|
||||
// ==================== FP64 ==================== //
|
||||
|
@ -89,40 +87,31 @@ static const BgcQuaternionFP64 _TEST_FP64_NONZERO_QUATERION_LIST[] = {
|
|||
{ -1.25 * BGC_EPSYLON_FP64, -1.25 * BGC_EPSYLON_FP64, 0.0, 0.0 }
|
||||
};
|
||||
|
||||
int test_quaternion_is_zero_fp64()
|
||||
void test_quaternion_is_zero_fp64()
|
||||
{
|
||||
print_testing_name("bgc_quaternion_is_zero_fp64");
|
||||
|
||||
// Testing zero values:
|
||||
for (int i = 0; i < _TEST_FP64_ZERO_QUATERNION_AMOUNT; i++) {
|
||||
if (!bgc_quaternion_is_zero_fp64(&_TEST_FP64_ZERO_QUATERNION_LIST[i])) {
|
||||
print_testing_failed();
|
||||
return TEST_FAILED;
|
||||
print_testing_error("A zero quaternion was not recognized");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Testing non-zero values:
|
||||
for (int i = 0; i < _TEST_FP64_NONZERO_QUATERNION_AMOUNT; i++) {
|
||||
if (bgc_quaternion_is_zero_fp64(&_TEST_FP64_NONZERO_QUATERION_LIST[i])) {
|
||||
print_testing_failed();
|
||||
return TEST_FAILED;
|
||||
print_testing_error("A non-zero quaternion was recognized as a zero quaternion");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
print_testing_success();
|
||||
|
||||
return TEST_SUCCESS;
|
||||
}
|
||||
|
||||
int test_quaternion_is_zero()
|
||||
void test_quaternion_is_zero()
|
||||
{
|
||||
if (test_quaternion_is_zero_fp32() != TEST_SUCCESS) {
|
||||
return TEST_FAILED;
|
||||
}
|
||||
|
||||
if (test_quaternion_is_zero_fp64() != TEST_SUCCESS) {
|
||||
return TEST_FAILED;
|
||||
}
|
||||
|
||||
return TEST_SUCCESS;
|
||||
test_quaternion_is_zero_fp32();
|
||||
test_quaternion_is_zero_fp64();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue