diff options
author | dana koch <dsk@google.com> | 2014-04-15 22:20:34 +1000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-04-15 15:00:34 -0400 |
commit | 3ce3984772b673b82a87aded1bc8a1a0f1969e19 (patch) | |
tree | ae9e005f34ae81ff04c006ef179575de5b277bb8 /src/common/tortls.h | |
parent | 2704441e7ff1242d168bc14dda946fc41844f2c5 (diff) | |
download | tor-3ce3984772b673b82a87aded1bc8a1a0f1969e19.tar.gz tor-3ce3984772b673b82a87aded1bc8a1a0f1969e19.zip |
Uplift status.c unit test coverage with new test cases and macros.
A new set of unit test cases are provided, as well as introducing
an alternative paradigm and macros to support it. Primarily, each test
case is given its own namespace, in order to isolate tests from each
other. We do this by in the usual fashion, by appending module and
submodule names to our symbols. New macros assist by reducing friction
for this and other tasks, like overriding a function in the global
namespace with one in the current namespace, or declaring integer
variables to assist tracking how many times a mock has been called.
A set of tests for a small-scale module has been included in this
commit, in order to highlight how the paradigm can be used. This
suite gives 100% coverage to status.c in test execution.
Diffstat (limited to 'src/common/tortls.h')
-rw-r--r-- | src/common/tortls.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/common/tortls.h b/src/common/tortls.h index 49c488b365..a76ba3bc7a 100644 --- a/src/common/tortls.h +++ b/src/common/tortls.h @@ -13,6 +13,7 @@ #include "crypto.h" #include "compat.h" +#include "testsupport.h" /* Opaque structure to hold a TLS connection. */ typedef struct tor_tls_t tor_tls_t; @@ -95,7 +96,7 @@ void tor_tls_get_buffer_sizes(tor_tls_t *tls, size_t *rbuf_capacity, size_t *rbuf_bytes, size_t *wbuf_capacity, size_t *wbuf_bytes); -double tls_get_write_overhead_ratio(void); +MOCK_DECL(double, tls_get_write_overhead_ratio, (void)); int tor_tls_used_v1_handshake(tor_tls_t *tls); int tor_tls_received_v3_certificate(tor_tls_t *tls); |