aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-04-14 12:35:02 -0400
committerNick Mathewson <nickm@torproject.org>2017-04-24 10:59:25 -0400
commit7fc37d41b47f106939cae559a6874fa46bca6150 (patch)
tree180cb27d3688582c75cefc10f3c25b699b9f63ca /src/or
parentfe584f40127c5a8fc5b6f03b0d7901c5d443824a (diff)
downloadtor-7fc37d41b47f106939cae559a6874fa46bca6150.tar.gz
tor-7fc37d41b47f106939cae559a6874fa46bca6150.zip
Unit tests for consdiffmgr module
Initial tests. These just try adding a few consensuses, looking them up, and making sure that consensus diffs are generated in a more or less reasonable-looking way. It's enough for 87% coverage, but it leaves out a lot of functionality.
Diffstat (limited to 'src/or')
-rw-r--r--src/or/consdiffmgr.c4
-rw-r--r--src/or/consdiffmgr.h5
2 files changed, 8 insertions, 1 deletions
diff --git a/src/or/consdiffmgr.c b/src/or/consdiffmgr.c
index 7d26b0c68b..0920d08750 100644
--- a/src/or/consdiffmgr.c
+++ b/src/or/consdiffmgr.c
@@ -11,6 +11,8 @@
* and serve the diffs from those documents to the latest consensus.
*/
+#define CONSDIFFMGR_PRIVATE
+
#include "or.h"
#include "conscache.h"
#include "consdiff.h"
@@ -122,7 +124,7 @@ cdm_labels_prepend_sha3(config_line_t **labels,
* <b>valid_after</b> time in the cache. Return that consensus if it's
* present, or NULL if it's missing.
*/
-static consensus_cache_entry_t *
+STATIC consensus_cache_entry_t *
cdm_cache_lookup_consensus(consensus_flavor_t flavor, time_t valid_after)
{
char formatted_time[ISO_TIME_LEN+1];
diff --git a/src/or/consdiffmgr.h b/src/or/consdiffmgr.h
index 860e055bb5..474876e432 100644
--- a/src/or/consdiffmgr.h
+++ b/src/or/consdiffmgr.h
@@ -34,5 +34,10 @@ int consdiffmgr_cleanup(void);
void consdiffmgr_configure(const consdiff_cfg_t *cfg);
void consdiffmgr_free_all(void);
+#ifdef CONSDIFFMGR_PRIVATE
+STATIC consensus_cache_entry_t *cdm_cache_lookup_consensus(
+ consensus_flavor_t flavor, time_t valid_after);
+#endif
+
#endif