Repository navigation
test: math: port dct CMocka test to ztest - #11381
Merged
lgirdwood merged 1 commit intoOct 30, 2026
Merged
Conversation
tmleman
requested review from
dbaluta,
kv2019i,
lbetlej,
lgirdwood,
mmaka1 and
plbossart
as code owners
October 30, 2026 08:49
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the added 16-bit DCT matrix test coverage.
No open issues 🎉
What changed in this PR
Adds ztest coverage for 16-bit DCT matrix generation, porting both existing CMocka cases while sharing their reference data.
Changes:
- Uses a common helper and macro to check both matrices against absolute and RMS error limits.
- Frees each DCT plan before error assertions and adds an allocation-checking teardown hook.
- Configures native simulator execution, sanitizer-visible allocations, and floating-point diagnostics.
| File | Description |
|---|---|
test/ztest/unit/math/dct/testcase.yaml |
Registers the DCT suite for native_sim. |
test/ztest/unit/math/dct/test_dct_ztest.c |
Implements both reference-matrix tests and allocation cleanup checks. |
test/ztest/unit/math/dct/prj.conf |
Enables ztest, host heap allocation, and floating-point formatting. |
test/ztest/unit/math/dct/CMakeLists.txt |
Adds build wiring for DCT sources, shared test vectors, and allocation helpers. |
Review effort: Balanced
2 tasks
Add a ztest suite for the 16-bit DCT matrix generation, covering the same two cases as the CMocka test. The reference matrices are included in place from the CMocka tree so both frameworks are driven by identical fixed-point data. The two cases differ only in their reference matrix and plan parameters, so they are expanded from a single DCT_MATRIX_16_TEST() macro. The DCT plan is released before the error limits are asserted so that a failing case no longer leaks it, and the mod_alloc_test_after() hook checks that each case released its plan. Assisted-by: Copilot:claude-opus-5 Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
kv2019i
approved these changes
Oct 30, 2026
lgirdwood
approved these changes
Oct 30, 2026
PR 11381: test resultsRun date: 2026-10-30 14:11 UTC Tested commit: 85abf2c41552d669b42c529770c994282eb2a79e |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a ztest suite for the 16-bit DCT matrix generation, covering the same two cases as the CMocka test. The reference matrices are included in place from the CMocka tree so both frameworks are driven by identical fixed-point data.
The two cases differ only in their reference matrix and plan parameters, so they are expanded from a single DCT_MATRIX_16_TEST() macro. The DCT plan is released before the error limits are asserted so that a failing case no longer leaks it, and the mod_alloc_test_after() hook checks that each case released its plan.
Assisted-by: Copilot:claude-opus-5