Skip to content

ut: cmocka test cleanup#10965

Open
tmleman wants to merge 6 commits into
thesofproject:mainfrom
tmleman:topic/upstream/pr/unit_test/cmocka/cleanup
Open

ut: cmocka test cleanup#10965
tmleman wants to merge 6 commits into
thesofproject:mainfrom
tmleman:topic/upstream/pr/unit_test/cmocka/cleanup

Conversation

@tmleman

@tmleman tmleman commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Removing legacy tests that have already been ported to ztest.

Copilot AI review requested due to automatic review settings June 30, 2026 10:45

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.

Pull request overview

Removes legacy cmocka math/arithmetic unit tests that have already been ported to Zephyr ztest, reducing duplication in the test suite while keeping coverage via the newer ztest equivalents.

Changes:

  • Deleted cmocka-based arithmetic math tests for sqrt, power, exp, and logarithms.
  • Updated the cmocka arithmetic CMakeLists.txt to drop the removed test targets (leaving a_law_codec and mu_law_codec).

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
test/cmocka/src/math/arithmetic/square_root.c Removed legacy cmocka sqrt test (ported to ztest).
test/cmocka/src/math/arithmetic/scalar_power.c Removed legacy cmocka power test (ported to ztest).
test/cmocka/src/math/arithmetic/exponential.c Removed legacy cmocka exp/db2lin tests (ported to ztest).
test/cmocka/src/math/arithmetic/base2_logarithm.c Removed legacy cmocka log2 test (ported to ztest).
test/cmocka/src/math/arithmetic/base_10_logarithm.c Removed legacy cmocka log10 test (ported to ztest).
test/cmocka/src/math/arithmetic/base_e_logarithm.c Removed legacy cmocka ln test (ported to ztest).
test/cmocka/src/math/arithmetic/CMakeLists.txt Removed cmocka targets for the deleted tests.

tmleman added 6 commits June 30, 2026 14:07
This patch removes the scalar power test that has been successfully
converted from cmocka to ztest.

The ztest equivalent is in test/ztest/unit/math/advanced/functions/
test_scalar_power_ztest.c and was merged in PR thesofproject#10364.

Ztest coverage for power.c:
- lines: 92.9% (13/14)
- funcs: 100% (1/1)

Code coverage testing did not reveal any regression.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
This patch removes the base-2 logarithm test that has been successfully
converted from cmocka to ztest.

The ztest equivalent is in test/ztest/unit/math/advanced/functions/
test_base2_logarithm_ztest.c and was merged in PR thesofproject#10590.

Ztest coverage for base2log.c:
- lines: 100% (21/21)
- funcs: 100% (1/1)

Note: base2log.c remains covered by the cmocka auditory test as well,
which uses it as a dependency.

Code coverage testing did not reveal any regression.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
This patch removes the exponential test that has been successfully
converted from cmocka to ztest.

The ztest equivalent is in test/ztest/unit/math/advanced/functions/
test_exponential_ztest.c and was merged in PR thesofproject#10590.

Ztest coverage for exp_fcn.c:
- lines: 100% (59/59)
- funcs: 100% (3/3)

The ztest version tests sofm_exp_approx(), sofm_exp_fixed(), and
sofm_db2lin_fixed() with full line coverage.

Code coverage testing did not reveal any regression.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
This patch removes the square root test that has been successfully
converted from cmocka to ztest.

The ztest equivalent is in test/ztest/unit/math/advanced/functions/
test_square_root_ztest.c and was merged in PR thesofproject#10764.

Ztest coverage for sqrt_int16.c:
- lines: 100% (27/27)
- funcs: 100% (1/1)

Code coverage testing did not reveal any regression.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
This patch removes the base-10 logarithm test that has been successfully
converted from cmocka to ztest.

The ztest equivalent is in test/ztest/unit/math/advanced/functions/
test_base10_logarithm_ztest.c and was merged in PR thesofproject#10764.

Ztest coverage for log_10.c:
- lines: 100% (2/2)
- funcs: 100% (1/1)

Code coverage testing did not reveal any regression.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
This patch removes the base-e logarithm test that has been successfully
converted from cmocka to ztest.

The ztest equivalent is in test/ztest/unit/math/advanced/functions/
test_base_e_logarithm_ztest.c and was merged in PR thesofproject#10764.

Ztest coverage for log_e.c:
- lines: 100% (2/2)
- funcs: 100% (1/1)

Code coverage testing did not reveal any regression.

Signed-off-by: Tomasz Leman <tomasz.m.leman@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.

2 participants