Refactor 11 more tests to mcrfpy.step() pattern
Converted from Timer-based async to step()-based sync: - test_simple_callback.py - test_empty_animation_manager.py - test_frame_clipping.py - test_frame_clipping_advanced.py - test_grid_children.py - test_color_helpers.py - test_no_arg_constructors.py - test_properties_quick.py - test_simple_drawable.py - test_python_object_cache.py - WORKING_automation_test_example.py Only 4 tests remain with Timer-based patterns (2 are headless detection tests that may require special handling). 🤖 Generated with Claude Code (https://claude.com/claude-code) Co-Authored-By: Frack <frack@goblincorps.dev> Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
bb86cece2b
commit
be450286f8
12 changed files with 867 additions and 866 deletions
|
|
@ -1,20 +1,28 @@
|
|||
#!/usr/bin/env python3
|
||||
"""
|
||||
Test if AnimationManager crashes with no animations
|
||||
Refactored to use mcrfpy.step() for synchronous execution.
|
||||
"""
|
||||
|
||||
import mcrfpy
|
||||
import sys
|
||||
|
||||
print("Creating empty scene...")
|
||||
test = mcrfpy.Scene("test")
|
||||
test.activate()
|
||||
|
||||
print("Scene created, no animations added")
|
||||
print("Starting game loop in 100ms...")
|
||||
print("Advancing simulation with step()...")
|
||||
|
||||
def check_alive(timer, runtime):
|
||||
print(f"Timer fired at {runtime}ms - AnimationManager survived!")
|
||||
mcrfpy.Timer("exit", lambda t, r: mcrfpy.exit(), 100, once=True)
|
||||
# Step multiple times to simulate game loop running
|
||||
# If AnimationManager crashes with empty state, this will fail
|
||||
try:
|
||||
for i in range(10):
|
||||
mcrfpy.step(0.1) # 10 steps of 0.1s = 1 second simulated
|
||||
|
||||
mcrfpy.Timer("check", check_alive, 1000, once=True)
|
||||
print("If this crashes immediately, AnimationManager has an issue with empty state")
|
||||
print("AnimationManager survived 10 steps with no animations!")
|
||||
print("PASS")
|
||||
sys.exit(0)
|
||||
except Exception as e:
|
||||
print(f"FAIL: AnimationManager crashed: {e}")
|
||||
sys.exit(1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue