smtp-client
SMTP Client C Library
seams.h File Reference

Test seams for the smtp-client library. More...

#include "test.h"
+ Include dependency graph for seams.h:

Go to the source code of this file.

Macros

#define BIO_new_socket   smtp_test_seam_bio_new_socket
 
#define BIO_should_retry   smtp_test_seam_bio_should_retry
 
#define calloc   smtp_test_seam_calloc
 
#define close   smtp_test_seam_close
 
#define connect   smtp_test_seam_connect
 
#define ERR_peek_error   smtp_test_seam_err_peek_error
 
#define fclose   smtp_test_seam_fclose
 
#define ferror   smtp_test_seam_ferror
 
#define gmtime_r   smtp_test_seam_gmtime_r
 
#define HMAC   smtp_test_seam_hmac
 
#define localtime_r   smtp_test_seam_localtime_r
 
#define malloc   smtp_test_seam_malloc
 
#define mktime   smtp_test_seam_mktime
 
#define realloc   smtp_test_seam_realloc
 
#define recv   smtp_test_seam_recv
 
#define select   smtp_test_seam_select
 
#define send   smtp_test_seam_send
 
#define socket   smtp_test_seam_socket
 
#define SSL_connect   smtp_test_seam_ssl_connect
 
#define SSL_CTX_new   smtp_test_seam_ssl_ctx_new
 
#define SSL_do_handshake   smtp_test_seam_ssl_do_handshake
 
#define SSL_get_peer_certificate   smtp_test_seam_ssl_get_peer_certificate
 
#define X509_check_host   smtp_test_seam_x509_check_host
 
#define SSL_new   smtp_test_seam_ssl_new
 
#define SSL_read   smtp_test_seam_ssl_read
 
#define SSL_write   smtp_test_seam_ssl_write
 
#define sprintf   smtp_test_seam_sprintf
 
#define strlen   smtp_test_seam_strlen
 
#define time   smtp_test_seam_time
 

Detailed Description

Test seams for the smtp-client library.

Author
James Humphrey (mail@.nosp@m.somn.nosp@m.isoft.nosp@m..com)
Version
1.00

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.

Macro Definition Documentation

◆ BIO_new_socket

#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().

◆ BIO_should_retry

#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().

◆ calloc

#define calloc   smtp_test_seam_calloc

Redefine this function from smtp.c and inject a test seam which can control when this function fails.

See smtp_test_seam_calloc.

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().

◆ close

#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().

◆ connect

#define connect   smtp_test_seam_connect

Redefine this function from smtp.c and inject a test seam which can control when this function fails.

See smtp_test_seam_connect.

Definition at line 89 of file seams.h.

Referenced by smtp_connect(), and smtp_test_seam_connect().

◆ ERR_peek_error

#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().

◆ fclose

#define fclose   smtp_test_seam_fclose

Redefine this function from smtp.c and inject a test seam which can control when this function fails.

See smtp_test_seam_fclose.

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().

◆ ferror

#define ferror   smtp_test_seam_ferror

Redefine this function from smtp.c and inject a test seam which can control when this function fails.

See smtp_test_seam_ferror.

Definition at line 113 of file seams.h.

Referenced by load_test_email(), smtp_ffile_get_contents(), and smtp_test_seam_ferror().

◆ gmtime_r

#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.

See smtp_test_seam_gmtime_r.

Definition at line 121 of file seams.h.

Referenced by smtp_date_rfc_2822(), and smtp_test_seam_gmtime_r().

◆ HMAC

#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().

◆ localtime_r

#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().

◆ malloc

◆ mktime

#define mktime   smtp_test_seam_mktime

Redefine this function from smtp.c and inject a test seam which can control when this function fails.

See smtp_test_seam_mktime.

Definition at line 153 of file seams.h.

Referenced by smtp_date_rfc_2822(), and smtp_test_seam_mktime().

◆ realloc

◆ recv

#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().

◆ select

#define select   smtp_test_seam_select

Redefine this function from smtp.c and inject a test seam which can control when this function fails.

See smtp_test_seam_select.

Definition at line 177 of file seams.h.

Referenced by smtp_str_getdelimfd_read_timeout(), and smtp_test_seam_select().

◆ send

#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().

◆ socket

#define socket   smtp_test_seam_socket

Redefine this function from smtp.c and inject a test seam which can control when this function fails.

See smtp_test_seam_socket.

Definition at line 193 of file seams.h.

Referenced by smtp_connect(), and smtp_test_seam_socket().

◆ sprintf

#define sprintf   smtp_test_seam_sprintf

Redefine this function from smtp.c and inject a test seam which can control when this function fails.

See smtp_test_seam_sprintf.

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().

◆ SSL_connect

#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().

◆ SSL_CTX_new

#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().

◆ SSL_do_handshake

#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().

◆ SSL_get_peer_certificate

#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().

◆ SSL_new

#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.

See smtp_test_seam_ssl_new.

Definition at line 241 of file seams.h.

Referenced by smtp_test_seam_ssl_new(), and smtp_tls_init().

◆ SSL_read

#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.

See smtp_test_seam_ssl_read.

Definition at line 249 of file seams.h.

Referenced by smtp_str_getdelimfd_read(), and smtp_test_seam_ssl_read().

◆ SSL_write

#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.

See smtp_test_seam_ssl_write.

Definition at line 257 of file seams.h.

Referenced by smtp_test_seam_ssl_write(), and smtp_write().

◆ strlen

◆ time

#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().

◆ X509_check_host

#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().