mirror of
https://git.triforceproject.com/triforce/source
synced 2026-11-23 17:49:57 -04:00
Triforce v0.7.1
Crash fixes (a load crash from the virtual cores' escape, the upscaler-before-the-bloom crash, out of memory at a file's open), slow motion after a movie fixed, three save files with per-save achievements (ZakyPew), ten more achievements and their own menu group, N64 Classic, native ultrawide output (Kaefergeneral), the community AMD frame-time fixes, the helper threads' calm-scene tuner and benchmark test, update and Linux launcher fixes.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
"""Game-free checks of recomplauncher.json: it parses, and every settings key is a row of the in-game menu.
|
||||
"""Game-free checks of recomplauncher.json: it parses, every settings key is a row of the in-game menu, and no value it
|
||||
writes means something else under another options_version.
|
||||
|
||||
Run with: python -I tests/test_recomplauncher_json.py
|
||||
"""
|
||||
@@ -26,6 +27,29 @@ class RecompLauncherJsonTests(unittest.TestCase):
|
||||
self.assertTrue(keys)
|
||||
self.assertEqual(keys - rows, set())
|
||||
|
||||
def test_values_mean_the_same_in_every_options_version(self):
|
||||
"""The manifest writes key=value lines and never options_version (it has no way to: a line it wrote into an older
|
||||
file would also switch off that file's other rules). So a value it writes is read by the rules of whatever
|
||||
version the file has, or of none in a file it makes. It may only offer values no rule changes:
|
||||
- ultrawide=1 was "Monitor's shape" before options_version 6 and is 16:10 from 6 on (gpu/vk/ultrawide_rows.h);
|
||||
- output_res=4 and 6 (5120x1440, 5120x2160) are read as 2560x1440 and 3840x2160 before 8 when ultrawide is on
|
||||
another shape than theirs (gpu/vk/output_sizes.h output_res_read)."""
|
||||
manifest = json.loads((ROOT / "recomplauncher.json").read_text(encoding="utf-8"))
|
||||
written = {(key, value) for setting in manifest["settings"] for choice in setting["choices"]
|
||||
for key, value in choice["set"].items()}
|
||||
self.assertNotIn("options_version", {key for key, _ in written})
|
||||
moved = {("ultrawide", "1"), ("output_res", "4"), ("output_res", "6"), ("output_res", "7"), ("output_res", "8")}
|
||||
self.assertEqual(written & moved, set())
|
||||
rows_h = (ROOT / "gpu" / "vk" / "ultrawide_rows.h").read_text(encoding="utf-8")
|
||||
sizes_h = (ROOT / "gpu" / "vk" / "output_sizes.h").read_text(encoding="utf-8")
|
||||
# (the rules those three come from, as the headers have them: a new rule there is a new value to leave out here)
|
||||
self.assertIn("return version < 6 && row == 1 ? ultrawide_row_nearest(screen_w, screen_h) : row;", rows_h)
|
||||
self.assertIn(" if (v == 4 && ultrawide_row != 0 && ultrawide_row != 3) return 1;\n"
|
||||
" if (v == 6 && ultrawide_row != 0 && ultrawide_row != 2) return 2;\n return v;", sizes_h)
|
||||
# (what it still offers of the two rows: the 16:9 sizes and Screen, and the shapes 16:9, 21:9 and 32:9)
|
||||
self.assertEqual({value for key, value in written if key == "output_res"}, {"0", "1", "2", "3", "5"})
|
||||
self.assertEqual({value for key, value in written if key == "ultrawide"}, {"0", "2", "3"})
|
||||
|
||||
def test_appimage_carries_it(self):
|
||||
self.assertIn('cp recomplauncher.json "$APPDIR/recomplauncher.json"',
|
||||
(ROOT / "scripts" / "linux" / "appimage.sh").read_text(encoding="utf-8"))
|
||||
|
||||
Reference in New Issue
Block a user