#include #include "codec/exportformat.h" TEST(CodecExportFormat, NamesAndExtensions) { using olive::ExportFormat; EXPECT_EQ(ExportFormat::GetName(ExportFormat::kFormatDNxHD), QStringLiteral("DNxHD")); EXPECT_EQ(ExportFormat::GetExtension(ExportFormat::kFormatDNxHD), QStringLiteral("mxf")); EXPECT_EQ(ExportFormat::GetName(ExportFormat::kFormatCount), QStringLiteral("Unknown")); EXPECT_TRUE(ExportFormat::GetExtension(ExportFormat::kFormatCount).isEmpty()); } TEST(CodecExportFormat, CodecLists) { using olive::ExportCodec; using olive::ExportFormat; const QList matroska_video = ExportFormat::GetVideoCodecs(ExportFormat::kFormatMatroska); EXPECT_TRUE(matroska_video.contains(ExportCodec::kCodecH264)); EXPECT_TRUE(matroska_video.contains(ExportCodec::kCodecVP9)); const QList ogg_audio = ExportFormat::GetAudioCodecs(ExportFormat::kFormatOgg); EXPECT_TRUE(ogg_audio.contains(ExportCodec::kCodecOpus)); EXPECT_TRUE(ogg_audio.contains(ExportCodec::kCodecVorbis)); const QList png_video = ExportFormat::GetVideoCodecs(ExportFormat::kFormatPNG); EXPECT_EQ(png_video, QList{ ExportCodec::kCodecPNG }); const QList srt_subs = ExportFormat::GetSubtitleCodecs(ExportFormat::kFormatMatroska); EXPECT_EQ(srt_subs, QList{ ExportCodec::kCodecSRT }); const QList wav_audio = ExportFormat::GetAudioCodecs(ExportFormat::kFormatWAV); EXPECT_EQ(wav_audio, QList{ ExportCodec::kCodecPCM }); }