| 49 | |
| 50 | |
| 51 | unittest(test_constructor) |
| 52 | { |
| 53 | Prandom R; |
| 54 | |
| 55 | // three seed() calls are possible |
| 56 | R.seed(); |
| 57 | R.seed(42); |
| 58 | R.seed(355, 113); |
| 59 | |
| 60 | assertLessOrEqual(100, R.randrange(100, 200)); |
| 61 | assertMoreOrEqual(200, R.randrange(100, 200)); |
| 62 | |
| 63 | for (int bits = 0; bits < 32; bits++) |
| 64 | { |
| 65 | fprintf(stderr, "%d\t", bits); |
| 66 | assertMoreOrEqual(pow(2, bits), R.getrandbits(bits)); |
| 67 | } |
| 68 | |
| 69 | } |
| 70 | |
| 71 | |
| 72 | unittest_main() |
nothing calls this directly
no test coverage detected