Реорганизация тестов (в процессе)

This commit is contained in:
Andrey Pokidov 2025-02-13 01:20:29 +07:00
parent 43bf030295
commit fcf793c758
41 changed files with 252 additions and 314 deletions

View file

@ -15,15 +15,11 @@ void print_testing_name(const char * name)
void print_testing_success() 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"); printf("[ Failed: %s ]\n", message);
} exit(TEST_FAILED);
void print_testing_warning(const char * message)
{
printf(" Warning: \x1b[30m%s\x1b[0m\n", message);
} }

View file

@ -3,8 +3,8 @@
#include <basic-geometry.h> #include <basic-geometry.h>
#define TEST_SUCCES 0 #define TEST_SUCCESS 0
#define TEST_FAILED -1 #define TEST_FAILED 1
void print_testing_section(const char * name); 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_success();
void print_testing_failed(); void print_testing_failed(const char* message);
void print_testing_warning(const char* message);
#endif #endif

View file

@ -9,30 +9,13 @@
#include "tests/quaternion.h" #include "tests/quaternion.h"
#include "tests/versor.h" #include "tests/versor.h"
#define PROGRAM_SUCCESS 0
#define PROGRAM_FAILED 1
int main() int main()
{ {
if (test_utilities() == TEST_FAILED) { test_utilities();
return PROGRAM_FAILED; test_vector2();
} test_vector3();
test_quaternion();
test_versor();
if (test_vector2() == TEST_FAILED) { return TEST_SUCCESS;
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;
} }

View file

Internal server error - Personal Git Server: Beyond coding. We Forge.

500

Internal server error

Forgejo version: 11.0.1+gitea-1.22.0

@ -4,33 +4,33 @@ int test_quaternion()
{ {
print_testing_section("BGC Quaternion"); print_testing_section("BGC Quaternion");
if (test_quaternion_reset() != TEST_SUCCES) { if (test_quaternion_reset() != TEST_SUCCESS) {
return TEST_FAILED; return TEST_FAILED;
} }