Add TextureReplacer unit test; make replacer testable standalone

Add unittest/TestTextureReplacer which creates a fictive texture pack
(textures.ini with readable invented hashes plus real PNG files), loads
it via the replacer, and verifies lookups, filtering, hashranges, mip
levels, and missing/ignored entries.

To make the replacer runnable outside the emulator:
- The constructor now accepts a null DrawContext (formats just default
  to unsupported).
- FindReplacement/FindFiltering use the replaceEnabled_ member instead
  of the global config.
- Added TextureReplacer::LoadPackForTesting() to load an ini from a
  path directly.
This commit is contained in:
Henrik Rydgård committed 2026-08-03 18:55:33 +02:00
1 parent 9a7724f799
commit de7989ae56
7 files changed
+192 -6

No files matched your search

+1
View File
@@ -1391,6 +1391,7 @@ if(UNITTEST)
unittest/TestVFS.cpp
unittest/TestZipSlip.cpp
unittest/TestLzrc.cpp
unittest/TestTextureReplacer.cpp
unittest/TestRiscVEmitter.cpp
unittest/TestLoongArch64Emitter.cpp
unittest/TestSoftwareGPUJit.cpp