Skip to content

Commit 8cb56a6

Browse files
tmlemanCopilot
andcommitted
cmocka: Remove dct test
The DCT (Discrete Cosine Transform) matrix generation code is already fully covered by the ztest port at test/ztest/unit/math/dct/. Remove the now-redundant CMocka test and its CMakeLists.txt stanza, along with the whole dct/ subdirectory (it was the last remaining test there). Move the reference DCT matrices and their Octave/MATLAB generator scripts reused by the ztest port (ref_dct_matrix_16_test{1,2}.h, mfcc_get_dct_matrix.m, ref_dct.m) with git mv into test/ztest/unit/math/dct/ to preserve file history, and drop the now-unneeded CMocka include path from the ztest CMakeLists.txt. CMock stats for src/math/dct.c: - lines: 100% (29/29) - branches: 65% (13/20) Ztest stats for src/math/dct.c: - lines: 86% (25/29) - branches: 65% (13/20) Branch coverage is identical between the two builds, including the same missing branches, confirming equivalent test behaviour. The line percentage difference is a gcc vs clang line-hit accounting artifact for the same source file, not a regression. Assisted-by: Copilot:claude-sonnet-5 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
1 parent 5cee6b4 commit 8cb56a6

9 files changed

Lines changed: 2 additions & 126 deletions

File tree

‎test/cmocka/src/math/CMakeLists.txt‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@
22

33
add_subdirectory(fft)
44
add_subdirectory(window)
5-
add_subdirectory(dct)

‎test/cmocka/src/math/dct/CMakeLists.txt‎

Lines changed: 0 additions & 9 deletions
This file was deleted.

‎test/cmocka/src/math/dct/dct.c‎

Lines changed: 0 additions & 110 deletions
This file was deleted.

‎test/ztest/unit/math/dct/CMakeLists.txt‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ target_include_directories(app PRIVATE
1818
${SOF_ROOT}/src/include
1919
${SOF_ROOT}/src/kernel/platform/posix/include
2020
${SOF_ROOT}/test/ztest/unit/common
21-
# Reference test vectors are #included in place from the CMocka tree
22-
# rather than copied, so both frameworks share identical data.
23-
${SOF_ROOT}/test/cmocka/src/math/dct
2421
${PROJECT_BINARY_DIR}/include/generated
2522
)
2623

File renamed without changes.
File renamed without changes.
File renamed without changes.

‎test/ztest/unit/math/dct/test_dct_ztest.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@
1919
#include <stdint.h>
2020
#include <math.h>
2121

22-
/* Reference DCT matrices shared with the legacy CMocka test. They are
23-
* #included in place from the CMocka tree (added to the include path in
24-
* CMakeLists.txt) so the exact same fixed-point data is exercised.
22+
/* Reference DCT matrices were moved here from the legacy CMocka tree
23+
* (test/cmocka/src/math/dct/) when that CMocka test was removed.
2524
*/
2625
#include "ref_dct_matrix_16_test1.h"
2726
#include "ref_dct_matrix_16_test2.h"

0 commit comments

Comments
 (0)