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
+31
View File
@@ -18,3 +18,34 @@ TEST(CodecExportCodec, NamesAndFlags)
EXPECT_TRUE(ExportCodec::IsCodecLossless(ExportCodec::kCodecFLAC));
EXPECT_FALSE(ExportCodec::IsCodecLossless(ExportCodec::kCodecH265));
}
TEST(CodecExportCodec, VideoCodecNamesAreNonEmpty)
{
using olive::ExportCodec;
for (int i = 0; i < ExportCodec::kCodecCount; ++i) {
const auto codec = static_cast<ExportCodec::Codec>(i);
const QString name = ExportCodec::GetCodecName(codec);
EXPECT_FALSE(name.isEmpty()) << "Codec " << i;
}
}
TEST(CodecExportCodec, AudioCodecsAreNotStillImages)
{
using olive::ExportCodec;
EXPECT_FALSE(ExportCodec::IsCodecAStillImage(ExportCodec::kCodecPCM));
EXPECT_FALSE(ExportCodec::IsCodecAStillImage(ExportCodec::kCodecAAC));
EXPECT_FALSE(ExportCodec::IsCodecAStillImage(ExportCodec::kCodecFLAC));
EXPECT_FALSE(ExportCodec::IsCodecAStillImage(ExportCodec::kCodecOpus));
}
TEST(CodecExportCodec, LossyCodecsAreNotLossless)
{
using olive::ExportCodec;
EXPECT_FALSE(ExportCodec::IsCodecLossless(ExportCodec::kCodecH264));
EXPECT_FALSE(ExportCodec::IsCodecLossless(ExportCodec::kCodecH265));
EXPECT_FALSE(ExportCodec::IsCodecLossless(ExportCodec::kCodecVP9));
EXPECT_FALSE(ExportCodec::IsCodecLossless(ExportCodec::kCodecAAC));
}