summaryrefslogtreecommitdiff
path: root/random
diff options
context:
space:
mode:
authorDafydd Harries <dafydd.harries@collabora.co.uk>2007-02-05 19:11:00 +0000
committerDafydd Harries <dafydd.harries@collabora.co.uk>2007-02-05 19:11:00 +0000
commitbe9f196d83732177068cdebbf063e4325a794f94 (patch)
tree91e0c944d82fb3341255c1f4625d1e873d3763e6 /random
parent6739b221ef2f4eebc56ea13bd10bf743d9d90a1e (diff)
downloadlibnice-be9f196d83732177068cdebbf063e4325a794f94.tar.gz
test nice_rng_generate_bytes
darcs-hash:20070205191117-c9803-4b3ccb476da684d25f11ab287eb4c0842be61f1b.gz
Diffstat (limited to 'random')
-rw-r--r--random/test.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/random/test.c b/random/test.c
index d84b5c0..2d85c97 100644
--- a/random/test.c
+++ b/random/test.c
@@ -9,12 +9,18 @@ main (void)
NiceRNG *rng;
gchar buf[9];
+ buf[8] = '\0';
+
nice_rng_set_new_func (nice_rng_glib_new_predictable);
rng = nice_rng_new ();
+
nice_rng_generate_bytes_print (rng, 8, buf);
- buf[8] = '\0';
//g_debug ("%s", buf);
g_assert (0 == strcmp (buf, "S9PObXR5"));
+
+ nice_rng_generate_bytes (rng, 8, buf);
+ g_assert (0 == strcmp (buf, "\x09\xd3\x15\xf2\x24\x57\x46\xd8"));
+
nice_rng_free (rng);
return 0;
}