Make all tests not output anything
This commit is contained in:
@@ -12,6 +12,7 @@ fn steps(machine: &mut rustijvm::Machine, num: usize) {
|
||||
#[test]
|
||||
fn task4_ldcw1() {
|
||||
let mut machine = rustijvm::Machine::new_from_file("files/task4/LoadTest1.ijvm").unwrap();
|
||||
machine.set_output(rustijvm::stubs::output_stub());
|
||||
|
||||
steps(&mut machine, 1);
|
||||
assert_eq!(machine.get_tos(), Ok(0x1));
|
||||
@@ -24,6 +25,7 @@ fn task4_ldcw1() {
|
||||
#[test]
|
||||
fn task4_simple_load() {
|
||||
let mut machine = rustijvm::Machine::new_from_file("files/task4/LoadTest3.ijvm").unwrap();
|
||||
machine.set_output(rustijvm::stubs::output_stub());
|
||||
|
||||
steps(&mut machine, 1);
|
||||
assert_eq!(machine.get_tos(), Ok(0x2a));
|
||||
@@ -52,6 +54,7 @@ fn task4_simple_load() {
|
||||
#[test]
|
||||
fn task4_complex_load() {
|
||||
let mut machine = rustijvm::Machine::new_from_file("files/task4/LoadTest2.ijvm").unwrap();
|
||||
machine.set_output(rustijvm::stubs::output_stub());
|
||||
|
||||
steps(&mut machine, 1);
|
||||
assert_eq!(machine.get_tos(), Ok(0x2a));
|
||||
@@ -83,7 +86,7 @@ fn task4_complex_load() {
|
||||
|
||||
#[test]
|
||||
fn task4_iteration_load() {
|
||||
let rc = Arc::new(Mutex::new(Cursor::new(Vec::new())));
|
||||
let rc = rustijvm::stubs::output_stub();
|
||||
|
||||
let mut machine = rustijvm::Machine::new_from_file("files/task4/LoadTest4.ijvm").unwrap();
|
||||
machine.set_output(rc.clone());
|
||||
@@ -102,6 +105,7 @@ fn task4_iteration_load() {
|
||||
fn task4_iinc() {
|
||||
use rustijvm::value::Value::Int;
|
||||
let mut machine = rustijvm::Machine::new_from_file("files/task4/IINCTest.ijvm").unwrap();
|
||||
machine.set_output(rustijvm::stubs::output_stub());
|
||||
|
||||
steps(&mut machine, 4);
|
||||
assert_eq!(machine.cur_frame().get(0), Ok(&Int(0)));
|
||||
|
||||
Reference in New Issue
Block a user