This adds regression tests for the 64-bit file positions introduced by bitcoin/bitcoin#36669. Existing flatfile tests use small offsets. The VARINT overflow tests added in bitcoin/bitcoin#36725 don't check that FlatFilePos preserves a 64-bit position or that opening a file uses the full offset.
The tests check serialization around 2 GiB and 4 GiB, plus zero and UINT64_MAX. They also check opening and seeking around 2 GiB and 4 GiB, including preservation of the position across size(). The file stays one byte so no data is written at a large offset.
Validation process:
- On macOS arm64 (Apple Clang 21), Linux x86_64/i386 (GCC 13), and Windows x86_64 (clang-cl 22),
flatfile_tests,serialize_tests,streams_tests, andblockmanager_testspass. Include/test linters, changed-range clang-format, and whitespace checks also pass locally. - Before #36669, the existing flatfile tests pass, while the new tests catch rejected serialization and a seek position wrapping to zero at 4 GiB.
- Casting only the current
FlatFileSeq::Openseek offset touint32_talso makes the new positioning test fail while existing flatfile tests pass on macOS, Linux x86_64, and Windows x86_64.
On non-Windows systems with 32-bit long, the seek test warns and returns because the current wrapper uses fseek. The serialization test still runs. This behavior was verified on Linux i386. These were focused checks; the full CI matrix has not run.
CI results: Linux x86_64, Windows x86_64, Linux i386. All jobs tested commit 1d11bd83d892d5bdac759e98321899d60f7c84e8.