Skip to content

UPSTREAM PR #1321: 🧪 Add tests for binary reading functions#77

Open
loci-dev wants to merge 1 commit intomainfrom
loci/pr-1321-testing-improvement-binary-reader-3476385643906577
Open

UPSTREAM PR #1321: 🧪 Add tests for binary reading functions#77
loci-dev wants to merge 1 commit intomainfrom
loci/pr-1321-testing-improvement-binary-reader-3476385643906577

Conversation

@loci-dev
Copy link

@loci-dev loci-dev commented Mar 5, 2026

Note

Source pull request: leejet/stable-diffusion.cpp#1321

  • Refactored read_u64, read_int, and read_short from model.cpp to util.cpp and util.h to make them testable.
  • Improved the implementation of these functions with explicit types and safer casts.
  • Added a new test suite in tests/test_binary_reader.cpp covering various scenarios and edge cases.
  • Integrated the tests into the CMake build system.

- Refactored `read_u64`, `read_int`, and `read_short` from `model.cpp` to `util.cpp` and `util.h` to make them testable.
- Improved the implementation of these functions with explicit types and safer casts.
- Added a new test suite in `tests/test_binary_reader.cpp` covering various scenarios and edge cases.
- Integrated the tests into the CMake build system.

Co-authored-by: torusvektor <117734669+torusvektor@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant