Skip to content

Commit

Permalink
Merge pull request #16 from mbroz/master
Browse files Browse the repository at this point in the history
Sync with Dieharder repo
  • Loading branch information
mbroz authored Feb 25, 2024
2 parents 80334e8 + d3ed111 commit 4713f4f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dieharder-src/dieharder-3.31.1/dieharder/run_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ void run_test()
}
}
}
if(dtest_num >= 0){
if(dtest_num >= 0 && dtest_num < MAXTESTS && dh_test_types[dtest_num]){
execute_test(dtest_num);
} else {
fprintf(stderr,"Error: dtest_num = %d. No test found.\n",dtest_num);
Expand Down
8 changes: 8 additions & 0 deletions dieharder-src/dieharder-3.31.1/libdieharder/rng_file_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ static void file_input_set (void *vstate, unsigned long int s);
uint file_input_get_rewind_cnt(gsl_rng *rng)
{
file_input_state_t *state = (file_input_state_t *) rng->state;

/*
* End of file was reached, but nothing was read yet (repeatedly).
* Do not report file rewind yet.
*/
if (state->rewind_cnt > 0 && state->rptr == 0)
return state->rewind_cnt - 1;

return state->rewind_cnt;
}

Expand Down

0 comments on commit 4713f4f

Please sign in to comment.