Directory structure cleanup and organization overhaul
This commit is contained in:
parent
1a143982e1
commit
98fc49a978
119 changed files with 10483 additions and 4042 deletions
35
tests/unit/ui_Grid_null_texture_test.py
Normal file
35
tests/unit/ui_Grid_null_texture_test.py
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
#!/usr/bin/env python3
|
||||
"""Test Grid creation with null/None texture to reproduce segfault"""
|
||||
import mcrfpy
|
||||
import sys
|
||||
|
||||
def test_grid_null_texture():
|
||||
"""Test if Grid can be created without a texture"""
|
||||
print("=== Testing Grid with null texture ===")
|
||||
|
||||
# Create test scene
|
||||
mcrfpy.createScene("grid_null_test")
|
||||
mcrfpy.setScene("grid_null_test")
|
||||
ui = mcrfpy.sceneUI("grid_null_test")
|
||||
|
||||
# Test 1: Try with None
|
||||
try:
|
||||
print("Test 1: Creating Grid with None texture...")
|
||||
grid = mcrfpy.Grid(10, 10, None, mcrfpy.Vector(0, 0), mcrfpy.Vector(400, 400))
|
||||
print("✗ Should have raised exception for None texture")
|
||||
except Exception as e:
|
||||
print(f"✓ Correctly rejected None texture: {e}")
|
||||
|
||||
# Test 2: Try without texture parameter (if possible)
|
||||
try:
|
||||
print("\nTest 2: Creating Grid with missing parameters...")
|
||||
grid = mcrfpy.Grid(10, 10)
|
||||
print("✗ Should have raised exception for missing parameters")
|
||||
except Exception as e:
|
||||
print(f"✓ Correctly rejected missing parameters: {e}")
|
||||
|
||||
print("\nTest complete - Grid requires texture parameter")
|
||||
sys.exit(0)
|
||||
|
||||
# Run immediately
|
||||
test_grid_null_texture()
|
||||
Loading…
Add table
Add a link
Reference in a new issue