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.
This commit is contained in:
Nick Mathewson
2017-04-14 12:35:02 -04:00
parent fe584f4012
commit 7fc37d41b4
6 changed files with 316 additions and 1 deletions
+3 -1
View File
@@ -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];