Skip to content

test(core,imgproc): add 28 critical unit tests for untested public APIs#25

Merged
kalwalt merged 1 commit intodevfrom
feat/test-improves
Mar 28, 2026
Merged

test(core,imgproc): add 28 critical unit tests for untested public APIs#25
kalwalt merged 1 commit intodevfrom
feat/test-improves

Conversation

@kalwalt
Copy link
Copy Markdown
Member

@kalwalt kalwalt commented Mar 27, 2026

Summary

  • Adds 28 new test functions (21 in core/tests.rs, 7 in imgproc/tests.rs) covering ~40 previously untested public API functions
  • Targets the highest-impact coverage gaps: scalar arithmetic variants, bitwise scalar ops, min/max, comparison ops (compare, in_range), reduction (reduce, count_non_zero), polar/cartesian conversions, linear algebra (determinant, invert, solve), channel ops (extract_channel, insert_channel), DynamicMatrix, gray-to-color conversions, and kernel helpers
  • Updates README with test coverage summary (153 total unit tests)

Closes #23

New tests

src/core/tests.rs (21 tests)

Category Tests
Scalar arithmetic test_scalar_arithmetic, test_abs_diff_scalar, test_bitwise_scalar
Min/Max test_min_max, test_min_max_scalar
Comparisons test_compare, test_compare_scalar, test_in_range, test_in_range_scalar
Reduction test_reduce_sum_avg, test_reduce_min_max, test_count_non_zero
Polar/Cartesian test_magnitude, test_phase, test_cart_to_polar, test_polar_to_cart
Linear algebra test_determinant, test_invert, test_solve
Channel ops test_extract_insert_channel
DynamicMatrix test_dynamic_matrix

src/imgproc/tests.rs (7 tests)

Category Tests
Gray-to-color test_cvt_color_gray_to_rgb, test_cvt_color_gray_to_bgr, test_cvt_color_gray_to_rgba, test_cvt_color_gray_to_bgra, test_gray_to_color_error
Kernel helpers test_get_gaussian_kernel, test_get_sobel_kernels

Test plan

  • cargo test --workspace — 153 tests pass
  • cargo clippy -- -D warnings — clean
  • cargo fmt --check — clean

🤖 Generated with Claude Code

…Is (#23)

Add comprehensive test coverage for high-impact functions that previously
had zero tests: scalar arithmetic variants, bitwise scalar ops, min/max,
comparison ops, in_range, reduction, polar/cartesian conversions, linear
algebra (determinant, invert, solve), channel ops (extract/insert),
DynamicMatrix, gray-to-color conversions, and kernel helpers. Update
README with test coverage summary.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@kalwalt kalwalt self-assigned this Mar 27, 2026
@kalwalt kalwalt added enhancement New feature or request rust-code rust Pull requests that update rust code tests labels Mar 27, 2026
@kalwalt kalwalt merged commit e5f8e9a into dev Mar 28, 2026
3 checks passed
@kalwalt kalwalt deleted the feat/test-improves branch April 5, 2026 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request rust Pull requests that update rust code rust-code tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant