aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorjuga0 <juga@riseup.net>2018-06-30 13:52:54 +0000
committerjuga0 <juga@riseup.net>2018-07-16 14:43:49 +0000
commit317d930f081936cde6551f1642ddf20983918658 (patch)
treead211d47eeabd50bd456f9292d87bf118ee9481d /src/test
parente87793bae52baf7673b3083e85b7121ffcfea290 (diff)
downloadtor-317d930f081936cde6551f1642ddf20983918658.tar.gz
tor-317d930f081936cde6551f1642ddf20983918658.zip
Add test with NULL bw_file_header
and complete v1.0.0 bandwidth file
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test_dir.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/test/test_dir.c b/src/test/test_dir.c
index c4af7b2555..23faace086 100644
--- a/src/test/test_dir.c
+++ b/src/test/test_dir.c
@@ -1764,6 +1764,12 @@ test_dir_dirserv_read_measured_bandwidths(void *arg)
smartlist_free(bw_file_headers);
tor_free(bw_file_headers_str);
+ /* Test v1.0.0 complete bandwidth file with NULL bw_file_headers. */
+ tor_asprintf(&content, "%s%s", header_lines_v100, relay_lines_v100);
+ write_str_to_file(fname, content, 0);
+ tor_free(content);
+ tt_int_op(0, OP_EQ, dirserv_read_measured_bandwidths(fname, NULL, NULL));
+
/* Test bandwidth file including v1.1.0 bandwidth headers and
* v1.0.0 relay lines. bw_file_headers will contain the v1.1.0 headers. */
bw_file_headers = smartlist_new();