implements PLN-0024
This commit is contained in:
parent
cc700c6cf8
commit
3fef407efc
@ -63,6 +63,18 @@ fn resolver_rejects_unknown_identity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn resolver_rejects_removed_legacy_gfx_set_sprite_identity() {
|
||||||
|
assert!(resolve_syscall("gfx", "set_sprite", 1).is_none());
|
||||||
|
|
||||||
|
let requested = [SyscallIdentity { module: "gfx", name: "set_sprite", version: 1 }];
|
||||||
|
let err = resolve_program_syscalls(&requested, caps::ALL).unwrap_err();
|
||||||
|
assert_eq!(
|
||||||
|
err,
|
||||||
|
LoadError::UnknownSyscall { module: "gfx".into(), name: "set_sprite".into(), version: 1 }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn resolver_enforces_capabilities() {
|
fn resolver_enforces_capabilities() {
|
||||||
let requested = [SyscallIdentity { module: "gfx", name: "clear", version: 1 }];
|
let requested = [SyscallIdentity { module: "gfx", name: "clear", version: 1 }];
|
||||||
|
|||||||
@ -42,10 +42,10 @@ pub fn generate() -> Result<()> {
|
|||||||
ret_slots: 0,
|
ret_slots: 0,
|
||||||
},
|
},
|
||||||
SyscallDecl {
|
SyscallDecl {
|
||||||
module: "gfx".into(),
|
module: "composer".into(),
|
||||||
name: "set_sprite".into(),
|
name: "emit_sprite".into(),
|
||||||
version: 1,
|
version: 1,
|
||||||
arg_slots: 10,
|
arg_slots: 9,
|
||||||
ret_slots: 1,
|
ret_slots: 1,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
@ -124,9 +124,9 @@ fn heavy_load(rom: &mut Vec<u8>) {
|
|||||||
|
|
||||||
// --- clear screen ---
|
// --- clear screen ---
|
||||||
rom.extend(asm("PUSH_I32 0\nHOSTCALL 0"));
|
rom.extend(asm("PUSH_I32 0\nHOSTCALL 0"));
|
||||||
// --- call status-first syscall path once per frame and drop status ---
|
// --- call composer-domain sprite emission path once per frame and drop status ---
|
||||||
rom.extend(asm(
|
rom.extend(asm(
|
||||||
"PUSH_I32 0\nPUSH_I32 0\nPUSH_I32 0\nPUSH_I32 0\nPUSH_I32 0\nPUSH_I32 0\nPUSH_BOOL 0\nPUSH_BOOL 0\nPUSH_BOOL 0\nPUSH_I32 0\nHOSTCALL 4\nPOP_N 1",
|
"PUSH_I32 0\nPUSH_I32 0\nPUSH_I32 0\nPUSH_I32 0\nPUSH_I32 0\nPUSH_I32 0\nPUSH_BOOL 0\nPUSH_BOOL 0\nPUSH_I32 0\nHOSTCALL 4\nPOP_N 1",
|
||||||
));
|
));
|
||||||
|
|
||||||
// --- draw 500 discs ---
|
// --- draw 500 discs ---
|
||||||
|
|||||||
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user