aboutsummaryrefslogtreecommitdiff
path: root/tests/test-bitmap.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2019-12-12 02:17:58 +0100
committerThomas Huth <thuth@redhat.com>2019-12-17 09:05:23 +0100
commit0f555602c7430ae55b5a4bacf39ce9e483e11193 (patch)
tree1a63690a8898b74e3b89a0a77eb4f98c7b0c9fd5 /tests/test-bitmap.c
parentc3088cd306caf965f1901e0a9ed818353c530b4e (diff)
downloadqemu-0f555602c7430ae55b5a4bacf39ce9e483e11193.zip
qemu-0f555602c7430ae55b5a4bacf39ce9e483e11193.tar.gz
qemu-0f555602c7430ae55b5a4bacf39ce9e483e11193.tar.bz2
tests: use g_test_rand_int
g_test_rand_int provides a reproducible random integer number, using a different number seed every time but allowing reproduction using the --seed command line option. It is thus better suited to tests than g_random_int or random. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <1576113478-42926-1-git-send-email-pbonzini@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'tests/test-bitmap.c')
-rw-r--r--tests/test-bitmap.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/test-bitmap.c b/tests/test-bitmap.c
index 087e02a..2f5b714 100644
--- a/tests/test-bitmap.c
+++ b/tests/test-bitmap.c
@@ -22,10 +22,10 @@ static void check_bitmap_copy_with_offset(void)
bmap2 = bitmap_new(BMAP_SIZE);
bmap3 = bitmap_new(BMAP_SIZE);
- bmap1[0] = random();
- bmap1[1] = random();
- bmap1[2] = random();
- bmap1[3] = random();
+ bmap1[0] = g_test_rand_int();
+ bmap1[1] = g_test_rand_int();
+ bmap1[2] = g_test_rand_int();
+ bmap1[3] = g_test_rand_int();
total = BITS_PER_LONG * 4;
/* Shift 115 bits into bmap2 */