summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2010-06-29 18:57:59 -0400
committerNick Mathewson <nickm@torproject.org>2010-06-29 18:57:59 -0400
commit485cab869d292becb62a43b2e33a399ebc671303 (patch)
tree7052a37a6c36d67cb7d48524766103890545e487 /src/test
parentbea55766af461e4ca78a4919912f3aa9de978bdc (diff)
parentb111a7cd9c5e09bedf57a67f9044a2974222cd11 (diff)
downloadtor-485cab869d292becb62a43b2e33a399ebc671303.tar.gz
tor-485cab869d292becb62a43b2e33a399ebc671303.zip
Merge remote branch 'public/rand_double2'
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test_crypto.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/test/test_crypto.c b/src/test/test_crypto.c
index 7aca098bc7..b475914b1b 100644
--- a/src/test/test_crypto.c
+++ b/src/test/test_crypto.c
@@ -57,6 +57,7 @@ test_crypto_rng(void)
{
int i, j, allok;
char data1[100], data2[100];
+ double d;
/* Try out RNG. */
test_assert(! crypto_seed_rng(0));
@@ -76,6 +77,9 @@ test_crypto_rng(void)
big = crypto_rand_uint64(U64_LITERAL(5));
if (big >= 5)
allok = 0;
+ d = crypto_rand_double();
+ test_assert(d >= 0);
+ test_assert(d < 1.0);
host = crypto_random_hostname(3,8,"www.",".onion");
if (strcmpstart(host,"www.") ||
strcmpend(host,".onion") ||