Skip to content

test: selector: add ztest unit tests - #11401

Open
piotrhoppeintel wants to merge 1 commit into
thesofproject:mainfrom
piotrhoppeintel:ztest-ut-audio-selector
Open

piotrhoppeintel wants to merge 1 commit into
thesofproject:mainfrom
piotrhoppeintel:ztest-ut-audio-selector

Conversation

@piotrhoppeintel

Copy link
Copy Markdown
Contributor

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.

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
piotrhoppeintel marked this pull request as ready for review November 4, 2026 13:04
Copilot AI balanced review requested due to automatic review settings November 4, 2026 13:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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);
@intel-sofci

Copy link
Copy Markdown

PR 11401: test results

Run date: 2026-11-04 13:25 UTC

Tested commit: e36675f7177635a3450eaab8b5fb015b812c0790

mtl pass rate lnl pass rate ptl pass rate wcl pass rate nvl pass rate

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.

3 participants