Release v1.0.0: protocol freeze, replay testing, fuzzing and audit readiness
Rust / build (push) Canceled after 0s
Rust / build (push) Canceled after 0s
This commit is contained in:
1 parent
c7873b429d
commit
1a58ef9796
15 files changed
+1652
No files matched your search
@@ -0,0 +1,17 @@
|
||||
use proptest::prelude::*;
|
||||
|
||||
proptest! {
|
||||
#[test]
|
||||
fn test_vm_execute_never_panics(ref program in any::<Vec<u8>>()) {
|
||||
// VM execution should be totally robust and never panic on any random input stream.
|
||||
let state = shared::vm::execute(program);
|
||||
// The instruction pointer (ip) should not exceed the program length
|
||||
assert!(state.ip as usize <= program.len());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_gene_environment_roundtrip_never_panics(ref data in any::<Vec<u8>>()) {
|
||||
// Try to decode random bytes. It should either succeed or fail gracefully, never panic.
|
||||
let _ = shared::gene::decode_environment(data);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user