fix test to generate a correct range of random ints

This test would fail if the value 50 was randomly selected.