Changeset View
Changeset View
Standalone View
Standalone View
autotests/taglibextractortest.cpp
Show First 20 Lines • Show All 77 Lines • ▼ Show 20 Line(s) | 52 | { | |||
---|---|---|---|---|---|
78 | QCOMPARE(resultOpus.properties().value(Property::Copyright), QVariant(QStringLiteral("Copyright"))); | 78 | QCOMPARE(resultOpus.properties().value(Property::Copyright), QVariant(QStringLiteral("Copyright"))); | ||
79 | QCOMPARE(resultOpus.properties().value(Property::Compilation), QVariant(QStringLiteral("Compilation"))); | 79 | QCOMPARE(resultOpus.properties().value(Property::Compilation), QVariant(QStringLiteral("Compilation"))); | ||
80 | QCOMPARE(resultOpus.properties().value(Property::License), QVariant(QStringLiteral("License"))); | 80 | QCOMPARE(resultOpus.properties().value(Property::License), QVariant(QStringLiteral("License"))); | ||
81 | QCOMPARE(resultOpus.properties().value(Property::Opus).toInt(), 1); | 81 | QCOMPARE(resultOpus.properties().value(Property::Opus).toInt(), 1); | ||
82 | QCOMPARE(resultOpus.properties().value(Property::TrackNumber).toInt(), 1); | 82 | QCOMPARE(resultOpus.properties().value(Property::TrackNumber).toInt(), 1); | ||
83 | QCOMPARE(resultOpus.properties().value(Property::ReleaseYear).toInt(), 2015); | 83 | QCOMPARE(resultOpus.properties().value(Property::ReleaseYear).toInt(), 2015); | ||
84 | QCOMPARE(resultOpus.properties().value(Property::Channels).toInt(), 1); | 84 | QCOMPARE(resultOpus.properties().value(Property::Channels).toInt(), 1); | ||
85 | QCOMPARE(resultOpus.properties().value(Property::DiscNumber).toInt(), 1); | 85 | QCOMPARE(resultOpus.properties().value(Property::DiscNumber).toInt(), 1); | ||
86 | QCOMPARE(resultOpus.properties().value(Property::Rating).toInt(), 1); | ||||
86 | 87 | | |||
87 | SimpleExtractionResult resultFlac(testFilePath("test.flac"), "audio/flac"); | 88 | SimpleExtractionResult resultFlac(testFilePath("test.flac"), "audio/flac"); | ||
88 | plugin->extract(&resultFlac); | 89 | plugin->extract(&resultFlac); | ||
89 | 90 | | |||
90 | QCOMPARE(resultFlac.types().size(), 1); | 91 | QCOMPARE(resultFlac.types().size(), 1); | ||
91 | QCOMPARE(resultFlac.types().constFirst(), Type::Audio); | 92 | QCOMPARE(resultFlac.types().constFirst(), Type::Audio); | ||
92 | 93 | | |||
93 | QCOMPARE(resultFlac.properties().value(Property::Title), QVariant(QStringLiteral("Title"))); | 94 | QCOMPARE(resultFlac.properties().value(Property::Title), QVariant(QStringLiteral("Title"))); | ||
Show All 16 Lines | |||||
110 | QCOMPARE(resultFlac.properties().value(Property::Copyright), QVariant(QStringLiteral("Copyright"))); | 111 | QCOMPARE(resultFlac.properties().value(Property::Copyright), QVariant(QStringLiteral("Copyright"))); | ||
111 | QCOMPARE(resultFlac.properties().value(Property::Compilation), QVariant(QStringLiteral("Compilation"))); | 112 | QCOMPARE(resultFlac.properties().value(Property::Compilation), QVariant(QStringLiteral("Compilation"))); | ||
112 | QCOMPARE(resultFlac.properties().value(Property::License), QVariant(QStringLiteral("License"))); | 113 | QCOMPARE(resultFlac.properties().value(Property::License), QVariant(QStringLiteral("License"))); | ||
113 | QCOMPARE(resultFlac.properties().value(Property::Opus).toInt(), 1); | 114 | QCOMPARE(resultFlac.properties().value(Property::Opus).toInt(), 1); | ||
114 | QCOMPARE(resultFlac.properties().value(Property::TrackNumber).toInt(), 1); | 115 | QCOMPARE(resultFlac.properties().value(Property::TrackNumber).toInt(), 1); | ||
115 | QCOMPARE(resultFlac.properties().value(Property::ReleaseYear).toInt(), 2015); | 116 | QCOMPARE(resultFlac.properties().value(Property::ReleaseYear).toInt(), 2015); | ||
116 | QCOMPARE(resultFlac.properties().value(Property::Channels).toInt(), 1); | 117 | QCOMPARE(resultFlac.properties().value(Property::Channels).toInt(), 1); | ||
117 | QCOMPARE(resultFlac.properties().value(Property::DiscNumber).toInt(), 1); | 118 | QCOMPARE(resultFlac.properties().value(Property::DiscNumber).toInt(), 1); | ||
119 | QCOMPARE(resultFlac.properties().value(Property::Rating).toInt(), 10); | ||||
118 | 120 | | |||
119 | SimpleExtractionResult resultOgg(testFilePath("test.ogg"), "audio/ogg"); | 121 | SimpleExtractionResult resultOgg(testFilePath("test.ogg"), "audio/ogg"); | ||
120 | plugin->extract(&resultOgg); | 122 | plugin->extract(&resultOgg); | ||
121 | 123 | | |||
122 | QCOMPARE(resultOgg.types().size(), 1); | 124 | QCOMPARE(resultOgg.types().size(), 1); | ||
123 | QCOMPARE(resultOgg.types().constFirst(), Type::Audio); | 125 | QCOMPARE(resultOgg.types().constFirst(), Type::Audio); | ||
124 | 126 | | |||
125 | QCOMPARE(resultOgg.properties().value(Property::Title), QVariant(QStringLiteral("Title"))); | 127 | QCOMPARE(resultOgg.properties().value(Property::Title), QVariant(QStringLiteral("Title"))); | ||
Show All 16 Lines | |||||
142 | QCOMPARE(resultOgg.properties().value(Property::Copyright), QVariant(QStringLiteral("Copyright"))); | 144 | QCOMPARE(resultOgg.properties().value(Property::Copyright), QVariant(QStringLiteral("Copyright"))); | ||
143 | QCOMPARE(resultOgg.properties().value(Property::Compilation), QVariant(QStringLiteral("Compilation"))); | 145 | QCOMPARE(resultOgg.properties().value(Property::Compilation), QVariant(QStringLiteral("Compilation"))); | ||
144 | QCOMPARE(resultOgg.properties().value(Property::License), QVariant(QStringLiteral("License"))); | 146 | QCOMPARE(resultOgg.properties().value(Property::License), QVariant(QStringLiteral("License"))); | ||
145 | QCOMPARE(resultOgg.properties().value(Property::Opus).toInt(), 1); | 147 | QCOMPARE(resultOgg.properties().value(Property::Opus).toInt(), 1); | ||
146 | QCOMPARE(resultOgg.properties().value(Property::TrackNumber).toInt(), 1); | 148 | QCOMPARE(resultOgg.properties().value(Property::TrackNumber).toInt(), 1); | ||
147 | QCOMPARE(resultOgg.properties().value(Property::ReleaseYear).toInt(), 2015); | 149 | QCOMPARE(resultOgg.properties().value(Property::ReleaseYear).toInt(), 2015); | ||
148 | QCOMPARE(resultOgg.properties().value(Property::Channels).toInt(), 1); | 150 | QCOMPARE(resultOgg.properties().value(Property::Channels).toInt(), 1); | ||
149 | QCOMPARE(resultOgg.properties().value(Property::DiscNumber).toInt(), 1); | 151 | QCOMPARE(resultOgg.properties().value(Property::DiscNumber).toInt(), 1); | ||
152 | QCOMPARE(resultOgg.properties().value(Property::Rating).toInt(), 5); | ||||
150 | 153 | | |||
151 | SimpleExtractionResult resultMp3(testFilePath("test.mp3"), "audio/mpeg"); | 154 | SimpleExtractionResult resultMp3(testFilePath("test.mp3"), "audio/mpeg"); | ||
152 | plugin->extract(&resultMp3); | 155 | plugin->extract(&resultMp3); | ||
153 | 156 | | |||
154 | QCOMPARE(resultMp3.types().size(), 1); | 157 | QCOMPARE(resultMp3.types().size(), 1); | ||
155 | QCOMPARE(resultMp3.types().constFirst(), Type::Audio); | 158 | QCOMPARE(resultMp3.types().constFirst(), Type::Audio); | ||
156 | 159 | | |||
157 | QCOMPARE(resultMp3.properties().value(Property::Title), QVariant(QStringLiteral("Title"))); | 160 | QCOMPARE(resultMp3.properties().value(Property::Title), QVariant(QStringLiteral("Title"))); | ||
158 | QCOMPARE(resultMp3.properties().value(Property::Artist), QVariant(QStringLiteral("Artist"))); | 161 | QCOMPARE(resultMp3.properties().value(Property::Artist), QVariant(QStringLiteral("Artist"))); | ||
159 | QCOMPARE(resultMp3.properties().value(Property::Album), QVariant(QStringLiteral("Album"))); | 162 | QCOMPARE(resultMp3.properties().value(Property::Album), QVariant(QStringLiteral("Album"))); | ||
160 | QCOMPARE(resultMp3.properties().value(Property::AlbumArtist), QVariant(QStringLiteral("Album Artist"))); | 163 | QCOMPARE(resultMp3.properties().value(Property::AlbumArtist), QVariant(QStringLiteral("Album Artist"))); | ||
161 | QCOMPARE(resultMp3.properties().value(Property::Genre), QVariant(QStringLiteral("Genre"))); | 164 | QCOMPARE(resultMp3.properties().value(Property::Genre), QVariant(QStringLiteral("Genre"))); | ||
162 | QCOMPARE(resultMp3.properties().value(Property::Comment), QVariant(QStringLiteral("Comment"))); | 165 | QCOMPARE(resultMp3.properties().value(Property::Comment), QVariant(QStringLiteral("Comment"))); | ||
163 | QCOMPARE(resultMp3.properties().value(Property::Composer), QVariant(QStringLiteral("Composer"))); | 166 | QCOMPARE(resultMp3.properties().value(Property::Composer), QVariant(QStringLiteral("Composer"))); | ||
164 | QCOMPARE(resultMp3.properties().value(Property::Lyricist), QVariant(QStringLiteral("Lyricist"))); | 167 | QCOMPARE(resultMp3.properties().value(Property::Lyricist), QVariant(QStringLiteral("Lyricist"))); | ||
165 | QCOMPARE(resultMp3.properties().value(Property::Conductor), QVariant(QStringLiteral("Conductor"))); | 168 | QCOMPARE(resultMp3.properties().value(Property::Conductor), QVariant(QStringLiteral("Conductor"))); | ||
166 | QCOMPARE(resultMp3.properties().value(Property::Publisher), QVariant(QStringLiteral("Publisher"))); | 169 | QCOMPARE(resultMp3.properties().value(Property::Publisher), QVariant(QStringLiteral("Publisher"))); | ||
167 | QCOMPARE(resultMp3.properties().value(Property::Langauge), QVariant(QStringLiteral("Language"))); | 170 | QCOMPARE(resultMp3.properties().value(Property::Langauge), QVariant(QStringLiteral("Language"))); | ||
168 | QCOMPARE(resultMp3.properties().value(Property::Compilation), QVariant(QStringLiteral("Compilation"))); | 171 | QCOMPARE(resultMp3.properties().value(Property::Compilation), QVariant(QStringLiteral("Compilation"))); | ||
169 | QCOMPARE(resultMp3.properties().value(Property::TrackNumber).toInt(), 1); | 172 | QCOMPARE(resultMp3.properties().value(Property::TrackNumber).toInt(), 1); | ||
170 | QCOMPARE(resultMp3.properties().value(Property::ReleaseYear).toInt(), 2015); | 173 | QCOMPARE(resultMp3.properties().value(Property::ReleaseYear).toInt(), 2015); | ||
171 | QCOMPARE(resultMp3.properties().value(Property::Channels).toInt(), 1); | 174 | QCOMPARE(resultMp3.properties().value(Property::Channels).toInt(), 1); | ||
172 | QCOMPARE(resultMp3.properties().value(Property::DiscNumber).toInt(), 1); | 175 | QCOMPARE(resultMp3.properties().value(Property::DiscNumber).toInt(), 1); | ||
176 | QCOMPARE(resultMp3.properties().value(Property::Rating).toInt(), 10); | ||||
173 | 177 | | |||
174 | SimpleExtractionResult resultMpc(testFilePath("test.mpc"), "audio/x-musepack"); | 178 | SimpleExtractionResult resultMpc(testFilePath("test.mpc"), "audio/x-musepack"); | ||
175 | plugin->extract(&resultMpc); | 179 | plugin->extract(&resultMpc); | ||
176 | 180 | | |||
177 | QCOMPARE(resultMpc.types().size(), 1); | 181 | QCOMPARE(resultMpc.types().size(), 1); | ||
178 | QCOMPARE(resultMpc.types().constFirst(), Type::Audio); | 182 | QCOMPARE(resultMpc.types().constFirst(), Type::Audio); | ||
179 | 183 | | |||
180 | QCOMPARE(resultMpc.properties().value(Property::Title), QVariant(QStringLiteral("Title"))); | 184 | QCOMPARE(resultMpc.properties().value(Property::Title), QVariant(QStringLiteral("Title"))); | ||
Show All 14 Lines | |||||
195 | QCOMPARE(resultMpc.properties().value(Property::Author), QVariant(QStringLiteral("Author"))); | 199 | QCOMPARE(resultMpc.properties().value(Property::Author), QVariant(QStringLiteral("Author"))); | ||
196 | QCOMPARE(resultMpc.properties().value(Property::Copyright), QVariant(QStringLiteral("Copyright"))); | 200 | QCOMPARE(resultMpc.properties().value(Property::Copyright), QVariant(QStringLiteral("Copyright"))); | ||
197 | QCOMPARE(resultMpc.properties().value(Property::Compilation), QVariant(QStringLiteral("Compilation"))); | 201 | QCOMPARE(resultMpc.properties().value(Property::Compilation), QVariant(QStringLiteral("Compilation"))); | ||
198 | QCOMPARE(resultMpc.properties().value(Property::License), QVariant(QStringLiteral("License"))); | 202 | QCOMPARE(resultMpc.properties().value(Property::License), QVariant(QStringLiteral("License"))); | ||
199 | QCOMPARE(resultMpc.properties().value(Property::TrackNumber).toInt(), 1); | 203 | QCOMPARE(resultMpc.properties().value(Property::TrackNumber).toInt(), 1); | ||
200 | QCOMPARE(resultMpc.properties().value(Property::ReleaseYear).toInt(), 2015); | 204 | QCOMPARE(resultMpc.properties().value(Property::ReleaseYear).toInt(), 2015); | ||
201 | QCOMPARE(resultMpc.properties().value(Property::Channels).toInt(), 1); | 205 | QCOMPARE(resultMpc.properties().value(Property::Channels).toInt(), 1); | ||
202 | QCOMPARE(resultMpc.properties().value(Property::DiscNumber).isValid(), false); | 206 | QCOMPARE(resultMpc.properties().value(Property::DiscNumber).isValid(), false); | ||
207 | QCOMPARE(resultMpc.properties().value(Property::Rating).toInt(), 4); | ||||
203 | 208 | | |||
204 | SimpleExtractionResult resultMp4(testFilePath("test.m4a"), "audio/mp4"); | 209 | SimpleExtractionResult resultMp4(testFilePath("test.m4a"), "audio/mp4"); | ||
205 | plugin->extract(&resultMp4); | 210 | plugin->extract(&resultMp4); | ||
206 | 211 | | |||
207 | QCOMPARE(resultMp4.types().size(), 1); | 212 | QCOMPARE(resultMp4.types().size(), 1); | ||
208 | QCOMPARE(resultMp4.types().constFirst(), Type::Audio); | 213 | QCOMPARE(resultMp4.types().constFirst(), Type::Audio); | ||
209 | 214 | | |||
210 | QCOMPARE(resultMp4.properties().value(Property::Title), QVariant(QStringLiteral("Title"))); | 215 | QCOMPARE(resultMp4.properties().value(Property::Title), QVariant(QStringLiteral("Title"))); | ||
▲ Show 20 Lines • Show All 90 Lines • Show Last 20 Lines |