mirror of
https://github.com/transmission/transmission
synced 2025-03-03 18:25:35 +00:00
add a unit test to exercise tr_cryptoRandInt()
This commit is contained in:
parent
abd98feaae
commit
7944e7c608
1 changed files with 7 additions and 0 deletions
|
@ -138,6 +138,13 @@ main( void )
|
|||
if(( i = test_strstrip( )))
|
||||
return i;
|
||||
|
||||
/* test that tr_cryptoRandInt() stays in-bounds */
|
||||
for( i=0; i<100000; ++i ) {
|
||||
const int val = tr_cryptoRandInt( 100 );
|
||||
check( i >= 0 );
|
||||
check( i < 100 );
|
||||
}
|
||||
|
||||
/* simple bitfield tests */
|
||||
for( l=0; l<NUM_LOOPS; ++l )
|
||||
if(( i = test_bitfields( )))
|
||||
|
|
Loading…
Reference in a new issue