fix: hemar & hectic: nothing
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -298,6 +298,48 @@ char* raise_message(LogLevel level, const char *file, const char *func, int line
|
||||
#define PRECOMPILED_LOG_LEVEL LOG_LEVEL_TRACE // default level
|
||||
#endif
|
||||
|
||||
#if PRECOMPILED_LOG_LEVEL > LOG_LEVEL_TRACE
|
||||
#define raise_trace__(...) ((void)0) // log removed at compile time
|
||||
#else
|
||||
#define raise_trace__(file, func, line, ...) raise_message(LOG_LEVEL_TRACE, file, func, line, ##__VA_ARGS__)
|
||||
#endif
|
||||
|
||||
#if PRECOMPILED_LOG_LEVEL > LOG_LEVEL_DEBUG
|
||||
#define raise_debug__(...) ((void)0)
|
||||
#else
|
||||
#define raise_debug__(file, func, line, ...) raise_message(LOG_LEVEL_DEBUG, file, func, line, ##__VA_ARGS__)
|
||||
#endif
|
||||
|
||||
#if PRECOMPILED_LOG_LEVEL > LOG_LEVEL_LOG
|
||||
#define raise_log__(...) ((void)0)
|
||||
#else
|
||||
#define raise_log__(file, func, line, ...) raise_message(LOG_LEVEL_LOG, file, func, line, ##__VA_ARGS__)
|
||||
#endif
|
||||
|
||||
#if PRECOMPILED_LOG_LEVEL > LOG_LEVEL_INFO
|
||||
#define raise_info__(...) ((void)0)
|
||||
#else
|
||||
#define raise_info__(file, func, line, ...) raise_message(LOG_LEVEL_INFO, file, func, line, ##__VA_ARGS__)
|
||||
#endif
|
||||
|
||||
#if PRECOMPILED_LOG_LEVEL > LOG_LEVEL_NOTICE
|
||||
#define raise_notice__(...) ((void)0)
|
||||
#else
|
||||
#define raise_notice__(file, func, line, ...) raise_message(LOG_LEVEL_NOTICE, file, func, line, ##__VA_ARGS__)
|
||||
#endif
|
||||
|
||||
#if PRECOMPILED_LOG_LEVEL > LOG_LEVEL_WARN
|
||||
#define raise_warn__(...) ((void)0)
|
||||
#else
|
||||
#define raise_warn__(file, func, line, ...) raise_message(LOG_LEVEL_WARN, file, func, line, ##__VA_ARGS__)
|
||||
#endif
|
||||
|
||||
#if PRECOMPILED_LOG_LEVEL > LOG_LEVEL_EXCEPTION
|
||||
#define raise_exception__(...) ((void)0)
|
||||
#else
|
||||
#define raise_exception__(fine, func, line, ...) raise_message(LOG_LEVEL_EXCEPTION, file, func, line, ##__VA_ARGS__)
|
||||
#endif
|
||||
|
||||
#if PRECOMPILED_LOG_LEVEL > LOG_LEVEL_TRACE
|
||||
#define raise_trace(...) ((void)0) // log removed at compile time
|
||||
#else
|
||||
|
||||
@@ -171,6 +171,19 @@ static void simplest_test_template_parse(Arena *arena, TemplateConfig *config) {
|
||||
"]") == 0);
|
||||
}
|
||||
|
||||
static void simplest_interpolation_that_crash_db_test_template_parse(Arena *arena, TemplateConfig *config) {
|
||||
const char *template_str = "zalupa {% her %} davalka";
|
||||
|
||||
template_parse(arena, &template_str, config);
|
||||
arena_reset(arena);
|
||||
template_parse(arena, &template_str, config);
|
||||
template_parse(arena, &template_str, config);
|
||||
arena_reset(arena);
|
||||
template_parse(arena, &template_str, config);
|
||||
template_parse(arena, &template_str, config);
|
||||
template_parse(arena, &template_str, config);
|
||||
}
|
||||
|
||||
static void simplest_interpolation_test_template_parse(Arena *arena, TemplateConfig *config) {
|
||||
const char *template_str = "{% name %} {% name2 %}";
|
||||
|
||||
@@ -345,12 +358,16 @@ int main(void) {
|
||||
printf("%sTest 3: simplest_interpolation_test_template_parse passed%s\n", OPTIONAL_COLOR(COLOR_GREEN), OPTIONAL_COLOR(COLOR_RESET));
|
||||
arena_reset(&arena);
|
||||
|
||||
simplest_interpolation_that_crash_db_test_template_parse(&arena, &config);
|
||||
printf("%sTest 4: simplest_interpolation_that_crash_db_test_template_parse passed%s\n", OPTIONAL_COLOR(COLOR_GREEN), OPTIONAL_COLOR(COLOR_RESET));
|
||||
arena_reset(&arena);
|
||||
|
||||
simplest_separator_test_template_parse(&arena, &config);
|
||||
printf("%sTest 4: simplest_separator_test_template_parse passed%s\n", OPTIONAL_COLOR(COLOR_GREEN), OPTIONAL_COLOR(COLOR_RESET));
|
||||
printf("%sTest 5: simplest_separator_test_template_parse passed%s\n", OPTIONAL_COLOR(COLOR_GREEN), OPTIONAL_COLOR(COLOR_RESET));
|
||||
arena_reset(&arena);
|
||||
|
||||
simplest_execute_test_template_parse(&arena, &config);
|
||||
printf("%sTest 5: simplest_execute_test_template_parse passed%s\n", OPTIONAL_COLOR(COLOR_GREEN), OPTIONAL_COLOR(COLOR_RESET));
|
||||
printf("%sTest 6: simplest_execute_test_template_parse passed%s\n", OPTIONAL_COLOR(COLOR_GREEN), OPTIONAL_COLOR(COLOR_RESET));
|
||||
arena_reset(&arena);
|
||||
|
||||
logger_free();
|
||||
|
||||
Reference in New Issue
Block a user