Go to the documentation of this file.
23 #include "test_base64.h"
24 #include "test_cancellock.h"
25 #include "test_compression.h"
26 #include "test_inet_pton.h"
27 #include "test_regex.h"
28 #include "test_snprintf.h"
29 #include "test_strcasecmp_l.h"
30 #include "test_timestamp.h"
31 #include "test_unicode.h"
33 #include "compression.hxx"
48 #define CHECK_RV(rv) \
50 std::clog << std::flush; \
53 std::cout << "A problem was detected!" << std::endl << std::flush; \
55 else { std::cout << "OK" << std::endl << std::flush; } \
56 if(!res && rv) { res = rv; } \
61 #define SKIP_TEST(s) \
63 std::cout << "Skipped (" << s << ")" << std::endl << std::flush; \
79 static int first_error = 1;
101 std::clog << std::flush;
102 std::cout << std::flush;
106 std::cout <<
"Failed" << std::endl << std::flush;
110 std::clog <<
TEST_TAB << msg << std::endl << std::flush;
124 int main(
int argc,
char** argv)
126 int res = EXIT_SUCCESS;
133 std::cout <<
"Load configuration ... " << std::flush;
142 #if !CFG_CMPR_DISABLE
143 if(0 >
cmpr_init()) { res = EXIT_FAILURE; }
144 #endif // !CFG_CMPR_DISABLE
146 if(0 >
tls_init()) { res = EXIT_FAILURE; }
147 #endif // CFG_USE_TLS
150 if(EXIT_FAILURE == res)
152 std::clog <<
"Initialization of modules failed" << std::endl;
156 std::cout <<
"========================================"
157 "========================================" << std::endl;
161 std::cout <<
"Test 'posix_strcasecmp_l()' ... " << std::flush;
167 std::cout <<
"Test 'posix_snprintf()' ... " << std::flush;
173 std::cout <<
"Test 'posix_inet_pton()' ... " << std::flush;
179 std::cout <<
"Test 'posix_regcomp()' and 'posix_regexec()' ... "
181 #if CFG_USE_CLB || CFG_USE_XSI
184 #else // CFG_USE_CLB || CFG_USE_XSI
186 #endif // CFG_USE_CLB || CFG_USE_XSI
191 std::cout <<
"Test 'core_get_cancel_lock()' ... " << std::flush;
198 #endif // CFG_USE_TLS
202 std::cout <<
"Test 'cmpr_send()' and 'cmpr_recv()' ... " << std::flush;
203 #if !CFG_CMPR_DISABLE
204 # if CFG_USE_ZLIB && (CFG_USE_POSIX_API >= 200112 || CFG_USE_XSI)
207 # else // CFG_USE_ZLIB && (CFG_USE_POSIX_API >= 200112 || CFG_USE_XSI)
208 # if ! (CFG_USE_POSIX_API >= 200112 || CFG_USE_XSI)
209 SKIP_TEST(
"no POSIX.1-2001 or X/Open XSI");
210 # else // ! (CFG_USE_POSIX_API >= 200112 || CFG_USE_XSI)
212 # endif // ! (CFG_USE_POSIX_API >= 200112 || CFG_USE_XSI)
213 # endif // CFG_USE_ZLIB && (CFG_USE_POSIX_API >= 200112 || CFG_USE_XSI)
214 #else // ! CFG_CMPR_DISABLE
216 #endif // ! CFG_CMPR_DISABLE
220 std::cout <<
"Test 'enc_timestamp_decode()' ... " << std::flush;
226 std::cout <<
"Test 'enc_mime_encode_base64()' ... " << std::flush;
232 std::cout <<
"Test 'enc_convert_to_utf8_nfc()' ... " << std::flush;
236 std::cout <<
"========================================"
237 "========================================" << std::endl;
245 #endif // CFG_USE_TLS
248 #endif // CFG_USE_ZLIB
256 std::clog <<
"Error: One or more tests have failed!" << std::endl;
void tls_exit(void)
Shutdown TLS subsystem.
#define TEST_TAB
Tabulator to indent messages from test programs.
int test_base64(void)
Test enc_mime_encode_base64() implementation.
void ui_wakeup(unsigned int)
Wakeup callback (called by core thread after operation has finished)
void print_error(const char *msg)
Print error message.
void digest_exit(void)
Shutdown message digest module.
#define SKIP_TEST(s)
Skip test and print info message.
int test_unicode(void)
Test enc_convert_to_utf8_nfc() implementation.
const char * main_confprefix
Configuration directory path from command line option (always NULL )
struct conf config[CONF_NUM]
Global configuration.
int test_cancellock(void)
Test core_get_cancel_lock() implementation.
void hmac_exit(void)
Shutdown HMAC module.
int test_inet_pton(void)
Test posix_inet_pton() implementation.
void hmac_init(void)
Initialize HMAC module.
int test_snprintf(void)
Test posix_snprintf() implementation.
int tls_init(void)
Init TLS subsystem.
#define CHECK_RV(rv)
Check return value of test.
int main_debug
Enable additional debug output if nonzero.
void conf_delete(struct conf *cfg)
Delete configuration.
int test_timestamp(void)
Test enc_timestamp_decode() implementation.
void cmpr_exit(void)
Shutdown compress module.
int cmpr_init(void)
Initialize compression module.
int ts_unlock_ui(void)
Unlock UI thread.
int conf_load(struct conf *cfg)
Load configuration from config file.
int test_strcasecmp_l(void)
Test posix_strcasecmp_l() implementation.
int test_compression(void)
Test cmpr_send() and cmpr_recv() implementation.
int main(int argc, char **argv)
Test entry point.
void digest_init(void)
Initialize message digest module.
void ts_environ_exit(void)
Destroy copy of environment variables.
int ts_lock_ui(void)
Lock UI thread.
void ts_environ_init(void)
Copy environment variables.
int test_regex(void)
Test posix_regcomp() and posix_regexec() implementation.
Generated at 2024-04-27 using