Skip to content

tests: fix unit test link error in Debug builds - #21857

Merged
TurboGit merged 1 commit into
darktable-org:masterfrom
da-phil:fix_filmicrgb_tests_for_debug_builds
Aug 16, 2026
Merged

tests: fix unit test link error in Debug builds#21857
TurboGit merged 1 commit into
darktable-org:masterfrom
da-phil:fix_filmicrgb_tests_for_debug_builds

Conversation

@da-phil

@da-phil da-phil commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Background: get_pixel() was defined as a plain C99 inline in testimg.h, which is not an external definition.
Release builds inline it away, but at -O0 or when enabling debug symbols every call site emits a reference to an out-of-line symbol that no translation unit provides, breaking the link of test_filmicrgb.
Solution: Make it static inline.

This hasn't been caught by our newly added unit test to the gitlab ci, because it builds darktable via -O3 -DNDEBUG.

get_pixel() was defined as a plain C99 `inline` in testimg.h, which is not
an external definition. Release builds inline it away, but at -O0 every call
site emits a reference to an out-of-line symbol that no translation unit
provides, breaking the link of test_filmicrgb. Make it `static inline`.
@da-phil da-phil changed the title Fix unit test link error in Debug builds tests: fix unit test link error in Debug builds Aug 15, 2026
@TurboGit TurboGit added this to the 5.8 milestone Aug 16, 2026
@TurboGit TurboGit added the bugfix pull request fixing a bug label Aug 16, 2026

@TurboGit TurboGit left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@TurboGit
TurboGit merged commit 13f3092 into darktable-org:master Aug 16, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix pull request fixing a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants