smtp-client
SMTP Client C Library
|
Test seams for the smtp-client library. More...
#include "test.h"
Go to the source code of this file.
Test seams for the smtp-client library.
Used by the smtp-client testing framework to inject specific return values by some standard library functions. This makes it possible to test less common errors like out of memory conditions and input/output errors.
This software has been placed into the public domain using CC0.
Definition in file seams.h.
#define BIO_new_socket smtp_test_seam_bio_new_socket |
Redefine this function from smtp.c and inject a test seam which can control when this function fails.
See smtp_test_seam_bio_new_socket.
Definition at line 57 of file seams.h.
Referenced by smtp_test_seam_bio_new_socket(), and smtp_tls_init().
#define BIO_should_retry smtp_test_seam_bio_should_retry |
Redefine this function from smtp.c and inject a test seam which can control when this function fails.
See smtp_test_seam_bio_should_retry.
Definition at line 65 of file seams.h.
Referenced by smtp_str_getdelimfd_read(), and smtp_test_seam_bio_should_retry().
#define calloc smtp_test_seam_calloc |
Redefine this function from smtp.c and inject a test seam which can control when this function fails.
Definition at line 73 of file seams.h.
Referenced by smtp_base64_decode(), smtp_base64_encode(), smtp_chunk_split(), smtp_open(), smtp_str_getdelimfd_set_line_and_buf(), and smtp_test_seam_calloc().
#define close smtp_test_seam_close |
Redefine this function from smtp.c and inject a test seam which can control when this function fails.
See smtp_test_seam_close.
Definition at line 81 of file seams.h.
Referenced by smtp_close(), smtp_connect(), and smtp_test_seam_close().
#define connect smtp_test_seam_connect |
Redefine this function from smtp.c and inject a test seam which can control when this function fails.
Definition at line 89 of file seams.h.
Referenced by smtp_connect(), and smtp_test_seam_connect().
#define ERR_peek_error smtp_test_seam_err_peek_error |
Redefine this function from smtp.c and inject a test seam which can control when this function fails.
See smtp_test_seam_err_peek_error.
Definition at line 97 of file seams.h.
Referenced by smtp_test_seam_err_peek_error(), and smtp_tls_init().
#define fclose smtp_test_seam_fclose |
Redefine this function from smtp.c and inject a test seam which can control when this function fails.
Definition at line 105 of file seams.h.
Referenced by load_test_email(), smtp_file_get_contents(), smtp_file_put_contents(), smtp_func_test_attachment_fp(), smtp_test_seam_fclose(), smtp_unit_test_str_getdelimfd(), and test_failure_attachment_add().
#define ferror smtp_test_seam_ferror |
Redefine this function from smtp.c and inject a test seam which can control when this function fails.
Definition at line 113 of file seams.h.
Referenced by load_test_email(), smtp_ffile_get_contents(), and smtp_test_seam_ferror().
#define gmtime_r smtp_test_seam_gmtime_r |
Redefine this function from smtp.c and inject a test seam which can control when this function fails.
Definition at line 121 of file seams.h.
Referenced by smtp_date_rfc_2822(), and smtp_test_seam_gmtime_r().
#define HMAC smtp_test_seam_hmac |
Redefine this function from smtp.c and inject a test seam which can control when this function fails.
See smtp_test_seam_hmac.
Definition at line 129 of file seams.h.
Referenced by smtp_auth_cram_md5(), and smtp_test_seam_hmac().
#define localtime_r smtp_test_seam_localtime_r |
Redefine this function from smtp.c and inject a test seam which can control when this function fails.
See smtp_test_seam_localtime_r.
Definition at line 137 of file seams.h.
Referenced by smtp_date_rfc_2822(), and smtp_test_seam_localtime_r().
#define malloc smtp_test_seam_malloc |
Redefine this function from smtp.c and inject a test seam which can control when this function fails.
Definition at line 145 of file seams.h.
Referenced by smtp_auth_cram_md5(), smtp_auth_login(), smtp_auth_plain(), smtp_bin2hex(), smtp_mail_envelope_header(), smtp_print_header(), smtp_print_mime_attachment(), smtp_print_mime_header_and_body(), smtp_puts_terminate(), smtp_str_repeat(), smtp_strdup(), smtp_strndup(), smtp_test_seam_malloc(), and smtp_unit_test_stpcpy().
#define mktime smtp_test_seam_mktime |
Redefine this function from smtp.c and inject a test seam which can control when this function fails.
Definition at line 153 of file seams.h.
Referenced by smtp_date_rfc_2822(), and smtp_test_seam_mktime().
#define realloc smtp_test_seam_realloc |
Redefine this function from smtp.c and inject a test seam which can control when this function fails.
Definition at line 161 of file seams.h.
Referenced by mailx_address_append(), mailx_append_attachment(), smtp_append_address_to_header(), smtp_ffile_get_contents(), smtp_fold_whitespace(), smtp_reallocarray(), smtp_str_getdelimfd(), smtp_str_list_append(), smtp_str_replace(), smtp_test_config_load_from_file(), and smtp_test_seam_realloc().
#define recv smtp_test_seam_recv |
Redefine this function from smtp.c and inject a test seam which can control when this function fails.
See smtp_test_seam_recv.
Definition at line 169 of file seams.h.
Referenced by smtp_str_getdelimfd_read(), and smtp_test_seam_recv().
#define select smtp_test_seam_select |
Redefine this function from smtp.c and inject a test seam which can control when this function fails.
Definition at line 177 of file seams.h.
Referenced by smtp_str_getdelimfd_read_timeout(), and smtp_test_seam_select().
#define send smtp_test_seam_send |
Redefine this function from smtp.c and inject a test seam which can control when this function fails.
See smtp_test_seam_send.
Definition at line 185 of file seams.h.
Referenced by smtp_test_seam_send(), and smtp_write().
#define socket smtp_test_seam_socket |
Redefine this function from smtp.c and inject a test seam which can control when this function fails.
Definition at line 193 of file seams.h.
Referenced by smtp_connect(), and smtp_test_seam_socket().
#define sprintf smtp_test_seam_sprintf |
Redefine this function from smtp.c and inject a test seam which can control when this function fails.
Definition at line 265 of file seams.h.
Referenced by smtp_bin2hex(), smtp_date_rfc_2822(), smtp_func_test_attachment_mem(), smtp_func_test_attachment_pdf(), smtp_func_test_auth(), and smtp_func_test_connection_security().
#define SSL_connect smtp_test_seam_ssl_connect |
Redefine this function from smtp.c and inject a test seam which can control when this function fails.
See smtp_test_seam_ssl_connect.
Definition at line 201 of file seams.h.
Referenced by smtp_test_seam_ssl_connect(), and smtp_tls_init().
#define SSL_CTX_new smtp_test_seam_ssl_ctx_new |
Redefine this function from smtp.c and inject a test seam which can control when this function fails.
See smtp_test_seam_ssl_ctx_new.
Definition at line 209 of file seams.h.
Referenced by smtp_test_seam_ssl_ctx_new(), and smtp_tls_init().
#define SSL_do_handshake smtp_test_seam_ssl_do_handshake |
Redefine this function from smtp.c and inject a test seam which can control when this function fails.
See smtp_test_seam_ssl_do_handshake.
Definition at line 217 of file seams.h.
Referenced by smtp_test_seam_ssl_do_handshake(), and smtp_tls_init().
#define SSL_get_peer_certificate smtp_test_seam_ssl_get_peer_certificate |
Redefine this function from smtp.c and inject a test seam which can control when this function fails.
See smtp_test_seam_ssl_get_peer_certificate.
Definition at line 225 of file seams.h.
Referenced by smtp_test_seam_ssl_get_peer_certificate(), and smtp_tls_init().
#define SSL_new smtp_test_seam_ssl_new |
Redefine this function from smtp.c and inject a test seam which can control when this function fails.
Definition at line 241 of file seams.h.
Referenced by smtp_test_seam_ssl_new(), and smtp_tls_init().
#define SSL_read smtp_test_seam_ssl_read |
Redefine this function from smtp.c and inject a test seam which can control when this function fails.
Definition at line 249 of file seams.h.
Referenced by smtp_str_getdelimfd_read(), and smtp_test_seam_ssl_read().
#define SSL_write smtp_test_seam_ssl_write |
Redefine this function from smtp.c and inject a test seam which can control when this function fails.
Definition at line 257 of file seams.h.
Referenced by smtp_test_seam_ssl_write(), and smtp_write().
#define strlen smtp_test_seam_strlen |
Redefine this function from smtp.c and inject a test seam which can control the return value of this function.
Definition at line 273 of file seams.h.
Referenced by smtp_append_address_to_header(), smtp_attachment_add_mem(), smtp_auth_cram_md5(), smtp_auth_login(), smtp_auth_plain(), smtp_base64_decode(), smtp_base64_encode(), smtp_chunk_split(), smtp_ffile_put_contents(), smtp_fold_whitespace(), smtp_header_key_validate(), smtp_mail_envelope_header(), smtp_parse_cmd_line(), smtp_print_header(), smtp_print_mime_attachment(), smtp_print_mime_header_and_body(), smtp_puts(), smtp_puts_terminate(), smtp_str_repeat(), smtp_str_replace(), smtp_str_split(), smtp_strdup(), smtp_test_seam_recv(), smtp_test_seam_ssl_read(), smtp_test_seam_strlen(), smtp_unit_test_all_file_get_contents(), smtp_unit_test_all_str_getdelimfd(), smtp_unit_test_file_get_contents(), and smtp_unit_test_stpcpy().
#define time smtp_test_seam_time |
Redefine this function from smtp.c and inject a test seam which can control when this function fails.
See smtp_test_seam_time.
Definition at line 281 of file seams.h.
Referenced by smtp_date_rfc_2822(), smtp_gen_mime_boundary(), and smtp_test_seam_time().
#define X509_check_host smtp_test_seam_x509_check_host |
Redefine this function from smtp.c and inject a test seam which can control when this function fails.
See smtp_test_seam_x509_check_host.
Definition at line 233 of file seams.h.
Referenced by smtp_test_seam_x509_check_host(), and smtp_tls_init().