From 8ea6a3c8621287d11296b8300029f32a27743d9a Mon Sep 17 00:00:00 2001 From: nasr Date: Thu, 16 Apr 2026 17:10:02 +0200 Subject: feature(checkpoint): checkpoint cleaning up base library --- source/base/base_test.h | 61 ------------------------------------------------- 1 file changed, 61 deletions(-) delete mode 100644 source/base/base_test.h (limited to 'source/base/base_test.h') diff --git a/source/base/base_test.h b/source/base/base_test.h deleted file mode 100644 index 11028f4..0000000 --- a/source/base/base_test.h +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef BASE_TEST_H -#define BASE_TEST_H - -void -write_int(i32 num); - -#define RED "\x1b[31m" -#define GREEN "\x1b[32m" -#define RESET "\x1b[0m" -#define BLUE "\x1b[34m" - -#define LEN(s) (sizeof(s) - 1) - -#define show \ - do \ - { \ - write(STDOUT_FILENO, __FILE__, sizeof(__FILE__) - 1); \ - write(STDOUT_FILENO, ":", 1); \ - write(STDOUT_FILENO, __func__, sizeof(__func__) - 1); \ - write(STDOUT_FILENO, ":", 1); \ - write_int(__LINE__); \ - write(STDOUT_FILENO, "\n", 1); \ - } while (0) - -#define test(expr) \ - { \ - if ((expr) != 0) \ - { \ - write(STDERR_FILENO, "[FAILED] ", LEN("[FAILED] ")); \ - show; \ - _exit(1); \ - } \ - } - -#define check(expr) \ - { \ - if ((expr) != 0) \ - { \ - write(STDERR_FILENO, RED "[ERROR] ", LEN(RED "[ERROR] ")); \ - show; \ - write(STDERR_FILENO, RESET, LEN(RESET)); \ - _exit(1); \ - } \ - else \ - { \ - write(STDERR_FILENO, GREEN "[SUCCESS] ", LEN(GREEN "[SUCCESS] ")); \ - show; \ - write(STDERR_FILENO, RESET, LEN(RESET)); \ - } \ - } - -#define checkpoint_output "<>\n" -#define checkpoint_end_output "^^^^^^^^^^^^^^\n\n\n" -#define checkpoint \ - { \ - write(STDERR_FILENO, BLUE checkpoint_output, LEN(BLUE checkpoint_output)); \ - show; \ - write(STDERR_FILENO, BLUE checkpoint_end_output, LEN(BLUE checkpoint_end_output)); \ - } - -#endif /* BASE_TEST_H */ -- cgit v1.3