Skip to content

Commit 3e3cf99

Browse files
committed
review: trim duplicate SUNSHINE_FORMAT_* static_asserts from test_video
Per Copilot review: tests/unit/test_video.cpp:10-13 duplicated the exact static_asserts that already live next to the enumerator declarations in src/video.h:28-31. Renumbering a format would require keeping the two lists in sync. Replace with a single test-relevant invariant — SUNSHINE_FORMAT_COUNT must equal PRORES + 1 — and link the comment back to where the authoritative assertions live. The H264/HEVC/AV1/PRORES==N value constraints stay in src/video.h where they belong (next to the constants themselves).
1 parent eedcf8f commit 3e3cf99

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

tests/unit/test_video.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
#include <src/config.h>
88
#include <src/video.h>
99

10-
static_assert(video::SUNSHINE_FORMAT_H264 == 0);
11-
static_assert(video::SUNSHINE_FORMAT_HEVC == 1);
12-
static_assert(video::SUNSHINE_FORMAT_AV1 == 2);
13-
static_assert(video::SUNSHINE_FORMAT_PRORES == 3);
14-
static_assert(video::SUNSHINE_FORMAT_COUNT == 4);
10+
// SUNSHINE_FORMAT_* enumerator-value invariants are asserted next to the
11+
// definitions in src/video.h:28-31; not duplicated here. The COUNT
12+
// sentinel is the test-relevant invariant — it gates is_known_video_format
13+
// and must follow PRORES.
14+
static_assert(video::SUNSHINE_FORMAT_COUNT == video::SUNSHINE_FORMAT_PRORES + 1);
1515

1616
struct EncoderTest: PlatformTestSuite, testing::WithParamInterface<video::encoder_t *> {
1717
void SetUp() override {

0 commit comments

Comments
 (0)