pr 63
This commit is contained in:
@@ -39,20 +39,13 @@ fn test_canonical_cartridge_heartbeat() {
|
||||
|
||||
let pbc_bytes = fs::read(pbc_path).expect("Failed to read canonical PBC. Did you run the generation test?");
|
||||
|
||||
// Determine numeric entrypoint PC from the compiled module exports
|
||||
// Determine entrypoint from the compiled module exports
|
||||
let module = BytecodeLoader::load(&pbc_bytes).expect("Failed to parse PBC");
|
||||
let func_idx = module
|
||||
.exports
|
||||
.iter()
|
||||
.find(|e| e.symbol == "src/main/modules:frame")
|
||||
.map(|e| e.func_idx as usize)
|
||||
.expect("Entrypoint symbol not found in exports");
|
||||
let entry_pc = module.functions[func_idx].code_offset as usize;
|
||||
let entry_pc_str = entry_pc.to_string();
|
||||
let entry_symbol = "src/main/modules:frame";
|
||||
|
||||
let mut vm = VirtualMachine::new(vec![], vec![]);
|
||||
vm.initialize(pbc_bytes, &entry_pc_str).expect("Failed to initialize VM with canonical cartridge");
|
||||
vm.prepare_call(&entry_pc_str);
|
||||
vm.initialize(pbc_bytes, entry_symbol).expect("Failed to initialize VM with canonical cartridge");
|
||||
vm.prepare_call(entry_symbol);
|
||||
|
||||
let mut native = MockNative;
|
||||
let mut hw = Hardware::new();
|
||||
|
||||
Reference in New Issue
Block a user