Commit f1575bb7 authored by Albert Astals Cid's avatar Albert Astals Cid

qt5: tests, go back to fromUt8, some tests failed on MSVC

And don't feel like investigating why
parent 817b0f12
......@@ -21,7 +21,7 @@ private slots:
void TestPassword::password1()
{
Poppler::Document *doc;
doc = Poppler::Document::load(QStringLiteral(TESTDATADIR "/unittestcases/Gday garçon - open.pdf"), "", QStringLiteral("garçon").toLatin1() );
doc = Poppler::Document::load(QString::fromUtf8(TESTDATADIR "/unittestcases/Gday garçon - open.pdf"), "", QString::fromUtf8("garçon").toLatin1() ); //clazy:exclude=qstring-allocations
QVERIFY( doc );
QVERIFY( !doc->isLocked() );
......@@ -32,10 +32,10 @@ void TestPassword::password1()
void TestPassword::password1a()
{
Poppler::Document *doc;
doc = Poppler::Document::load(QString::fromUtf8(TESTDATADIR "/unittestcases/Gday garçon - open.pdf") );
doc = Poppler::Document::load(QString::fromUtf8(TESTDATADIR "/unittestcases/Gday garçon - open.pdf") ); //clazy:exclude=qstring-allocations
QVERIFY( doc );
QVERIFY( doc->isLocked() );
QVERIFY( !doc->unlock( "", QStringLiteral("garçon").toLatin1() ) );
QVERIFY( !doc->unlock( "", QString::fromUtf8("garçon").toLatin1() ) ); //clazy:exclude=qstring-allocations
QVERIFY( !doc->isLocked() );
delete doc;
......@@ -44,7 +44,7 @@ void TestPassword::password1a()
void TestPassword::password2()
{
Poppler::Document *doc;
doc = Poppler::Document::load(QString::fromUtf8(TESTDATADIR "/unittestcases/Gday garçon - owner.pdf"), QStringLiteral("garçon").toLatin1(), "" );
doc = Poppler::Document::load(QString::fromUtf8(TESTDATADIR "/unittestcases/Gday garçon - owner.pdf"), QString::fromUtf8("garçon").toLatin1(), "" ); //clazy:exclude=qstring-allocations
QVERIFY( doc );
QVERIFY( !doc->isLocked() );
......@@ -54,7 +54,7 @@ void TestPassword::password2()
void TestPassword::password2a()
{
Poppler::Document *doc;
doc = Poppler::Document::load(QString::fromUtf8(TESTDATADIR "/unittestcases/Gday garçon - owner.pdf"), QStringLiteral("garçon").toLatin1() );
doc = Poppler::Document::load(QString::fromUtf8(TESTDATADIR "/unittestcases/Gday garçon - owner.pdf"), QString::fromUtf8("garçon").toLatin1() ); //clazy:exclude=qstring-allocations
QVERIFY( doc );
QVERIFY( !doc->isLocked() );
......@@ -67,7 +67,7 @@ void TestPassword::password2b()
doc = Poppler::Document::load(QString::fromUtf8(TESTDATADIR "/unittestcases/Gday garçon - owner.pdf") );
QVERIFY( doc );
QVERIFY( !doc->isLocked() );
QVERIFY( !doc->unlock( QStringLiteral("garçon").toLatin1(), "" ) );
QVERIFY( !doc->unlock( QString::fromUtf8("garçon").toLatin1(), "" ) ); //clazy:exclude=qstring-allocations
QVERIFY( !doc->isLocked() );
delete doc;
......
......@@ -30,12 +30,12 @@ void TestSearch::bug7063()
QCOMPARE( page->search(QStringLiteral("latin1:"), rectLeft, rectTop, rectRight, rectBottom, Poppler::Page::FromTop), false );
QCOMPARE( page->search(QStringLiteral("é"), rectLeft, rectTop, rectRight, rectBottom, Poppler::Page::FromTop), true );
QCOMPARE( page->search(QStringLiteral("à"), rectLeft, rectTop, rectRight, rectBottom, Poppler::Page::FromTop), true );
QCOMPARE( page->search(QStringLiteral("ç"), rectLeft, rectTop, rectRight, rectBottom, Poppler::Page::FromTop), true );
QCOMPARE( page->search(QStringLiteral("search \"é\", \"à\" or \"ç\""), rectLeft, rectTop, rectRight, rectBottom, Poppler::Page::FromTop), true );
QCOMPARE( page->search(QStringLiteral("¥µ©"), rectLeft, rectTop, rectRight, rectBottom, Poppler::Page::FromTop), true );
QCOMPARE( page->search(QStringLiteral("¥©"), rectLeft, rectTop, rectRight, rectBottom, Poppler::Page::FromTop), false );
QCOMPARE( page->search(QString::fromUtf8("é"), rectLeft, rectTop, rectRight, rectBottom, Poppler::Page::FromTop), true ); //clazy:exclude=qstring-allocations
QCOMPARE( page->search(QString::fromUtf8("à"), rectLeft, rectTop, rectRight, rectBottom, Poppler::Page::FromTop), true ); //clazy:exclude=qstring-allocations
QCOMPARE( page->search(QString::fromUtf8("ç"), rectLeft, rectTop, rectRight, rectBottom, Poppler::Page::FromTop), true ); //clazy:exclude=qstring-allocations
QCOMPARE( page->search(QString::fromUtf8("search \"é\", \"à\" or \"ç\""), rectLeft, rectTop, rectRight, rectBottom, Poppler::Page::FromTop), true ); //clazy:exclude=qstring-allocations
QCOMPARE( page->search(QString::fromUtf8("¥µ©"), rectLeft, rectTop, rectRight, rectBottom, Poppler::Page::FromTop), true ); //clazy:exclude=qstring-allocations
QCOMPARE( page->search(QString::fromUtf8("¥©"), rectLeft, rectTop, rectRight, rectBottom, Poppler::Page::FromTop), false ); //clazy:exclude=qstring-allocations
QCOMPARE( page->search(QStringLiteral("non-ascii:"), rectLeft, rectTop, rectRight, rectBottom, Poppler::Page::FromTop), true );
......@@ -44,12 +44,12 @@ void TestSearch::bug7063()
QCOMPARE( page->search(QStringLiteral("latin1:"), rectLeft, rectTop, rectRight, rectBottom, Poppler::Page::FromTop), false );
QCOMPARE( page->search(QStringLiteral("é"), rectLeft, rectTop, rectRight, rectBottom, Poppler::Page::FromTop), true );
QCOMPARE( page->search(QStringLiteral("à"), rectLeft, rectTop, rectRight, rectBottom, Poppler::Page::FromTop), true );
QCOMPARE( page->search(QStringLiteral("ç"), rectLeft, rectTop, rectRight, rectBottom, Poppler::Page::FromTop), true );
QCOMPARE( page->search(QStringLiteral("search \"é\", \"à\" or \"ç\""), rectLeft, rectTop, rectRight, rectBottom, Poppler::Page::FromTop), true );
QCOMPARE( page->search(QStringLiteral("¥µ©"), rectLeft, rectTop, rectRight, rectBottom, Poppler::Page::FromTop), true );
QCOMPARE( page->search(QStringLiteral("¥©"), rectLeft, rectTop, rectRight, rectBottom, Poppler::Page::FromTop), false );
QCOMPARE( page->search(QString::fromUtf8("é"), rectLeft, rectTop, rectRight, rectBottom, Poppler::Page::FromTop), true ); //clazy:exclude=qstring-allocations
QCOMPARE( page->search(QString::fromUtf8("à"), rectLeft, rectTop, rectRight, rectBottom, Poppler::Page::FromTop), true ); //clazy:exclude=qstring-allocations
QCOMPARE( page->search(QString::fromUtf8("ç"), rectLeft, rectTop, rectRight, rectBottom, Poppler::Page::FromTop), true ); //clazy:exclude=qstring-allocations
QCOMPARE( page->search(QString::fromUtf8("search \"é\", \"à\" or \"ç\""), rectLeft, rectTop, rectRight, rectBottom, Poppler::Page::FromTop), true ); //clazy:exclude=qstring-allocations
QCOMPARE( page->search(QString::fromUtf8("¥µ©"), rectLeft, rectTop, rectRight, rectBottom, Poppler::Page::FromTop), true ); //clazy:exclude=qstring-allocations
QCOMPARE( page->search(QString::fromUtf8("¥©"), rectLeft, rectTop, rectRight, rectBottom, Poppler::Page::FromTop), false ); //clazy:exclude=qstring-allocations
}
void TestSearch::testNextAndPrevious()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment