lib: expectabort rows for the restored preconditions; retire 989_libprecond_abort.c
The three must-abort runs (u32n/u64n zero, decodedsize unaligned) move into the owning lib suites as test.expectabort rows; the five normal-return controls already live in the r989_libprecond_* fixtures. wwstage parity rides the lib-wide cs==ww byte identity gate.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package random_test;
|
||||
|
||||
import random;
|
||||
import test;
|
||||
|
||||
@test fn seq() void = {
|
||||
let r: random.random = random.init(1234567u64);
|
||||
@@ -52,3 +53,19 @@ import random;
|
||||
i += 1;
|
||||
};
|
||||
};
|
||||
|
||||
// n == 0 is out of domain and must abort loudly, never return
|
||||
// garbage. Pins the restored Hare preconditions
|
||||
// (ref/hare/math/random/random.ha:26,42).
|
||||
|
||||
@test fn u32n_zero_aborts() void = {
|
||||
test.expectabort();
|
||||
let r: random.random = random.init(1u64);
|
||||
random.u32n(&r, 0u32);
|
||||
};
|
||||
|
||||
@test fn u64n_zero_aborts() void = {
|
||||
test.expectabort();
|
||||
let r: random.random = random.init(1u64);
|
||||
random.u64n(&r, 0u64);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user