Skip to content

test: selector: add ztest unit tests - #11401

Merged
kv2019i merged 1 commit into
thesofproject:mainfrom
piotrhoppeintel:ztest-ut-audio-selector
Nov 17, 2026
Merged

kv2019i merged 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-16 20:42 UTC

Tested commit: 78977b3ed19549a55518cd14d3c2b8ecbc577f06

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.

@piotrhoppeintel
piotrhoppeintel force-pushed the ztest-ut-audio-selector branch 2 times, most recently from c94ade6 to 64f3bd8 Compare November 10, 2026 16:28
@lgirdwood

Copy link
Copy Markdown
Member

looks like CI is getting stuck will rerun.

@lgirdwood

Copy link
Copy Markdown
Member

SOFCI TEST

@lgirdwood

Copy link
Copy Markdown
Member

@piotrhoppeintel can you check CI, seems stuck. Thanks !

@piotrhoppeintel
piotrhoppeintel force-pushed the ztest-ut-audio-selector branch 2 times, most recently from 8509ccf to 2422d7b Compare November 13, 2026 17:33
@piotrhoppeintel

piotrhoppeintel commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor Author

@lgirdwood I synced with the master branch, and all checks passed.

@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.

The common code needs to be shared

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>

@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.

Thanks, look good now!

@kv2019i
kv2019i merged commit c86b980 into thesofproject:main Nov 17, 2026
44 checks passed
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.

6 participants