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.

@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

@intel-sofci

intel-sofci commented Nov 4, 2026 •

Copy link
Copy Markdown

PR 11401: test results

Run date: 2026-11-10 17:42 UTC

Tested commit: 64f3bd8af3ea65ec70a6fece3bc6c70319aec251

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

@kv2019i kv2019i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Good to see more test content added. Some notes inline.

/**
* @brief Return the minimal SOF context used by selector ztests.
*/
struct sof *sof_get(void)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hmm, we have lot of ztests that need these, I wonder if there is aready some way to reuse these? We have the posix rtos implementation used e.g. by fuzzers, can that be used here?

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

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.

Signed-off-by: Piotr Hoppe <piotr.hoppe@intel.com>
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.

5 participants