From 078e21a1feb811f9ef7797ce3ee5d2e8ffcccfce Mon Sep 17 00:00:00 2001 From: nasr Date: Fri, 17 Apr 2026 17:49:10 +0200 Subject: feature(main): during my work on other projects I improved the base library a bit. this is a drag and drop of that in the project. the next steps exit out of implementing lineair regression and attempting to calcualte what the value would be of a key in the btree... Signed-off-by: nasr feature(main): during my work on other projects I improved the base library a bit. this is a drag and drop of that in the project. the next steps exit out of implementing lineair regression and attempting to calcualte what the value would be of a key in the btree... Signed-off-by: nasr --- source/base/base_test.h | 46 ---------------------------------------------- 1 file changed, 46 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 fd47abc..0000000 --- a/source/base/base_test.h +++ /dev/null @@ -1,46 +0,0 @@ -// TODO(nasr): metaprogram that takes an expected output and generates a test for that specified -// function -/* base library testing framework */ -#ifndef BASE_TEST_H -#define BASE_TEST_H - -// helper macro -#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 verify(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)); \ - } \ - } - -#endif /* BASE_TEST_H */ -- cgit v1.3