[or-cvs] r12087: Fix a unit test in test_crypto_base32_decode that would fail (in tor/trunk: . src/or)

nickm at seul.org nickm at seul.org
Mon Oct 22 00:29:39 UTC 2007


Author: nickm
Date: 2007-10-21 20:29:39 -0400 (Sun, 21 Oct 2007)
New Revision: 12087

Modified:
   tor/trunk/
   tor/trunk/src/or/test.c
Log:
 r16014 at catbus:  nickm | 2007-10-21 20:29:14 -0400
 Fix a unit test in test_crypto_base32_decode that would fail one time in 32.



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r16014] on 8246c3cf-6607-4228-993b-4d95d33730f1

Modified: tor/trunk/src/or/test.c
===================================================================
--- tor/trunk/src/or/test.c	2007-10-22 00:26:02 UTC (rev 12086)
+++ tor/trunk/src/or/test.c	2007-10-22 00:29:39 UTC (rev 12087)
@@ -3207,10 +3207,10 @@
   test_eq(res, 0);
   test_memeq(plain, decoded, 60);
   /* Change encoded string and decode. */
-  if (encoded[0] == 'a')
-    encoded[0] = 'b';
+  if (encoded[0] == 'A' || encoded[0] == 'a')
+    encoded[0] = 'B';
   else
-    encoded[0] = 'a';
+    encoded[0] = 'A';
   res = base32_decode(decoded, 60, encoded, 96);
   test_eq(res, 0);
   test_memneq(plain, decoded, 60);



More information about the tor-commits mailing list