summaryrefslogtreecommitdiffstats
path: root/test/bittests.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/bittests.c')
-rw-r--r--test/bittests.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/test/bittests.c b/test/bittests.c
index cb038f7..872a01a 100644
--- a/test/bittests.c
+++ b/test/bittests.c
@@ -174,9 +174,9 @@ test_copy (void)
TESTING("bit copy operations");
for (i=0; i<NTESTS; i++) {
- s_offset = rand() % (8*sizeof v1);
- d_offset = rand() % (8*sizeof v2);
- size = (unsigned)rand() % MIN (8*sizeof(v1), 8*sizeof(v2));
+ s_offset = HDrand() % (8*sizeof v1);
+ d_offset = HDrand() % (8*sizeof v2);
+ size = (unsigned)HDrand() % MIN (8*sizeof(v1), 8*sizeof(v2));
size = MIN3 (size, 8*sizeof(v1)-s_offset, 8*sizeof(v2)-d_offset);
memset (v1, 0xff, sizeof v1);
memset (v2, 0x00, sizeof v2);
@@ -296,11 +296,11 @@ test_shift (void)
TESTING("bit shift operations");
for (i=0; i<NTESTS; i++) {
- offset = rand() % (8*sizeof vector);
- size = (unsigned)rand() % (8*sizeof(vector)-offset);
+ offset = HDrand() % (8*sizeof vector);
+ size = (unsigned)HDrand() % (8*sizeof(vector)-offset);
/* Don't want size to be 0 */
if(size == 0) continue;
- shift_dist = rand() % size;
+ shift_dist = HDrand() % size;
/*-------- LEFT-shift some bits and make sure something was shifted --------*/
memset (vector, 0x00, sizeof vector);
@@ -429,8 +429,8 @@ test_increment (void)
TESTING("bit increment operations");
for (i=0; i<NTESTS; i++) {
- offset = rand() % (8*sizeof vector);
- size = (unsigned)rand() % (8*sizeof(vector)-offset);
+ offset = HDrand() % (8*sizeof vector);
+ size = (unsigned)HDrand() % (8*sizeof(vector)-offset);
/* Don't want size to be 0 */
if(size == 0) continue;
@@ -516,8 +516,8 @@ test_decrement (void)
TESTING("bit decrement operations");
for (i=0; i<NTESTS; i++) {
- offset = rand() % (8*sizeof vector);
- size = (unsigned)rand() % (8*sizeof(vector)-offset);
+ offset = HDrand() % (8*sizeof vector);
+ size = (unsigned)HDrand() % (8*sizeof(vector)-offset);
/* Don't want size to be 0 */
if(size == 0) continue;
@@ -588,8 +588,8 @@ test_negate (void)
TESTING("bit negate operations");
for (i=0; i<NTESTS; i++) {
- offset = rand() % (8*sizeof vector);
- size = (unsigned)rand() % (8*sizeof(vector)-offset);
+ offset = HDrand() % (8*sizeof vector);
+ size = (unsigned)HDrand() % (8*sizeof(vector)-offset);
/* Don't want size to be 0 */
if(size == 0) continue;
@@ -688,8 +688,8 @@ test_set (void)
TESTING("bit set operations");
for (i=0; i<NTESTS; i++) {
- d_offset = rand() % (8*sizeof v2);
- size = (unsigned)rand() % (8*sizeof(v2));
+ d_offset = HDrand() % (8*sizeof v2);
+ size = (unsigned)HDrand() % (8*sizeof(v2));
size = MIN (size, 8*sizeof(v2)-d_offset);
memset (v2, 0x00, sizeof v2);
@@ -805,8 +805,8 @@ test_clear (void)
TESTING("bit clear operations");
for (i=0; i<NTESTS; i++) {
- d_offset = rand() % (8*sizeof v2);
- size = (unsigned)rand() % (8*sizeof(v2));
+ d_offset = HDrand() % (8*sizeof v2);
+ size = (unsigned)HDrand() % (8*sizeof(v2));
size = MIN (size, 8*sizeof(v2)-d_offset);
memset (v2, 0xff, sizeof v2);