aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_protover.c
diff options
context:
space:
mode:
authorIsis Lovecruft <isis@torproject.org>2018-03-27 21:36:10 +0000
committerIsis Lovecruft <isis@torproject.org>2018-04-02 19:20:38 +0000
commit527a2398634ecf1c244422121653f431c8df94fc (patch)
tree272d56e6d9082773478aee51e123c9da1a698935 /src/test/test_protover.c
parent22c65a0e4bc7da08e216a769bba1b91f7b2a0ca1 (diff)
downloadtor-527a2398634ecf1c244422121653f431c8df94fc.tar.gz
tor-527a2398634ecf1c244422121653f431c8df94fc.zip
tests: Run all existing protover tests in both languages.
There's now no difference in these tests w.r.t. the C or Rust: both fail miserably (well, Rust fails with nice descriptive errors, and C gives you a traceback, because, well, C).
Diffstat (limited to 'src/test/test_protover.c')
-rw-r--r--src/test/test_protover.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/test/test_protover.c b/src/test/test_protover.c
index e7e17efe32..7bf1471ebd 100644
--- a/src/test/test_protover.c
+++ b/src/test/test_protover.c
@@ -283,23 +283,22 @@ test_protover_all_supported(void *arg)
tt_str_op(msg, OP_EQ, "Sleen=0-4294967294");
tor_free(msg);
- /* If we get an unparseable list, we say "yes, that's supported." */
-#ifndef HAVE_RUST
- // XXXX let's make this section unconditional: rust should behave the
- // XXXX same as C here!
+ /* If we get a (barely) valid (but unsupported list, we say "yes, that's
+ * supported." */
+ tt_assert(protover_all_supported("Fribble=", &msg));
+ tt_ptr_op(msg, OP_EQ, NULL);
+
+ /* If we get a completely unparseable list, protover_all_supported should
+ * hit a fatal assertion for BUG(entries == NULL). */
tor_capture_bugs_(1);
tt_assert(protover_all_supported("Fribble", &msg));
- tt_ptr_op(msg, OP_EQ, NULL);
tor_end_capture_bugs_();
- /* This case is forbidden. Since it came from a protover_all_supported,
- * it can trigger a bug message. */
+ /* If we get a completely unparseable list, protover_all_supported should
+ * hit a fatal assertion for BUG(entries == NULL). */
tor_capture_bugs_(1);
tt_assert(protover_all_supported("Sleen=0-4294967295", &msg));
- tt_ptr_op(msg, OP_EQ, NULL);
- tor_free(msg);
tor_end_capture_bugs_();
-#endif
done:
tor_end_capture_bugs_();