Repository navigation
test: selector: add ztest unit tests - #11401
Open
piotrhoppeintel wants to merge 1 commit into
Open
piotrhoppeintel wants to merge 1 commit into
piotrhoppeintel wants to merge 1 commit into
Conversation
Add native_sim tests for selector format dispatch, sample conversion, saturation, rounding and circular-buffer wrapping. Cover component preparation, IPC4 payload handling, channel propagation, passthrough selection and coefficient-based processing.
piotrhoppeintel
marked this pull request as ready for review
November 4, 2026 13:04
piotrhoppeintel
requested review from
dbaluta,
kv2019i,
lbetlej,
lgirdwood,
mmaka1 and
plbossart
as code owners
November 4, 2026 13:04
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The channel-count test cannot detect propagation regressions because its buffers already contain the expected values; set different counts before prepare() so the assertions verify propagation.
1 open issue
What changed in this PR
Adds native_sim ztests for the selector’s format-conversion functionality introduced in #11370, without changing production code.
Changes:
- Tests format dispatch, bidirectional S16/S24 conversion, saturation, rounding, and circular-buffer wrapping.
- Covers IPC4 payload handling, preparation, channel propagation, passthrough selection, and coefficient-based processing.
- Adds standalone test support and build configuration.
| File | Description |
|---|---|
test/ztest/unit/audio/selector/testcase.yaml |
Registers the native_sim test suite and tags. |
test/ztest/unit/audio/selector/selector_ztest.c |
Adds selector processing and component-level tests. |
test/ztest/unit/audio/selector/selector_test_support.c |
Supplies minimal SOF context and allocation helpers. |
test/ztest/unit/audio/selector/prj.conf |
Enables ztest, IPC4, selector, and sample formats. |
test/ztest/unit/audio/selector/CMakeLists.txt |
Builds the standalone suite with selector dependencies. |
Review effort: Balanced
Comment on lines
+571
to
+573
| zassert_ok(ops->prepare(mod, fixture->sources, 1, fixture->sinks, 1)); | ||
| zassert_equal(audio_stream_get_channels(&fixture->source->stream), 2); | ||
| zassert_equal(audio_stream_get_channels(&fixture->sink->stream), 1); |
PR 11401: test resultsRun date: 2026-11-04 13:25 UTC Tested commit: e36675f7177635a3450eaab8b5fb015b812c0790 |
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 native_sim tests for the functionality implemented in #11370, covering selector format dispatch, sample conversion, saturation, rounding, and circular-buffer wrapping.
Cover component preparation, IPC4 payload handling, channel propagation, passthrough selection, and coefficient-based processing.