mirror of
https://bitbucket.org/smil3y/kde-extraapps.git
synced 2025-02-24 02:42:52 +00:00
kfilemetadata: check if extractor for image/png is available in IndexerExtractorTests::testImageExtractor()
fixes a crash in case extractor for image/png MIME type is not installed Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
parent
bdc17a1c60
commit
be246af9a6
1 changed files with 5 additions and 2 deletions
|
@ -98,10 +98,13 @@ void IndexerExtractorTests::testPlainTextExtractor()
|
|||
void IndexerExtractorTests::testImageExtractor()
|
||||
{
|
||||
QScopedPointer<ExtractorPluginManager> manager(new ExtractorPluginManager(this));
|
||||
ExtractorPlugin* plugin = manager->fetchExtractors("image/png").first();
|
||||
QList<ExtractorPlugin*> extractors = manager->fetchExtractors("image/png");
|
||||
if (extractors.isEmpty()) {
|
||||
QSKIP("No extractors for image/png", SkipAll);
|
||||
}
|
||||
|
||||
SimpleResult result(testFilePath("tux.png"), "image/png");
|
||||
plugin->extract(&result);
|
||||
extractors.first()->extract(&result);
|
||||
|
||||
QCOMPARE(result.types().size(), 1);
|
||||
QCOMPARE(result.types().first(), Type::Image);
|
||||
|
|
Loading…
Add table
Reference in a new issue