From 35aefdf1dbff374b64c248cfbd73331f1ad89f80 Mon Sep 17 00:00:00 2001 From: Jack May Date: Fri, 22 Feb 2019 16:27:19 -0800 Subject: [PATCH] Reduce test noise (#2907) --- programs/native/bpf_loader/src/lib.rs | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/programs/native/bpf_loader/src/lib.rs b/programs/native/bpf_loader/src/lib.rs index f16cc4f679..54d532bf2d 100644 --- a/programs/native/bpf_loader/src/lib.rs +++ b/programs/native/bpf_loader/src/lib.rs @@ -212,32 +212,22 @@ fn entrypoint( #[cfg(test)] mod tests { use super::*; - use solana_rbpf::helpers; #[test] #[should_panic(expected = "Error: Execution exceeded maximum number of instructions")] fn test_non_terminating_program() { #[rustfmt::skip] let prog = &[ - 0xb7, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // r6 = 0 - 0xb7, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // r1 = 0 - 0xb7, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // r2 = 0 - 0xb7, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // r3 = 0 - 0xb7, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // r4 = 0 - 0xbf, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // r5 = r6 - 0x85, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, // call 6 - 0x07, 0x06, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // r6 + 1 - 0x05, 0x00, 0xf8, 0xff, 0x00, 0x00, 0x00, 0x00, // goto -8 + 0x07, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // r6 + 1 + 0x05, 0x00, 0xfe, 0xff, 0x00, 0x00, 0x00, 0x00, // goto -2 0x95, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // exit ]; let input = &mut [0x00]; let mut vm = EbpfVmRaw::new(None).unwrap(); vm.set_verifier(bpf_verifier::check).unwrap(); - vm.set_max_instruction_count(36000).unwrap(); // 36000 is a wag, need to tune + vm.set_max_instruction_count(10).unwrap(); vm.set_program(prog).unwrap(); - vm.register_helper(helpers::BPF_TRACE_PRINTK_IDX, helpers::bpf_trace_printf) - .unwrap(); vm.execute_program(input).unwrap(); } }