D11365: also test for value types in taglibextractortest and fix errors
Michael Heidelbach
noreply at phabricator.kde.org
Sun Mar 25 12:52:42 UTC 2018
michaelh added a comment.
It is very hard for me understand what you are actually testing. Please (re-)consider to organize like below (or similar). It would be closer to consumer's point of view. What do I get when I ask `kfilemetadata` for the artist of `test.m4a`?
void TagLibExtractorTest::testArtist_data()
{
QTest::addColumn<QString>("path");
QTest::addColumn<QString>("mime");
QTest::addColumn<Property::Property>("prop");
QTest::addColumn<QString>("value");
QTest::addColumn<QStringList>("valueList");
QTest::addColumn<QVariant::Type>("type");
QTest::addRow("m4a")
<< QFINDTESTDATA("samplefiles/test.m4a")
<< QStringLiteral( "audio/mp4")
<< Property::Artist
<< QStringLiteral("Artist")
<< QStringList{QStringLiteral("Artist")}
<< PropertyInfo(Property::Artist).valueType()
;
... more files
}
void TagLibExtractorTest::testArtist()
{
QFETCH(QString, path);
QFETCH(QString, mime);
QFETCH(KFileMetaData::Property::Property, prop);
QFETCH(QString, value);
QFETCH(QStringList, valueList);
QFETCH(QVariant::Type, type);
QScopedPointer<ExtractorPlugin> plugin(new TagLibExtractor(this));
SimpleExtractionResult extracted(path, mime);
plugin->extract(&extracted);
QCOMPARE(extracted.properties().value(prop).type(), type);
QCOMPARE(extracted.properties().value(prop), value);
QCOMPARE(extracted.properties().value(prop), valueList);
}
INLINE COMMENTS
> propertyinfo.cpp:98
> d->displayName = i18nc("@label", "Composer");
> - d->valueType = QVariant::String;
> + d->valueType = QVariant::StringList;
> d->shouldBeIndexed = false;
Looks unrelated to me.
REPOSITORY
R286 KFileMetaData
REVISION DETAIL
https://phabricator.kde.org/D11365
To: astippich, #frameworks, #baloo, mgallien, michaelh
Cc: michaelh, #frameworks, ashaposhnikov, astippich, spoorun, nicolasfella, ngraham, alexeymin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20180325/f1389ead/attachment.html>
More information about the Kde-frameworks-devel
mailing list