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.
 
 
 
 
 

56 lines
1.2 KiB

/*
SPDX-FileCopyrightText: 2020 Albert Astals Cid <aacid@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#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; */