mirror of
https://github.com/JesseTG/melonds-ds.git
synced 2024-11-23 14:40:04 +00:00
Fix RAM tests
This commit is contained in:
parent
50fb22a9f7
commit
0d757151b1
@ -1,7 +1,12 @@
|
||||
from sys import argv
|
||||
from libretro import default_session, RETRO_MEMORY_SYSTEM_RAM
|
||||
from ctypes import *
|
||||
|
||||
with default_session(argv[1]) as session:
|
||||
from libretro import Session
|
||||
from libretro.h import RETRO_MEMORY_SYSTEM_RAM
|
||||
|
||||
import prelude
|
||||
|
||||
session: Session
|
||||
with prelude.session() as session:
|
||||
size = session.core.get_memory_size(RETRO_MEMORY_SYSTEM_RAM)
|
||||
|
||||
assert size is not None
|
||||
@ -17,4 +22,9 @@ with default_session(argv[1]) as session:
|
||||
|
||||
assert memory is not None
|
||||
assert len(memory) == size
|
||||
assert id(memory) == data.value
|
||||
|
||||
# Let's ensure that we can write to the memory
|
||||
memory[0:5] = b'hello'
|
||||
mem_ptr = cast(data, POINTER(c_ubyte))
|
||||
assert bytes(mem_ptr[0:5]) == b'hello'
|
||||
|
||||
|
@ -1,7 +1,10 @@
|
||||
from sys import argv
|
||||
from libretro import default_session, RETRO_MEMORY_SAVE_RAM
|
||||
from libretro import Session
|
||||
from libretro.h import RETRO_MEMORY_SAVE_RAM
|
||||
|
||||
with default_session(argv[1]) as session:
|
||||
import prelude
|
||||
|
||||
session: Session
|
||||
with prelude.session() as session:
|
||||
size = session.core.get_memory_size(RETRO_MEMORY_SAVE_RAM)
|
||||
|
||||
assert size is not None
|
||||
|
Loading…
Reference in New Issue
Block a user