Реорганизация тестов (в процессе)
This commit is contained in:
parent
43bf030295
commit
fcf793c758
41 changed files with 252 additions and 314 deletions
|
|
@ -15,15 +15,11 @@ void print_testing_name(const char * name)
|
|||
|
||||
void print_testing_success()
|
||||
{
|
||||
printf("[ \x1b[32mSuccess\x1b[0m ]\n");
|
||||
puts("[ Success ]\n");
|
||||
}
|
||||
|
||||
void print_testing_failed()
|
||||
void print_testing_failed(const char* message)
|
||||
{
|
||||
printf("[ \x1b[31mFailed\x1b[0m ]\n");
|
||||
}
|
||||
|
||||
void print_testing_warning(const char * message)
|
||||
{
|
||||
printf(" Warning: \x1b[30m%s\x1b[0m\n", message);
|
||||
printf("[ Failed: %s ]\n", message);
|
||||
exit(TEST_FAILED);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
#include <basic-geometry.h>
|
||||
|
||||
#define TEST_SUCCES 0
|
||||
#define TEST_FAILED -1
|
||||
#define TEST_SUCCESS 0
|
||||
#define TEST_FAILED 1
|
||||
|
||||
void print_testing_section(const char * name);
|
||||
|
||||
|
|
@ -12,8 +12,6 @@ void print_testing_name(const char * name);
|
|||
|
||||
void print_testing_success();
|
||||
|
||||
void print_testing_failed();
|
||||
|
||||
void print_testing_warning(const char* message);
|
||||
void print_testing_failed(const char* message);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -9,30 +9,13 @@
|
|||
#include "tests/quaternion.h"
|
||||
#include "tests/versor.h"
|
||||
|
||||
#define PROGRAM_SUCCESS 0
|
||||
#define PROGRAM_FAILED 1
|
||||
|
||||
int main()
|
||||
{
|
||||
if (test_utilities() == TEST_FAILED) {
|
||||
return PROGRAM_FAILED;
|
||||
}
|
||||
test_utilities();
|
||||
test_vector2();
|
||||
test_vector3();
|
||||
test_quaternion();
|
||||
test_versor();
|
||||
|
||||
if (test_vector2() == TEST_FAILED) {
|
||||
return PROGRAM_FAILED;
|
||||
}
|
||||
|
||||
if (test_vector3() == TEST_FAILED) {
|
||||
return PROGRAM_FAILED;
|
||||
}
|
||||
|
||||
if (test_quaternion() == TEST_FAILED) {
|
||||
return PROGRAM_FAILED;
|
||||
}
|
||||
|
||||
if (test_versor() == TEST_FAILED) {
|
||||
return PROGRAM_FAILED;
|
||||
}
|
||||
|
||||
return PROGRAM_SUCCESS;
|
||||
return TEST_SUCCESS;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,33 +4,33 @@ int test_quaternion()
|
|||
{
|
||||
print_testing_section("BGC Quaternion");
|
||||
|
||||
if (test_quaternion_reset() != TEST_SUCCES) {
|
||||
if (test_quaternion_reset() != TEST_SUCCESS) {
|
||||
return TEST_FAILED;
|
||||
}
|
||||
|
||||
if (test_quaternion_set_to_identity() != TEST_SUCCES) {
|
||||
if (test_quaternion_set_to_identity() != TEST_SUCCESS) {
|
||||
return TEST_FAILED;
|
||||
}
|
||||
|
||||
if (test_quaternion_set_values() != TEST_SUCCES) {
|
||||