mirror of
https://github.com/JesseTG/melonds-ds.git
synced 2024-11-23 14:40:04 +00:00
Add an extra test case
This commit is contained in:
parent
d00fb33bd2
commit
18435ef988
@ -31,3 +31,10 @@ add_python_test(
|
||||
CORE_OPTION "melonds_render_mode=opengl"
|
||||
REQUIRES_OPENGL
|
||||
)
|
||||
|
||||
add_python_test(
|
||||
NAME "Core can switch from software to OpenGL mode at runtime"
|
||||
TEST_MODULE opengl.core_switch_software_to_opengl_runtime
|
||||
CONTENT "${NDS_ROM}"
|
||||
REQUIRES_OPENGL
|
||||
)
|
||||
|
26
test/python/opengl/core_switch_software_to_opengl_runtime.py
Normal file
26
test/python/opengl/core_switch_software_to_opengl_runtime.py
Normal file
@ -0,0 +1,26 @@
|
||||
from ctypes import CFUNCTYPE, c_bool
|
||||
|
||||
import prelude
|
||||
|
||||
options = {
|
||||
b"melonds_render_mode": b"software",
|
||||
}
|
||||
|
||||
with prelude.builder().with_options(options).build() as session:
|
||||
is_opengl_renderer = session.get_proc_address(b"melondsds_is_opengl_renderer", CFUNCTYPE(c_bool))
|
||||
assert is_opengl_renderer is not None, "melondsds_is_opengl_renderer not defined in the core"
|
||||
|
||||
is_software_renderer = session.get_proc_address(b"melondsds_is_software_renderer", CFUNCTYPE(c_bool))
|
||||
assert is_software_renderer is not None, "melondsds_is_software_renderer not defined in the core"
|
||||
|
||||
assert is_software_renderer()
|
||||
|
||||
for i in range(3):
|
||||
session.run()
|
||||
|
||||
session.options.variables["melonds_render_mode"] = b"opengl"
|
||||
|
||||
for i in range(3):
|
||||
session.run()
|
||||
|
||||
assert is_opengl_renderer()
|
Loading…
Reference in New Issue
Block a user