summaryrefslogtreecommitdiff
path: root/src/test/test_util.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-08-08 10:10:52 -0400
committerNick Mathewson <nickm@torproject.org>2017-08-08 10:10:52 -0400
commit48a57f9815875d8c591f5660e1b7a10d478785ac (patch)
tree4c6f13317c9e6424b555ebd825679acb4a0f587c /src/test/test_util.c
parent2032b9b1b1385932f3f6bd731bb1c0b4f8dcee48 (diff)
parent5368eaf62b2b4804e75fc301757f843d64ef941d (diff)
downloadtor-48a57f9815875d8c591f5660e1b7a10d478785ac.tar.gz
tor-48a57f9815875d8c591f5660e1b7a10d478785ac.zip
Merge branch 'maint-0.3.1'
Diffstat (limited to 'src/test/test_util.c')
-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 4840ecce72..891e4f6dbf 100644
--- a/src/test/test_util.c
+++ b/src/test/test_util.c
@@ -2259,6 +2259,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);
@@ -2362,6 +2367,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. */