style: unify identifier naming per updated conventions
Automated with clang-tidy readability-identifier-naming (config added to .clang-tidy) plus scripted passes, per the updated rules now documented in CONTRIBUTING.md: - types (class/struct/enum/alias/template params): PascalCase - functions, variables, members: snake_case (incl. rational -> Rational) - private/protected members: trailing underscore; static member variables likewise (instance_, available_themes_) - constants and enum values: snake_case (kLinear -> k_linear, F32P -> f32p); ALL_CAPS reserved for macros - macros: OAK_ prefix (OLIVE_ADD_TEST/OLIVE_ASSERT/OLIVE_CONFIG -> OAK_ADD_TEST/OAK_ASSERT/OAK_CONFIG, GL_PREAMBLE -> OAK_GL_PREAMBLE, include guards -> OAK_*) - file names: all lowercase (Current/Plugin/OliveHost/OliveClip/ OlivePluginInstance -> current/plugin/olivehost/oliveclip/ oliveplugininstance) - getters share the member name sans underscore, setters set_foo() - Qt and third-party (OpenFX) virtual overrides and framework callbacks keep their original names (exempt in .clang-tidy) Manual follow-ups required where automation could not reach: - string-based QMetaObject/SIGNAL/SLOT references updated to renamed methods (AddTask, CreatedFile, DeleteSpecificFile, moveSelectionUp, ...) - macro bodies referencing renamed methods (OLIVE_CONFIG, NODE_DEFAULT_DESTRUCTOR, MANAGEDDISPLAYWIDGET_*) - self-shadowing locals renamed where signals/methods became same-named (size_changed, worker_count, selected_items, import param, filters) - third_party OFX member/namespace usages restored (OFX::Host::*, _created, _clipPrefsDirty, createInstance, clearPersistentMessage) - STL protocol aliases restored (const_iterator) with .clang-tidy ignore rules; qHash overloads restored Full build and test suite pass: ctest 4/4, ~1960 gtest cases green.
This commit is contained in:
@@ -7,27 +7,27 @@
|
||||
TEST(TimeBasedWidget, ConnectViewerNodeNullSafe)
|
||||
{
|
||||
olive::TimeBasedWidget widget(false, false);
|
||||
widget.ConnectViewerNode(nullptr);
|
||||
EXPECT_EQ(widget.GetConnectedNode(), nullptr);
|
||||
widget.connect_viewer_node(nullptr);
|
||||
EXPECT_EQ(widget.get_connected_node(), nullptr);
|
||||
}
|
||||
|
||||
TEST(TimeBasedWidget, ConnectedNodeClearsOnDelete)
|
||||
{
|
||||
olive::TimeBasedWidget widget(false, false);
|
||||
auto *viewer = new olive::ViewerOutput();
|
||||
widget.ConnectViewerNode(viewer);
|
||||
EXPECT_EQ(widget.GetConnectedNode(), viewer);
|
||||
widget.connect_viewer_node(viewer);
|
||||
EXPECT_EQ(widget.get_connected_node(), viewer);
|
||||
delete viewer;
|
||||
EXPECT_EQ(widget.GetConnectedNode(), nullptr);
|
||||
EXPECT_EQ(widget.get_connected_node(), 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);
|
||||
EXPECT_FALSE(widget.is_dragging_playhead());
|
||||
EXPECT_FALSE(widget.has_items_selected());
|
||||
EXPECT_EQ(widget.get_markers(), nullptr);
|
||||
EXPECT_EQ(widget.get_work_area(), nullptr);
|
||||
}
|
||||
|
||||
TEST(SeekableWidget, SetScrollAdjustsScrollBar)
|
||||
@@ -35,25 +35,25 @@ TEST(SeekableWidget, SetScrollAdjustsScrollBar)
|
||||
olive::SeekableWidget widget;
|
||||
widget.resize(400, 100);
|
||||
|
||||
widget.SetScroll(0);
|
||||
EXPECT_EQ(widget.GetScroll(), 0);
|
||||
widget.set_scroll(0);
|
||||
EXPECT_EQ(widget.get_scroll(), 0);
|
||||
|
||||
// Give the scene a deterministic length much wider than the viewport so
|
||||
// the horizontal scrollbar gains a non-zero range (60 seconds at
|
||||
// 100 px/second)
|
||||
widget.SetTimebase(olive::rational(1, 30));
|
||||
widget.SetScale(100.0);
|
||||
widget.SetEndTime(olive::rational(60));
|
||||
widget.set_timebase(olive::Rational(1, 30));
|
||||
widget.set_scale(100.0);
|
||||
widget.set_end_time(olive::Rational(60));
|
||||
|
||||
const int max_scroll = widget.horizontalScrollBar()->maximum();
|
||||
ASSERT_GT(max_scroll, 0);
|
||||
|
||||
widget.SetScroll(max_scroll);
|
||||
EXPECT_EQ(widget.GetScroll(), max_scroll);
|
||||
widget.set_scroll(max_scroll);
|
||||
EXPECT_EQ(widget.get_scroll(), max_scroll);
|
||||
|
||||
// Values beyond the range clamp to the scrollbar's maximum
|
||||
widget.SetScroll(max_scroll + 1000);
|
||||
EXPECT_EQ(widget.GetScroll(), max_scroll);
|
||||
widget.set_scroll(max_scroll + 1000);
|
||||
EXPECT_EQ(widget.get_scroll(), max_scroll);
|
||||
}
|
||||
|
||||
TEST(SeekableWidget, SetMarkersAndWorkAreaAreReflected)
|
||||
@@ -63,21 +63,21 @@ TEST(SeekableWidget, SetMarkersAndWorkAreaAreReflected)
|
||||
olive::TimelineMarkerList markers;
|
||||
olive::TimelineWorkArea workarea;
|
||||
|
||||
widget.SetMarkers(&markers);
|
||||
widget.SetWorkArea(&workarea);
|
||||
widget.set_markers(&markers);
|
||||
widget.set_work_area(&workarea);
|
||||
|
||||
EXPECT_EQ(widget.GetMarkers(), &markers);
|
||||
EXPECT_EQ(widget.GetWorkArea(), &workarea);
|
||||
EXPECT_EQ(widget.get_markers(), &markers);
|
||||
EXPECT_EQ(widget.get_work_area(), &workarea);
|
||||
}
|
||||
|
||||
TEST(SeekableWidget, MarkerEditingEnabledToggles)
|
||||
{
|
||||
olive::SeekableWidget widget;
|
||||
EXPECT_TRUE(widget.IsMarkerEditingEnabled());
|
||||
EXPECT_TRUE(widget.is_marker_editing_enabled());
|
||||
|
||||
widget.SetMarkerEditingEnabled(false);
|
||||
EXPECT_FALSE(widget.IsMarkerEditingEnabled());
|
||||
widget.set_marker_editing_enabled(false);
|
||||
EXPECT_FALSE(widget.is_marker_editing_enabled());
|
||||
|
||||
widget.SetMarkerEditingEnabled(true);
|
||||
EXPECT_TRUE(widget.IsMarkerEditingEnabled());
|
||||
widget.set_marker_editing_enabled(true);
|
||||
EXPECT_TRUE(widget.is_marker_editing_enabled());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user