Changeset View
Changeset View
Standalone View
Standalone View
autotests/taglibextractortest.cpp
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Line(s) | |||||
43 | { | 43 | { | ||
44 | QStringList result; | 44 | QStringList result; | ||
45 | for (auto key : keys) { | 45 | for (auto key : keys) { | ||
46 | result.append(PropertyInfo(key).name()); | 46 | result.append(PropertyInfo(key).name()); | ||
47 | } | 47 | } | ||
48 | return result; | 48 | return result; | ||
49 | } | 49 | } | ||
50 | 50 | | |||
51 | void TagLibExtractorTest::testPropertyTypes() | ||||
52 | { | ||||
53 | TagLibExtractor plugin{this}; | ||||
54 | | ||||
55 | SimpleExtractionResult resultOpus(testFilePath("test.opus"), "audio/opus"); | ||||
56 | plugin.extract(&resultOpus); | ||||
57 | | ||||
58 | auto testForType = [](SimpleExtractionResult &result, Property::Property prop) { | ||||
59 | QCOMPARE(result.properties().value(prop).type(), PropertyInfo(prop).valueType()); | ||||
60 | }; | ||||
61 | | ||||
62 | QCOMPARE(resultOpus.types().size(), 1); | ||||
63 | QCOMPARE(resultOpus.types().constFirst(), Type::Audio); | ||||
64 | testForType(resultOpus, Property::Title); | ||||
65 | QEXPECT_FAIL("", "Will be fixed in a following release", Continue); | ||||
66 | testForType(resultOpus, Property::Artist); | ||||
67 | testForType(resultOpus, Property::Album); | ||||
68 | QEXPECT_FAIL("", "Will be fixed in a following release", Continue); | ||||
69 | testForType(resultOpus, Property::AlbumArtist); | ||||
70 | QEXPECT_FAIL("", "Will be fixed in a following release", Continue); | ||||
71 | testForType(resultOpus, Property::Genre); | ||||
72 | testForType(resultOpus, Property::Comment); | ||||
73 | testForType(resultOpus, Property::Composer); | ||||
74 | QEXPECT_FAIL("", "Will be fixed in a following release", Continue); | ||||
75 | testForType(resultOpus, Property::Lyricist); | ||||
76 | QEXPECT_FAIL("", "Will be fixed in a following release", Continue); | ||||
77 | testForType(resultOpus, Property::Conductor); | ||||
78 | QEXPECT_FAIL("", "Will be fixed in a following release", Continue); | ||||
79 | testForType(resultOpus, Property::Arranger); | ||||
80 | testForType(resultOpus, Property::Ensemble); | ||||
81 | testForType(resultOpus, Property::Location); | ||||
82 | QEXPECT_FAIL("", "Will be fixed in a following release", Continue); | ||||
83 | testForType(resultOpus, Property::Performer); | ||||
84 | testForType(resultOpus, Property::Langauge); | ||||
85 | testForType(resultOpus, Property::Publisher); | ||||
86 | testForType(resultOpus, Property::Label); | ||||
87 | QEXPECT_FAIL("", "Will be fixed in a following release", Continue); | ||||
88 | testForType(resultOpus, Property::Author); | ||||
89 | testForType(resultOpus, Property::Copyright); | ||||
90 | testForType(resultOpus, Property::Compilation); | ||||
91 | testForType(resultOpus, Property::License); | ||||
92 | testForType(resultOpus, Property::Opus); | ||||
93 | QEXPECT_FAIL("", "Will be fixed in a following release", Continue); | ||||
94 | testForType(resultOpus, Property::TrackNumber); | ||||
95 | QEXPECT_FAIL("", "Will be fixed in a following release", Continue); | ||||
96 | testForType(resultOpus, Property::ReleaseYear); | ||||
97 | testForType(resultOpus, Property::Channels); | ||||
98 | testForType(resultOpus, Property::DiscNumber); | ||||
99 | testForType(resultOpus, Property::Rating); | ||||
100 | testForType(resultOpus, Property::ReplayGainAlbumGain); | ||||
101 | testForType(resultOpus, Property::ReplayGainAlbumPeak); | ||||
102 | testForType(resultOpus, Property::ReplayGainTrackGain); | ||||
103 | testForType(resultOpus, Property::ReplayGainTrackPeak); | ||||
104 | } | ||||
105 | | ||||
51 | void TagLibExtractorTest::testCommonData() | 106 | void TagLibExtractorTest::testCommonData() | ||
52 | { | 107 | { | ||
53 | QFETCH(QString, fileType); | 108 | QFETCH(QString, fileType); | ||
54 | QFETCH(QString, mimeType); | 109 | QFETCH(QString, mimeType); | ||
55 | 110 | | |||
56 | QString fileName = QStringLiteral("test.") + fileType; | 111 | QString fileName = QStringLiteral("test.") + fileType; | ||
57 | 112 | | |||
58 | TagLibExtractor plugin{this}; | 113 | TagLibExtractor plugin{this}; | ||
▲ Show 20 Lines • Show All 516 Lines • Show Last 20 Lines |