33#ifndef _SIR_TESTS_H_INCLUDED
34# define _SIR_TESTS_H_INCLUDED
36# include "tests_shared.h"
37# include "sir/filecache.h"
38# include "sir/textstyle.h"
39# include "sir/mutex.h"
40# include "sir/threadpool.h"
41# include "sir/queue.h"
323# if defined(SIR_OS_LOG_ENABLED)
324void os_log_parent_activity(
void* ctx);
325void os_log_child_activity(
void* ctx);
332# define INIT_BASE(var, l_stdout, o_stdout, l_stderr, o_stderr, p_name, init) \
334 var.d_stdout.opts = (o_stdout) > 0 ? (o_stdout) : SIRO_DEFAULT; \
335 var.d_stdout.levels = (l_stdout); \
336 var.d_stderr.opts = (o_stderr) > 0 ? (o_stderr) : SIRO_DEFAULT; \
337 var.d_stderr.levels = (l_stderr); \
338 if (_sir_validstrnofail(p_name)) \
339 (void)_sir_strncpy(var.name, SIR_MAXNAME, (p_name), SIR_MAXNAME); \
340 bool var##_init = false; \
342 var##_init = sir_init(&var); \
346# define INIT_N(var, l_stdout, o_stdout, l_stderr, o_stderr, name) \
347 INIT_BASE(var, l_stdout, o_stdout, l_stderr, o_stderr, name, true)
349# define INIT_SL(var, l_stdout, o_stdout, l_stderr, o_stderr, name) \
350 INIT_BASE(var, l_stdout, o_stdout, l_stderr, o_stderr, name, false)
352# define INIT(var, l_stdout, o_stdout, l_stderr, o_stderr) \
353 INIT_N(var, l_stdout, o_stdout, l_stderr, o_stderr, "")
360bool filter_error(
bool pass, uint16_t err);
365char* get_wineversion(
void);
370bool roll_and_archive(
const char* filename,
const char* extension);
bool sirtest_textstylesanity(void)
Properly style stdio output for each level, and handle style overrides.
Definition tests.c:773
bool sirtest_rollandarchivefile(void)
Properly roll/archive a file when it hits max size.
Definition tests.c:587
bool sirtest_pluginloader(void)
Ensure that well-formed, valid plugins are successfully loaded, and that ill-formed/incorrectly behav...
Definition tests.c:1893
bool sirtest_errorsanity(void)
Properly return valid codes and messages for all possible errors.
Definition tests.c:697
bool sirtest_failinvalidinitdata(void)
Properly handle initialization with junk memory.
Definition tests.c:640
bool sirtest_win_eventlog(void)
Properly open, configure, and send messages to the Windows event log.
Definition tests.c:1535
bool sirtest_faildupefile(void)
Properly refuse to add a duplicate file.
Definition tests.c:504
bool sirtest_squelchspam(void)
Ensure that spam messages are squelched, normal messages are not, and proper return values result fro...
Definition tests.c:1815
bool sirtest_getversioninfo(void)
Ensure that version retrieval exports are functioning properly.
Definition tests.c:2117
bool sirtest_levelssanity(void)
Properly reject invalid level bitmasks.
Definition tests.c:1002
bool sirtest_filecachesanity(void)
Properly handle adding and removing log files.
Definition tests.c:389
bool sirtest_failwithoutinit(void)
Properly handle calls without initialization.
Definition tests.c:596
bool sirtest_os_log(void)
Properly open, configure, and send messages to os_log().
Definition tests.c:1520
bool sirtest_getcpucount(void)
Ensure the processor counting routines are functioning properly.
Definition tests.c:2102
bool sirtest_perf(void)
Performance evaluation.
Definition tests.c:1158
bool sirtest_failremovebadfile(void)
Properly refuse to remove a file that isn't added.
Definition tests.c:573
bool sirtest_stringutils(void)
Ensure the string utility routines are functioning properly.
Definition tests.c:2023
bool sirtest_mutexsanity(void)
Ensure that the mutex implementation is functioning properly.
Definition tests.c:1096
bool sirtest_isinitialized(void)
Definition tests.c:605
bool sirtest_failinvalidfilename(void)
Properly handle invalid log file name.
Definition tests.c:463
bool sirtest_syslog(void)
Properly open, configure, and send messages to syslog().
Definition tests.c:1505
bool sirtest_failfilebadpermission(void)
Properly handle log file without appropriate permissions.
Definition tests.c:476
bool sirtest_exceedmaxsize(void)
Properly handle messages that exceed internal buffer sizes.
Definition tests.c:161
bool sirtest_failnooutputdest(void)
Properly handle the lack of any output destinations.
Definition tests.c:320
bool sirtest_threadpool(void)
Ensure the proper functioning of the thread pool and job queue mech- anisms.
Definition tests.c:2157
bool sirtest_initcleanupinit(void)
Properly handle initialization, cleanup, re-initialization.
Definition tests.c:656
bool sirtest_filesystem(void)
Ensure the proper functionality of portable filesystem implementation.
Definition tests.c:1550
bool sirtest_initmakeinit(void)
Properly initialize using sir_makeinit.
Definition tests.c:672
bool sirtest_failaftercleanup(void)
Properly handle calls after cleanup.
Definition tests.c:684
bool sirtest_optionssanity(void)
Properly reject invalid option bitmasks.
Definition tests.c:893
bool sirtest_threadrace(void)
Properly handle multiple threads competing for locked sections.
Definition tests.c:2200
bool sirtest_logwritesanity(void)
Ensure the correct (and complete) message is written to a log file.
Definition tests.c:175
bool sirtest_failnulls(void)
Properly handle null/empty input.
Definition tests.c:350
bool sirtest_updatesanity(void)
Properly update levels/options at runtime.
Definition tests.c:1260
bool sirtest_failinittwice(void)
Properly handle two initialization calls without corresponding cleanup.
Definition tests.c:626
bool sirtest_failemptymessage(void)
Ensure an empty message is properly handled.
Definition tests.c:379
bool sirtest_threadidsanity(void)
Properly format thread ID/names in output.
Definition tests.c:235