primase-foundations 0.3.6

Checked byte readers, game-file hashes, vertex decoding, texture sampling and the compression codecs (LZ4, deflate, zstd, LZMA, Brotli, LZO2A, Oodle) game files use
Documentation
# Testing

```sh
cargo test --workspace
```

The test suite needs no game files; the dev-dependencies turn on the `compress`, `reference-decoder` and `sqlite` features. Unit and integration tests use hand-worked values, published test vectors (RFC 1321 for MD5, the Adler-32 "Wikipedia" example, the CRC-32 check value) and small fixtures generated by independent programs:

- `tests/fixtures/vertex`: produced by a separate C# implementation of the arithmetic.
- `tests/fixtures/lzo1x`: LZO1X streams written by python-lzo 1.15 (LZO 2.10's own compressors) from synthetic inputs (`gen.py`).
- `tests/fixtures/sqlite`: an SQLite database written by Python's sqlite3 and dumped by it value by value (`tests/oracles/`).
- LZO1X and LZO2A streams laid out by hand from LZO 2.10's source, inside the tests.

## Real-data tests

Some tests read your own game files. They are skipped, each with a line naming what is missing, unless the environment variable `GAME_DATA` holds the absolute path of a TOML file outside the repository that says where your files are:

```toml
[tools]
# the Oodle libraries your games ship, to compare them against oozextract
oodle6 = 'D:/games/Sekiro/oo2core_6_win64.dll'

[oracles]
# <root>/<set>/<game>/<file>: here <root>/corpus/general/codecs.tsv
root = 'D:/oracles'

[scratch]
root = 'D:/scratch'

[run]
require = 'gate'   # inputs the tests mark as required fail, rather than skip, when unset
```

Every section and key is optional and every value is a string. The keys this crate reads are `tools.oodle5`, `tools.oodle6`, `tools.oodle9`, `oracles.root` and `scratch.root`. The codec corpus `corpus/general/codecs.tsv` is made by `tests/oracles/codecs.py` from streams cut out of your games, as its header describes. [tests/inputs/README.md](../tests/inputs/README.md) lists each input with what it is and where it comes from. The file format is that of [primase-testdata](https://github.com/Kalmarv/primase-testdata), the test-support crate that reads it. The Oodle tests run on Windows only; elsewhere oozextract decodes and nothing is configured.