Упрощение тестов
This commit is contained in:
parent
fcf793c758
commit
7f242c4b63
71 changed files with 518 additions and 943 deletions
|
@ -14,14 +14,14 @@ static const BgcQuaternionFP32 _TEST_FP32_QUATERNION_LIST[] = {
|
|||
{ 0.001f, -100.0f, 100.0f, -0.001f }
|
||||
};
|
||||
|
||||
int test_quaternion_copy_fp32()
|
||||
void test_quaternion_copy_fp32()
|
||||
{
|
||||
BgcQuaternionFP32 vector;
|
||||
|
||||
print_testing_name("bgc_quaternion_copy_fp32");
|
||||
|
||||
for (int i = 0; i < _TEST_FP32_QUATERNION_AMOUNT; i++) {
|
||||
|
||||
|
||||
bgc_quaternion_copy_fp32(&_TEST_FP32_QUATERNION_LIST[i], &vector);
|
||||
|
||||
if (vector.s0 != _TEST_FP32_QUATERNION_LIST[i].s0 ||
|
||||
|
@ -29,13 +29,11 @@ int test_quaternion_copy_fp32()
|
|||
vector.x2 != _TEST_FP32_QUATERNION_LIST[i].x2 ||
|
||||
vector.x3 != _TEST_FP32_QUATERNION_LIST[i].x3) {
|
||||
print_testing_failed();
|
||||
return TEST_FAILED;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
print_testing_success();
|
||||
|
||||
return TEST_SUCCESS;
|
||||
}
|
||||
|
||||
// ==================== FP64 ==================== //
|
||||
|
@ -48,7 +46,7 @@ static const BgcQuaternionFP64 _TEST_FP64_QUATERNION_LIST[] = {
|
|||
{ 0.001, -100.0, 100.0, -0.001 }
|
||||
};
|
||||
|
||||
int test_quaternion_copy_fp64()
|
||||
void test_quaternion_copy_fp64()
|
||||
{
|
||||
BgcQuaternionFP64 vector;
|
||||
|
||||
|
@ -63,24 +61,15 @@ int test_quaternion_copy_fp64()
|
|||
vector.x2 != _TEST_FP64_QUATERNION_LIST[i].x2 ||
|
||||
vector.x3 != _TEST_FP64_QUATERNION_LIST[i].x3) {
|
||||
print_testing_failed();
|
||||
return TEST_FAILED;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
print_testing_success();
|
||||
|
||||
return TEST_SUCCESS;
|
||||
}
|
||||
|
||||
int test_quaternion_copy()
|
||||
void test_quaternion_copy()
|
||||
{
|
||||
if (test_quaternion_copy_fp32() != TEST_SUCCESS) {
|
||||
return TEST_FAILED;
|
||||
}
|
||||
|
||||
if (test_quaternion_copy_fp64() != TEST_SUCCESS) {
|
||||
return TEST_FAILED;
|
||||
}
|
||||
|
||||
return TEST_SUCCESS;
|
||||
test_quaternion_copy_fp32();
|
||||
test_quaternion_copy_fp64();
|
||||
}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#ifndef _TEST_QUATERNION_COPY_H_
|
||||
#define _TEST_QUATERNION_COPY_H_
|
||||
|
||||
int test_quaternion_copy_fp32();
|
||||
void test_quaternion_copy_fp32();
|
||||
|
||||
int test_quaternion_copy_fp64();
|
||||
void test_quaternion_copy_fp64();
|
||||
|
||||
int test_quaternion_copy();
|
||||
void test_quaternion_copy();
|
||||
|
||||
#endif
|
||||
|
|
|
@ -39,29 +39,27 @@ static const BgcQuaternionFP32 _TEST_FP32_NONUNIT_QUATERION_LIST[] = {
|
|||
{ 0.5f - 1.25f * BGC_EPSYLON_FP32, 0.5f - 1.25f * BGC_EPSYLON_FP32, 0.0f, 0.5f }
|
||||
};
|
||||
|
||||
int test_quaternion_is_unit_fp32()
|
||||
void test_quaternion_is_unit_fp32()
|
||||
{
|
||||
print_testing_name("bgc_quaternion_is_unit_fp32");
|
||||
|
||||
// Testing zero values:
|
||||
for (int i = 0; i < _TEST_FP32_UNIT_QUATERNION_AMOUNT; i++) {
|
||||
if (!bgc_quaternion_is_unit_fp32(&_TEST_FP32_UNIT_QUATERNION_LIST[i])) {
|
||||
print_testing_failed();
|
||||
return TEST_FAILED;
|
||||
print_testing_error("A unit quaternion was not recognized");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Testing non-zero values:
|
||||
for (int i = 0; i < _TEST_FP32_NONUNIT_QUATERNION_AMOUNT; i++) {
|
||||
if (bgc_quaternion_is_unit_fp32(&_TEST_FP32_NONUNIT_QUATERION_LIST[i])) {
|
||||
print_testing_failed();
|
||||
return TEST_FAILED;
|
||||
print_testing_error("A non-unit quaternion was recognized a unit quaternion");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
print_testing_success();
|
||||
|
||||
return TEST_SUCCESS;
|
||||
}
|
||||
|
||||
// ==================== FP64 ==================== //
|
||||
|
@ -101,40 +99,31 @@ static const BgcQuaternionFP64 _TEST_FP64_NONUNIT_QUATERION_LIST[] = {
|
|||
{ 0.5 - 1.25 * BGC_EPSYLON_FP64, 0.5 - 1.25 * BGC_EPSYLON_FP64, 0.0, 0.5 }
|
||||
};
|
||||
|
||||
int test_quaternion_is_unit_fp64()
|
||||
void test_quaternion_is_unit_fp64()
|
||||
{
|
||||
print_testing_name("bgc_quaternion_is_unit_fp64");
|
||||
|
||||
// Testing zero values:
|
||||
for (int i = 0; i < _TEST_FP64_UNIT_QUATERNION_AMOUNT; i++) {
|
||||
if (!bgc_quaternion_is_unit_fp64(&_TEST_FP64_UNIT_QUATERNION_LIST[i])) {
|
||||
print_testing_failed();
|
||||
return TEST_FAILED;
|
||||
print_testing_error("A unit quaternion was not recognized");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Testing non-zero values:
|
||||
for (int i = 0; i < _TEST_FP64_NONUNIT_QUATERNION_AMOUNT; i++) {
|
||||
if (bgc_quaternion_is_unit_fp64(&_TEST_FP64_NONUNIT_QUATERION_LIST[i])) {
|
||||
print_testing_failed();
|
||||
return TEST_FAILED;
|
||||
print_testing_error("A non-unit quaternion was recognized a unit quaternion");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
print_testing_success();
|
||||
|
||||
return TEST_SUCCESS;
|
||||
}
|
||||
|
||||
int test_quaternion_is_unit()
|
||||
void test_quaternion_is_unit()
|
||||
{
|
||||
if (test_quaternion_is_unit_fp32() != TEST_SUCCESS) {
|
||||
return TEST_FAILED;
|
||||
}
|
||||
|
||||
if (test_quaternion_is_unit_fp64() != TEST_SUCCESS) {
|
||||
return TEST_FAILED;
|
||||
}
|
||||
|
||||
return TEST_SUCCESS;
|
||||
test_quaternion_is_unit_fp32();
|
||||
test_quaternion_is_unit_fp64();
|
||||
}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#ifndef _TEST_QUATERNION_IS_UNIT_H_
|
||||
#define _TEST_QUATERNION_IS_UNIT_H_
|
||||
|
||||
int test_quaternion_is_unit_fp32();
|
||||
void test_quaternion_is_unit_fp32();
|
||||
|
||||
int test_quaternion_is_unit_fp64();
|
||||
void test_quaternion_is_unit_fp64();
|
||||
|
||||
int test_quaternion_is_unit();
|
||||
void test_quaternion_is_unit();
|
||||
|
||||
#endif
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#ifndef _TEST_QUATERNION_IS_ZERO_H_
|
||||
#define _TEST_QUATERNION_IS_ZERO_H_
|
||||
|
||||
int test_quaternion_is_zero_fp32();
|
||||
void test_quaternion_is_zero_fp32();
|
||||
|
||||
int test_quaternion_is_zero_fp64();
|
||||
void test_quaternion_is_zero_fp64();
|
||||
|
||||
int test_quaternion_is_zero();
|
||||
void test_quaternion_is_zero();
|
||||
|
||||
#endif
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#include "./../../helpers.h"
|
||||
|
||||
int test_quaternion_reset_fp32()
|
||||
void test_quaternion_reset_fp32()
|
||||
{
|
||||
BgcQuaternionFP32 vector;
|
||||
|
||||
|
@ -12,15 +12,13 @@ int test_quaternion_reset_fp32()
|
|||
|
||||
if (vector.s0 != 0.0f || vector.x1 != 0.0f || vector.x2 != 0.0f || vector.x3 != 0.0f) {
|
||||
print_testing_failed();
|
||||
return TEST_FAILED;
|
||||
return;
|
||||
}
|
||||
|
||||
print_testing_success();
|
||||
|
||||
return TEST_SUCCESS;
|
||||
}
|
||||
|
||||
int test_quaternion_reset_fp64()
|
||||
void test_quaternion_reset_fp64()
|
||||
{
|
||||
BgcQuaternionFP64 vector;
|
||||
|
||||
|
@ -30,23 +28,14 @@ int test_quaternion_reset_fp64()
|
|||
|
||||
if (vector.s0 != 0.0 || vector.x1 != 0.0 || vector.x2 != 0.0 || vector.x3 != 0.0) {
|
||||
print_testing_failed();
|
||||
return TEST_FAILED;
|
||||
return;
|
||||
}
|
||||
|
||||
print_testing_success();
|
||||
|
||||
return TEST_SUCCESS;
|
||||
}
|
||||
|
||||
int test_quaternion_reset()
|
||||
void test_quaternion_reset()
|
||||
{
|
||||
if (test_quaternion_reset_fp32() != TEST_SUCCESS) {
|
||||
return TEST_FAILED;
|
||||
}
|
||||
|
||||
if (test_quaternion_reset_fp64() != TEST_SUCCESS) {
|
||||
return TEST_FAILED;
|
||||
}
|
||||
|
||||
return TEST_SUCCESS;
|
||||
test_quaternion_reset_fp32();
|
||||
test_quaternion_reset_fp64();
|
||||
}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#ifndef _TEST_QUATERNION_RESET_H_
|
||||
#define _TEST_QUATERNION_RESET_H_
|
||||
|
||||
int test_quaternion_reset_fp32();
|
||||
void test_quaternion_reset_fp32();
|
||||
|
||||
int test_quaternion_reset_fp64();
|
||||
void test_quaternion_reset_fp64();
|
||||
|
||||
int test_quaternion_reset();
|
||||
void test_quaternion_reset();
|
||||
|
||||
#endif
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#include "./../../helpers.h"
|
||||
|
||||
int test_quaternion_set_to_identity_fp32()
|
||||
void test_quaternion_set_to_identity_fp32()
|
||||
{
|
||||
BgcQuaternionFP32 vector;
|
||||
|
||||
|
@ -12,15 +12,13 @@ int test_quaternion_set_to_identity_fp32()
|
|||
|
||||
if (vector.s0 != 1.0f || vector.x1 != 0.0f || vector.x2 != 0.0f || vector.x3 != 0.0f) {
|
||||
print_testing_failed();
|
||||
return TEST_FAILED;
|
||||
return;
|
||||
}
|
||||
|
||||
print_testing_success();
|
||||
|
||||
return TEST_SUCCESS;
|
||||
}
|
||||
|
||||
int test_quaternion_set_to_identity_fp64()
|
||||
void test_quaternion_set_to_identity_fp64()
|
||||
{
|
||||
BgcQuaternionFP64 vector;
|
||||
|
||||
|
@ -30,23 +28,14 @@ int test_quaternion_set_to_identity_fp64()
|
|||
|
||||
if (vector.s0 != 1.0 || vector.x1 != 0.0 || vector.x2 != 0.0 || vector.x3 != 0.0) {
|
||||
print_testing_failed();
|
||||
return TEST_FAILED;
|
||||
return;
|
||||
}
|
||||
|
||||
print_testing_success();
|
||||
|
||||
return TEST_SUCCESS;
|
||||
}
|
||||
|
||||
int test_quaternion_set_to_identity()
|
||||
void test_quaternion_set_to_identity()
|
||||
{
|
||||
if (test_quaternion_set_to_identity_fp32() != TEST_SUCCESS) {
|
||||
return TEST_FAILED;
|
||||
}
|
||||
|
||||
if (test_quaternion_set_to_identity_fp64() != TEST_SUCCESS) {
|
||||
return TEST_FAILED;
|
||||
}
|
||||
|
||||
return TEST_SUCCESS;
|
||||
test_quaternion_set_to_identity_fp32();
|
||||
test_quaternion_set_to_identity_fp64();
|
||||
}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#ifndef _TEST_QUATERNION_SET_TO_IDENTITY_H_
|
||||
#define _TEST_QUATERNION_SET_TO_IDENTITY_H_
|
||||
|
||||
int test_quaternion_set_to_identity_fp32();
|
||||
void test_quaternion_set_to_identity_fp32();
|
||||
|
||||
int test_quaternion_set_to_identity_fp64();
|
||||
void test_quaternion_set_to_identity_fp64();
|
||||
|
||||
int test_quaternion_set_to_identity();
|
||||
void test_quaternion_set_to_identity();
|
||||
|
||||
#endif
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
// ==================== FP32 ==================== //
|
||||
|
||||
int test_quaternion_set_values_fp32()
|
||||
void test_quaternion_set_values_fp32()
|
||||
{
|
||||
BgcQuaternionFP32 vector;
|
||||
|
||||
|
@ -15,32 +15,30 @@ int test_quaternion_set_values_fp32()
|
|||
bgc_quaternion_set_values_fp32(1.0f, 2.0f, 3.0f, 4.0f, &vector);
|
||||
|
||||
if (vector.s0 != 1.0f || vector.x1 != 2.0f || vector.x2 != 3.0f || vector.x3 != 4.0f) {
|
||||
print_testing_failed();
|
||||
return TEST_FAILED;
|
||||
print_testing_error("First step failed");
|
||||
return;
|
||||
}
|
||||
|
||||
bgc_quaternion_set_values_fp32(-1.0f, -3.0f, -5.0f, -7.0f, &vector);
|
||||
|
||||
if (vector.s0 != -1.0f || vector.x1 != -3.0f || vector.x2 != -5.0f || vector.x3 != -7.0f) {
|
||||
print_testing_failed();
|
||||
return TEST_FAILED;
|
||||
print_testing_error("Second step failed");
|
||||
return;
|
||||
}
|
||||
|
||||
bgc_quaternion_set_values_fp32(-8.0f, -2.0f, 2.0f, 4.0f, &vector);
|
||||
|
||||
if (vector.s0 != -8.0f || vector.x1 != -2.0f || vector.x2 != 2.0f || vector.x3 != 4.0f) {
|
||||
print_testing_failed();
|
||||
return TEST_FAILED;
|
||||
print_testing_error("Third step failed");
|
||||
return;
|
||||
}
|
||||
|
||||
print_testing_success();
|
||||
|
||||
return TEST_SUCCESS;
|
||||
}
|
||||
|
||||
// ==================== FP64 ==================== //
|
||||
|
||||
int test_quaternion_set_values_fp64()
|
||||
void test_quaternion_set_values_fp64()
|
||||
{
|
||||
BgcQuaternionFP64 vector;
|
||||
|
||||
|
@ -49,38 +47,29 @@ int test_quaternion_set_values_fp64()
|
|||
bgc_quaternion_set_values_fp64(1.0, 2.0, 3.0, 4.0, &vector);
|
||||
|
||||
if (vector.s0 != 1.0 || vector.x1 != 2.0 || vector.x2 != 3.0 || vector.x3 != 4.0) {
|
||||
print_testing_failed();
|
||||
return TEST_FAILED;
|
||||
print_testing_error("First step failed");
|
||||
return;
|
||||
}
|
||||
|
||||
bgc_quaternion_set_values_fp64(-1.0, -3.0, -5.0, -7.0, &vector);
|
||||
|
||||
if (vector.s0 != -1.0 || vector.x1 != -3.0 || vector.x2 != -5.0 || vector.x3 != -7.0) {
|
||||
print_testing_failed();
|
||||
return TEST_FAILED;
|
||||
print_testing_error("Second step failed");
|
||||
return;
|
||||
}
|
||||
|
||||
bgc_quaternion_set_values_fp64(-8.0, -2.0, 2.0, 4.0, &vector);
|
||||
|
||||
if (vector.s0 != -8.0 || vector.x1 != -2.0 || vector.x2 != 2.0 || vector.x3 != 4.0) {
|
||||
print_testing_failed();
|
||||
return TEST_FAILED;
|
||||
print_testing_error("Third step failed");
|
||||
return;
|
||||
}
|
||||
|
||||
print_testing_success();
|
||||
|
||||
return TEST_SUCCESS;
|
||||
}
|
||||
|
||||
int test_quaternion_set_values()
|
||||
void test_quaternion_set_values()
|
||||
{
|
||||
if (test_quaternion_set_values_fp32() != TEST_SUCCESS) {
|
||||
return TEST_FAILED;
|
||||
}
|
||||
|
||||
if (test_quaternion_set_values_fp64() != TEST_SUCCESS) {
|
||||
return TEST_FAILED;
|
||||
}
|
||||
|
||||
return TEST_SUCCESS;
|
||||
test_quaternion_set_values_fp32();
|
||||
test_quaternion_set_values_fp64();
|
||||
}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#ifndef _TEST_QUATERNION_SET_VALUES_H_
|
||||
#define _TEST_QUATERNION_SET_VALUES_H_
|
||||
|
||||
int test_quaternion_set_values_fp32();
|
||||
void test_quaternion_set_values_fp32();
|
||||
|
||||
int test_quaternion_set_values_fp64();
|
||||
void test_quaternion_set_values_fp64();
|
||||
|
||||
int test_quaternion_set_values();
|
||||
void test_quaternion_set_values();
|
||||
|
||||
#endif
|
||||
|
|
|
@ -2,33 +2,22 @@
|
|||
|
||||
#include "./../../helpers.h"
|
||||
|
||||
int test_quaternion_square_modulus_fp32()
|
||||
void test_quaternion_square_modulus_fp32()
|
||||
{
|
||||
print_testing_name("bgc_quaternion_is_zero_fp32");
|
||||
|
||||
print_testing_success();
|
||||
|
||||
return TEST_SUCCES;
|
||||
}
|
||||
|
||||
int test_quaternion_square_modulus_fp64()
|
||||
void test_quaternion_square_modulus_fp64()
|
||||
{
|
||||
print_testing_name("bgc_quaternion_is_zero_fp64");
|
||||
|
||||
print_testing_success();
|
||||
|
||||
return TEST_SUCCES;
|
||||
}
|
||||
|
||||
int test_quaternion_square_modulus()
|
||||
void test_quaternion_square_modulus()
|
||||
{
|
||||
if (test_quaternion_square_modulus_fp32() != TEST_SUCCES) {
|
||||
return TEST_FAILED;
|
||||
}
|
||||
|
||||
if (test_quaternion_square_modulus_fp64() != TEST_SUCCES) {
|
||||
return TEST_FAILED;
|
||||
}
|
||||
|
||||
return TEST_SUCCES;
|
||||
test_quaternion_square_modulus_fp32();
|
||||
test_quaternion_square_modulus_fp64();
|
||||
}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#ifndef _TEST_QUATERNION_SQUARE_MODULUS_H_
|
||||
#define _TEST_QUATERNION_SQUARE_MODULUS_H_
|
||||
|
||||
int test_quaternion_square_modulus_fp32();
|
||||
void test_quaternion_square_modulus_fp32();
|
||||
|
||||
int test_quaternion_square_modulus_fp64();
|
||||
void test_quaternion_square_modulus_fp64();
|
||||
|
||||
int test_quaternion_square_modulus();
|
||||
void test_quaternion_square_modulus();
|
||||
|
||||
#endif
|
||||
|
|
|
@ -22,7 +22,7 @@ static const BgcQuaternionFP32 _TEST_FP32_QUATERNION_LIST2[] = {
|
|||
{ 1000.0f, -0.00025f, -0.419f, 0.844f }
|
||||
};
|
||||
|
||||
int test_quaternion_swap_fp32()
|
||||
void test_quaternion_swap_fp32()
|
||||
{
|
||||
BgcQuaternionFP32 quaternion1, quaternion2;
|
||||
|
||||
|
@ -43,13 +43,11 @@ int test_quaternion_swap_fp32()
|
|||
quaternion2.x2 != _TEST_FP32_QUATERNION_LIST1[i].x2 ||
|
||||
quaternion2.x3 != _TEST_FP32_QUATERNION_LIST1[i].x3) {
|
||||
print_testing_failed();
|
||||
return TEST_FAILED;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
print_testing_success();
|
||||
|
||||
return TEST_SUCCESS;
|
||||
}
|
||||
|
||||
// ==================== FP64 ==================== //
|
||||
|
@ -70,7 +68,7 @@ static const BgcQuaternionFP64 _TEST_FP64_QUATERNION_LIST2[] = {
|
|||
{ 1000.0, -0.00025, -0.419, 0.844 }
|
||||
};
|
||||
|
||||
int test_quaternion_swap_fp64()
|
||||
void test_quaternion_swap_fp64()
|
||||
{
|
||||
BgcQuaternionFP64 quaternion1, quaternion2;
|
||||
|
||||
|
@ -91,24 +89,15 @@ int test_quaternion_swap_fp64()
|
|||
quaternion2.x2 != _TEST_FP64_QUATERNION_LIST1[i].x2 ||
|
||||
quaternion2.x3 != _TEST_FP64_QUATERNION_LIST1[i].x3) {
|
||||
print_testing_failed();
|
||||
return TEST_FAILED;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
print_testing_success();
|
||||
|
||||
return TEST_SUCCESS;
|
||||
}
|
||||
|
||||
int test_quaternion_swap()
|
||||
void test_quaternion_swap()
|
||||
{
|
||||
if (test_quaternion_swap_fp32() != TEST_SUCCESS) {
|
||||
return TEST_FAILED;
|
||||
}
|
||||
|
||||
if (test_quaternion_swap_fp64() != TEST_SUCCESS) {
|
||||
return TEST_FAILED;
|
||||
}
|
||||
|
||||
return TEST_SUCCESS;
|
||||
test_quaternion_swap_fp32();
|
||||
test_quaternion_swap_fp64();
|
||||
}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#ifndef _TEST_QUATERNION_SWAP_H_
|
||||
#define _TEST_QUATERNION_SWAP_H_
|
||||
|
||||
int test_quaternion_swap_fp32();
|
||||
void test_quaternion_swap_fp32();
|
||||
|
||||
int test_quaternion_swap_fp64();
|
||||
void test_quaternion_swap_fp64();
|
||||
|
||||
int test_quaternion_swap();
|
||||
void test_quaternion_swap();
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue