]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix some no-longer-reasonable unit tests for base64_decode()
authorNick Mathewson <nickm@torproject.org>
Mon, 10 Apr 2017 16:08:31 +0000 (12:08 -0400)
committerNick Mathewson <nickm@torproject.org>
Mon, 10 Apr 2017 16:08:31 +0000 (12:08 -0400)
These tests tried to use ridiculously large buffer sizes to check
the sanity-checking in the code; but since the sanity-checking
changed, these need to change too.

src/test/test_util_format.c

index dd52e4b7ab614dccbbf90b6fbc5d04aa574aeb73..ea0a86499f45c53fb802eb9adb5bfcd5446ba796 100644 (file)
@@ -202,13 +202,10 @@ test_util_format_base64_decode(void *ignored)
     src[i] = (char)i;
   }
 
-  res = base64_decode(dst, 1, src, SIZE_T_CEILING);
+  res = base64_decode(dst, 1, src, 100);
   tt_int_op(res, OP_EQ, -1);
 
-  res = base64_decode(dst, SIZE_T_CEILING+1, src, 10);
-  tt_int_op(res, OP_EQ, -1);
-
-  res = base64_decode(dst, 1, real_src, SIZE_MAX/3+1);
+  res = base64_decode(dst, 1, real_src, 10);
   tt_int_op(res, OP_EQ, -1);
 
   const char *s = "T3BhIG11bmRv";