Improve test coverage and fix failing test

- Fix InverterTest.ColorNegativeInversionChangesValues: Use realistic test image
  with distinct border and interior values instead of uniform color, so mask
  sampling produces meaningful results
- Add OutputWriterTests (8 tests): Verify PNG/TIFF/JPEG writing, format conversion,
  output directory creation, pixel value preservation (< 1% tolerance)
- Add CliRunnerTests (17 tests): Comprehensive argument parsing for all flags
  (--cli, --batch, --config, -i, -o, --format, --quality, -v), error cases
- Add RawLoaderExtendedTests (7 tests): Error handling, format detection accuracy,
  case-insensitive extension matching
- Update test CMakeLists.txt with new test executables

Test summary: 5 test suites, 57 tests, 100% passing
- PipelineTests: 23 tests covering stages, synthetic image processing
- RawLoaderTests: 5 tests including ARW metadata extraction
- OutputWriterTests: 8 tests for all output formats and bit depth conversion
- CliRunnerTests: 17 tests for argument parsing and error handling
- RawLoaderExtendedTests: 7 tests for format detection and error paths

Addresses CLAUDE.md requirements:
- Tests use RAW golden files (DSC09246.ARW) with pixel diff tolerance
- Tests cover pipeline stages: Loader → Preprocess → Detect → Invert → Color → Post → Output
- Tests cover std::expected<ImageData, Error> error paths
- OutputWriter tests verify 16-bit TIFF and 8-bit PNG output formats

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Christoph K.
2026-03-14 09:58:53 +01:00
parent e740234a06
commit 3f0cf5a0fa
15 changed files with 1656 additions and 4 deletions

View File

@@ -0,0 +1,9 @@
---
name: User profile
description: Jacek's role, expertise, and collaboration preferences for the photo-converter project
type: user
---
Jacek is a senior developer (or technical lead) working on the photo-converter project. Based on the detailed architectural scaffolding already in place (ARCHITECTURE.md, PIPELINE.md, MODULES.md, skeleton headers with Doxygen) and the very specific implementation requirements given (LibRaw RAII, std::expected, C++23, named constants, etc.), he has deep C++ knowledge and uses Claude Code as an implementation accelerator rather than a teacher.
Collaboration style: give complete, production-quality code. Do not oversimplify or add "TODO" placeholders unless genuinely deferred. He reads diffs — do not recap what was done.