Skip to content

Commit 04a2068

Browse files
jcelerierclaude
andcommitted
tests: guard the V4L2 pin case for non-Linux hosts
The V4L2 round-trip case was inside #if defined(__linux__), but the pinned- constants case added alongside it was not, so every V4L2_PIX_FMT_* reference in it broke the build anywhere without linux/videodev2.h. Found by compiling on Windows, which is the only thing that could have found it: the Linux build is green either way, and nothing in review flags a missing guard on a block that sits next to a guarded one. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014rZgzE8JjWvHDtaVUhxpLE
1 parent 181b012 commit 04a2068

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

tests/unit/VideoPixelFormatTest.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,7 @@ TEST_CASE("every AV mapping is pinned to a named FFmpeg format", "[gfx][pixfmt][
750750
CHECK(pinned.size() == 60);
751751
}
752752

753+
#if defined(__linux__)
753754
// Every V4L2 fourcc pinned to the kernel constant. The round-trip sweep only
754755
// composes to/from, so swapping two same-geometry formats in BOTH directions --
755756
// NV12 with NV21 -- satisfies it while every camera silently delivers exchanged
@@ -850,6 +851,7 @@ TEST_CASE("every V4L2 mapping is pinned to a kernel constant", "[gfx][pixfmt][v4
850851
CHECK(vpf::fromV4L2PixelFormat(V4L2_PIX_FMT_Z16) == V::Mono16);
851852
#endif
852853
}
854+
#endif
853855

854856
// chromaSwappedTwin needs positive coverage: the sweep over described formats
855857
// skips anything returning Unknown, so deleting every case would pass vacuously.

0 commit comments

Comments
 (0)