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:
@@ -1,6 +1,7 @@
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include "widget/timebased/timebasedwidget.h"
|
||||
#include "widget/timeruler/seekablewidget.h"
|
||||
#include "node/output/viewer/viewer.h"
|
||||
|
||||
TEST(TimeBasedWidget, ConnectViewerNodeNullSafe)
|
||||
@@ -19,3 +20,53 @@ TEST(TimeBasedWidget, ConnectedNodeClearsOnDelete)
|
||||
delete viewer;
|
||||
EXPECT_EQ(widget.GetConnectedNode(), nullptr);
|
||||
}
|
||||
|
||||
TEST(SeekableWidget, ConstructionInitializesDefaults)
|
||||
{
|
||||
olive::SeekableWidget widget;
|
||||
EXPECT_FALSE(widget.IsDraggingPlayhead());
|
||||
EXPECT_FALSE(widget.HasItemsSelected());
|
||||
EXPECT_EQ(widget.GetMarkers(), nullptr);
|
||||
EXPECT_EQ(widget.GetWorkArea(), nullptr);
|
||||
}
|
||||
|
||||
TEST(SeekableWidget, SetScrollAdjustsScrollBar)
|
||||
{
|
||||
olive::SeekableWidget widget;
|
||||
widget.resize(400, 100);
|
||||
|
||||
widget.SetScroll(0);
|
||||
EXPECT_EQ(widget.GetScroll(), 0);
|
||||
|
||||
int max_scroll = widget.horizontalScrollBar()->maximum();
|
||||
if (max_scroll > 0) {
|
||||
widget.SetScroll(max_scroll);
|
||||
EXPECT_EQ(widget.GetScroll(), max_scroll);
|
||||
}
|
||||
}
|
||||
|
||||
TEST(SeekableWidget, SetMarkersAndWorkAreaAreReflected)
|
||||
{
|
||||
olive::SeekableWidget widget;
|
||||
|
||||
olive::TimelineMarkerList markers;
|
||||
olive::TimelineWorkArea workarea;
|
||||
|
||||
widget.SetMarkers(&markers);
|
||||
widget.SetWorkArea(&workarea);
|
||||
|
||||
EXPECT_EQ(widget.GetMarkers(), &markers);
|
||||
EXPECT_EQ(widget.GetWorkArea(), &workarea);
|
||||
}
|
||||
|
||||
TEST(SeekableWidget, MarkerEditingEnabledToggles)
|
||||
{
|
||||
olive::SeekableWidget widget;
|
||||
EXPECT_TRUE(widget.IsMarkerEditingEnabled());
|
||||
|
||||
widget.SetMarkerEditingEnabled(false);
|
||||
EXPECT_FALSE(widget.IsMarkerEditingEnabled());
|
||||
|
||||
widget.SetMarkerEditingEnabled(true);
|
||||
EXPECT_TRUE(widget.IsMarkerEditingEnabled());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user