mirror of
https://github.com/ProjectLeonida/mandy.git
synced 2026-12-06 13:08:37 +00:00
Resolve console roots (GAME:\, G:\, T:\) to mapped host paths before querying host disk geometry and capacity, and provide synthetic Xbox console storage fallback quotas when unmounted.
30 lines
1015 B
Python
30 lines
1015 B
Python
"""Tests for GetDiskFreeSpace and GetDiskFreeSpaceEx shims in file_system.cpp (RT-FS-DISK-FREE-SPACE)."""
|
|
import os
|
|
import unittest
|
|
|
|
ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|
|
|
|
|
class FileSystemDiskFreeSpaceTest(unittest.TestCase):
|
|
def test_disk_free_space_shims_present(self):
|
|
fs_path = os.path.join(ROOT, "runtime", "shims", "file_system.cpp")
|
|
self.assertTrue(os.path.exists(fs_path), "file_system.cpp must exist")
|
|
with open(fs_path, "r", encoding="utf-8") as f:
|
|
content = f.read()
|
|
|
|
for symbol in [
|
|
"get_disk_free_space_ex_w",
|
|
"get_disk_free_space_ex_a",
|
|
"get_disk_free_space_w",
|
|
"get_disk_free_space_a",
|
|
'"GetDiskFreeSpaceA"',
|
|
'"GetDiskFreeSpaceW"',
|
|
'"GetDiskFreeSpaceExA"',
|
|
'"GetDiskFreeSpaceExW"',
|
|
]:
|
|
self.assertIn(symbol, content, f"Expected {symbol} in file_system.cpp")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|