McRogueFace/tests/unit/test_empty_animation_manager.py
Frick be450286f8 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>
2026-01-14 03:09:47 +00:00

28 lines
739 B
Python

#!/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("Advancing simulation with step()...")
# 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
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)