Skip to content

bug: test/cmocka: 4 tests do not build with cmocka 1.1.7 (Debian 13, Ubuntu 24.04) #2197

Closed

Description

@vpacher

Location

With ENABLE_UNIT_TESTS=ON, 4 test files do not compile against cmocka 1.1.7. They use cmocka 2.x behavior.

test/cmocka/CMakeLists.txt:3 has find_package(CMocka CONFIG REQUIRED) with no version. Thus configure accepts 1.1.7, and the build stops later.

Class

Build failure (portability). No runtime effect.

How it is reached

Build master (1eaa4e1ff) on Debian 13 (gcc 14.2, libcmocka-dev 1.1.7-3) with ENABLE_UNIT_TESTS=ON, and build target cmocka-tests (-k 0). Result: 4 FAILED: objects, the 4 files above. All other tests build.

CI does not see this: the Linux jobs run on Ubuntu 26.04, which has cmocka 2.0.2. Ubuntu 24.04 and 25.10 have 1.1.7-3, the same as Debian 13.

Proposed fix and failing test

Decision needed: which cmocka versions do the tests support?

  • A. Support 1.1.7 (recommended). Add #include <stdbool.h> to test_obs_ffmpeg_net_host.c. Add a small compat header (for example test/cmocka/cmocka-compat.h) that defines assert_int_in_range() with assert_in_range() when cmocka does not define it, and include it in the 3 xcomposite tests. All 5 ranges have a minimum of 0 or more, so the unsigned assert_in_range() of 1.1.7 gives the same result. With cmocka 2.x the header does nothing, so the deprecated assert_in_range() is not used there.
  • B. Require cmocka 2.0. find_package(CMocka 2.0 CONFIG REQUIRED), and document it in the build docs. Debian 13 and Ubuntu 24.04 builds then stop at configure with a clear message. Nothing else changes.

Test (RED → GREEN): a CI job, or a Tier 2 step, that builds cmocka-tests against cmocka 1.1.7 (for example in a debian:13 container). RED on master: the 4 objects above fail. GREEN with A: the target builds, and the 4 tests pass. With B, the check is that configure fails with the version message.

I can make the PR for A (or B) after a decision.

Activity

  1. vpacher commented on Oct 24, 2026

    @vpacher
    MemberAuthor

    Claiming: #2197

    Decision needed: which cmocka versions do the tests support? A: keep cmocka 1.1.7 working (<stdbool.h> in test_obs_ffmpeg_net_host.c, and a compat header that maps assert_int_in_range() to assert_in_range() when cmocka 1.x does not define it). B: require cmocka 2.0 in find_package, so configure stops on Debian 13 and Ubuntu 24.04. I recommend A. The PR waits for the answer.

  2. added
    decision-needed
    claimed
    on Oct 24, 2026
  3. zackees commented on Oct 24, 2026

    @zackees
    Member

    Decided: A, keep cmocka 1.1.7 working.

    (Coordinator decision.)

  4. removed
    decision-needed
    on Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    claimed

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions