summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-08-08 10:03:08 -0400
committerNick Mathewson <nickm@torproject.org>2017-08-08 10:03:08 -0400
commit6121ca16bc83cf74f0c4bc3f71b3150cd18aa43c (patch)
tree00814d8a6981e2765f4b711a70d3e8a0e30b7190 /src/test
parent1168e21b45cb981463fa77a45c2e697bb75d573c (diff)
parentfcf836d239d3545ff02df63d47e1b23b000138e0 (diff)
downloadtor-6121ca16bc83cf74f0c4bc3f71b3150cd18aa43c.tar.gz
tor-6121ca16bc83cf74f0c4bc3f71b3150cd18aa43c.zip
Merge remote-tracking branch 'ahf/bugs/22286' into maint-0.3.1
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test_util.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/test/test_util.c b/src/test/test_util.c
index 7db93324d1..c6c0f1cd6a 100644
--- a/src/test/test_util.c
+++ b/src/test/test_util.c
@@ -2250,6 +2250,11 @@ test_util_compress_impl(compress_method_t method)
tt_assert(tor_compress_supports_method(method));
+ if (method != NO_METHOD) {
+ tt_assert(tor_compress_version_str(method) != NULL);
+ tt_assert(tor_compress_header_version_str(method) != NULL);
+ }
+
buf1 = tor_strdup("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAZAAAAAAAAAAAAAAAAAAAZ");
tt_assert(detect_compression_method(buf1, strlen(buf1)) == UNKNOWN_METHOD);
@@ -2353,6 +2358,8 @@ test_util_compress_stream_impl(compress_method_t method,
tt_assert(cp1 > cp2); /* Make sure we really added something. */
}
+ tt_int_op(tor_compress_state_size(state), OP_GT, 0);
+
tt_assert(!tor_uncompress(&buf3, &len2, buf1, 1024-len1,
method, 1, LOG_WARN));
/* Make sure it compressed right. */