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:
2026-07-19 16:10:54 +08:00
parent cb1718a103
commit bb40b4923e
1014 changed files with 44257 additions and 44220 deletions
+26 -26
View File
@@ -6,23 +6,23 @@ TEST(CodecExportFormat, NamesAndExtensions)
{
using olive::ExportFormat;
EXPECT_EQ(ExportFormat::GetName(ExportFormat::kFormatDNxHD),
EXPECT_EQ(ExportFormat::get_name(ExportFormat::k_format_d_nx_hd),
QStringLiteral("DNxHD"));
EXPECT_EQ(ExportFormat::GetExtension(ExportFormat::kFormatDNxHD),
EXPECT_EQ(ExportFormat::get_extension(ExportFormat::k_format_d_nx_hd),
QStringLiteral("mxf"));
EXPECT_EQ(ExportFormat::GetName(ExportFormat::kFormatCount),
EXPECT_EQ(ExportFormat::get_name(ExportFormat::k_format_count),
QStringLiteral("Unknown"));
EXPECT_TRUE(
ExportFormat::GetExtension(ExportFormat::kFormatCount).isEmpty());
ExportFormat::get_extension(ExportFormat::k_format_count).isEmpty());
}
TEST(CodecExportFormat, AllFormatsHaveNames)
{
using olive::ExportFormat;
for (int i = 0; i < ExportFormat::kFormatCount; ++i) {
for (int i = 0; i < ExportFormat::k_format_count; ++i) {
const auto fmt = static_cast<ExportFormat::Format>(i);
EXPECT_FALSE(ExportFormat::GetName(fmt).isEmpty()) << "Format " << i;
EXPECT_FALSE(ExportFormat::get_name(fmt).isEmpty()) << "Format " << i;
}
}
@@ -30,11 +30,11 @@ TEST(CodecExportFormat, AllFormatsHaveAtLeastOneCodecList)
{
using olive::ExportFormat;
for (int i = 0; i < ExportFormat::kFormatCount; ++i) {
for (int i = 0; i < ExportFormat::k_format_count; ++i) {
const auto fmt = static_cast<ExportFormat::Format>(i);
EXPECT_FALSE(ExportFormat::GetVideoCodecs(fmt).isEmpty() &&
ExportFormat::GetAudioCodecs(fmt).isEmpty() &&
ExportFormat::GetSubtitleCodecs(fmt).isEmpty())
EXPECT_FALSE(ExportFormat::get_video_codecs(fmt).isEmpty() &&
ExportFormat::get_audio_codecs(fmt).isEmpty() &&
ExportFormat::get_subtitle_codecs(fmt).isEmpty())
<< "Format " << i;
}
}
@@ -45,26 +45,26 @@ TEST(CodecExportFormat, CodecLists)
using olive::ExportFormat;
const QList<ExportCodec::Codec> matroska_video =
ExportFormat::GetVideoCodecs(ExportFormat::kFormatMatroska);
EXPECT_TRUE(matroska_video.contains(ExportCodec::kCodecH264));
EXPECT_TRUE(matroska_video.contains(ExportCodec::kCodecVP9));
ExportFormat::get_video_codecs(ExportFormat::k_format_matroska);
EXPECT_TRUE(matroska_video.contains(ExportCodec::k_codec_h264));
EXPECT_TRUE(matroska_video.contains(ExportCodec::k_codec_v_p9));
const QList<ExportCodec::Codec> ogg_audio =
ExportFormat::GetAudioCodecs(ExportFormat::kFormatOgg);
EXPECT_TRUE(ogg_audio.contains(ExportCodec::kCodecOpus));
EXPECT_TRUE(ogg_audio.contains(ExportCodec::kCodecVorbis));
ExportFormat::get_audio_codecs(ExportFormat::k_format_ogg);
EXPECT_TRUE(ogg_audio.contains(ExportCodec::k_codec_opus));
EXPECT_TRUE(ogg_audio.contains(ExportCodec::k_codec_vorbis));
const QList<ExportCodec::Codec> png_video =
ExportFormat::GetVideoCodecs(ExportFormat::kFormatPNG);
EXPECT_EQ(png_video, QList<ExportCodec::Codec>{ ExportCodec::kCodecPNG });
ExportFormat::get_video_codecs(ExportFormat::k_format_png);
EXPECT_EQ(png_video, QList<ExportCodec::Codec>{ ExportCodec::k_codec_png });
const QList<ExportCodec::Codec> srt_subs =
ExportFormat::GetSubtitleCodecs(ExportFormat::kFormatMatroska);
EXPECT_EQ(srt_subs, QList<ExportCodec::Codec>{ ExportCodec::kCodecSRT });
ExportFormat::get_subtitle_codecs(ExportFormat::k_format_matroska);
EXPECT_EQ(srt_subs, QList<ExportCodec::Codec>{ ExportCodec::k_codec_srt });
const QList<ExportCodec::Codec> wav_audio =
ExportFormat::GetAudioCodecs(ExportFormat::kFormatWAV);
EXPECT_EQ(wav_audio, QList<ExportCodec::Codec>{ ExportCodec::kCodecPCM });
ExportFormat::get_audio_codecs(ExportFormat::k_format_wav);
EXPECT_EQ(wav_audio, QList<ExportCodec::Codec>{ ExportCodec::k_codec_pcm });
}
TEST(CodecExportFormat, MPEG4ContainsH264AndAAC)
@@ -72,8 +72,8 @@ TEST(CodecExportFormat, MPEG4ContainsH264AndAAC)
using olive::ExportCodec;
using olive::ExportFormat;
EXPECT_TRUE(ExportFormat::GetVideoCodecs(ExportFormat::kFormatMPEG4Video)
.contains(ExportCodec::kCodecH264));
EXPECT_TRUE(ExportFormat::GetAudioCodecs(ExportFormat::kFormatMPEG4Audio)
.contains(ExportCodec::kCodecAAC));
EXPECT_TRUE(ExportFormat::get_video_codecs(ExportFormat::k_format_mpe_g4_video)
.contains(ExportCodec::k_codec_h264));
EXPECT_TRUE(ExportFormat::get_audio_codecs(ExportFormat::k_format_mpe_g4_audio)
.contains(ExportCodec::k_codec_aac));
}