Expand gtest coverage across recently changed modules

Adds ~60 new unit tests covering the modules touched in recent bug-fix
passes and UI refactors:

- RenderTicket: result/finish-count semantics, empty watcher defaults,
  ticket-reuse rejection
- Preferences tabs: behavior options migrated into General/Audio tabs,
  translation context helper, audio-tab initialization
- NodeView: context management, 'Show in Parameter Editor' action wiring
- PreviewAutoCacher: construction, pause toggles, single-frame render
  cancellation, force-cache range
- SeekableWidget/TimeBasedWidget: scroll, marker editing, context reset
- OCIOLutNode: empty/missing/unsupported LUT paths, string direction
  values, file-switching regression coverage
- ProxyManager: working filename, disabled state, empty proxy fields
- Frame/VideoParams/AudioParams/Timecode/ExportFormat/ExportCodec:
  additional edge-case and enumeration coverage

Also fixes the PreferencesAudioTab test crash by initializing
AudioManager in the offscreen test environment.

All tests pass: ctest --output-on-failure
This commit is contained in:
2026-07-13 10:19:30 +08:00
parent b47887e127
commit b7ff687220
14 changed files with 1047 additions and 48 deletions
@@ -102,6 +102,43 @@ TEST(RenderVideoParams, ValidityAndTimebase)
12);
}
TEST(RenderVideoParams, CopyConstructorPreservesValues)
{
olive::VideoParams params(1920, 1080, olive::core::rational(24, 1),
olive::core::PixelFormat::F32, 4);
params.set_colorspace(QStringLiteral("ACEScg"));
olive::VideoParams copy(params);
EXPECT_EQ(copy.width(), 1920);
EXPECT_EQ(copy.height(), 1080);
EXPECT_EQ(copy.format(), olive::core::PixelFormat::F32);
EXPECT_EQ(copy.channel_count(), 4);
EXPECT_EQ(copy.colorspace(), QStringLiteral("ACEScg"));
}
TEST(RenderVideoParams, AssignmentPreservesValues)
{
olive::VideoParams params(1280, 720, olive::core::rational(30, 1),
olive::core::PixelFormat::U16, 4);
olive::VideoParams copy;
copy = params;
EXPECT_EQ(copy.width(), 1280);
EXPECT_EQ(copy.height(), 720);
EXPECT_EQ(copy.format(), olive::core::PixelFormat::U16);
}
TEST(RenderVideoParams, EqualityComparesDimensionsAndFormat)
{
olive::VideoParams a(1920, 1080, olive::core::PixelFormat::U8, 4);
olive::VideoParams b(1920, 1080, olive::core::PixelFormat::U8, 4);
olive::VideoParams c(1280, 720, olive::core::PixelFormat::U8, 4);
olive::VideoParams d(1920, 1080, olive::core::PixelFormat::F32, 4);
EXPECT_EQ(a, b);
EXPECT_NE(a, c);
EXPECT_NE(a, d);
}
TEST(RenderVideoParams, SaveLoadRoundTripExtended)
{
olive::VideoParams params(1920, 1080, olive::core::rational(1, 24),