You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

59 lines
1.7 KiB

/***************************************************************************
* Copyright (C) 2020 by Albert Astals Cid <aacid@kde.org> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
***************************************************************************/
#include <QTest>
#include "core/document.h"
#include "core/generator.h"
#include "core/observer.h"
#include "core/page.h"
#include "../document.h"
#include "settings_core.h"
class ComicBookGeneratorTest : public QObject
{
Q_OBJECT
private slots:
void initTestCase();
void testRotatedImage();
void cleanupTestCase();
};
void ComicBookGeneratorTest::initTestCase()
{
Okular::SettingsCore::instance(QStringLiteral("ComicBookGeneratorTest"));
}
void ComicBookGeneratorTest::cleanupTestCase()
{
}
void ComicBookGeneratorTest::testRotatedImage()
{
ComicBook::Document document;
const QString testFile = QStringLiteral(KDESRCDIR "autotests/data/rotated_cb.cbz");
QVERIFY(document.open(testFile));
QVector<Okular::Page *> pagesVector;
document.pages(&pagesVector);
const Okular::Page *p = pagesVector[0];
QVERIFY(p->height() > p->width());
const QImage image = document.pageImage(0);
QVERIFY(image.height() > image.width());
}
QTEST_MAIN(ComicBookGeneratorTest)
#include "comicbooktest.moc"
/* kate: replace-tabs on; tab-width 4; */