[poppler] qt5/tests
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Dec 18 21:36:11 UTC 2018
qt5/tests/check_password.cpp | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
New commits:
commit 3f4e9e49dd2063ae64c2575faf713942878e8a67
Author: Albert Astals Cid <aacid at kde.org>
Date: Tue Dec 18 22:15:29 2018 +0100
Test for issue 690 with new file
diff --git a/qt5/tests/check_password.cpp b/qt5/tests/check_password.cpp
index c297d856..fb29c36b 100644
--- a/qt5/tests/check_password.cpp
+++ b/qt5/tests/check_password.cpp
@@ -14,6 +14,8 @@ private slots:
void password2a();
void password2b();
void password3();
+ void password4();
+ void password4b();
};
@@ -85,6 +87,32 @@ void TestPassword::password3()
delete doc;
}
+// issue 690
+void TestPassword::password4()
+{
+ Poppler::Document *doc;
+ doc = Poppler::Document::load( QString::fromUtf8(TESTDATADIR "/unittestcases/encrypted-256.pdf") );
+ QVERIFY( doc );
+ QVERIFY( doc->isLocked() );
+ QVERIFY( !doc->unlock( "owner-secret", "" ) );
+ QVERIFY( !doc->isLocked() );
+
+ delete doc;
+}
+
+// issue 690
+void TestPassword::password4b()
+{
+ Poppler::Document *doc;
+ doc = Poppler::Document::load( QString::fromUtf8(TESTDATADIR "/unittestcases/encrypted-256.pdf") );
+ QVERIFY( doc );
+ QVERIFY( doc->isLocked() );
+ QVERIFY( !doc->unlock( "", "user-secret" ) );
+ QVERIFY( !doc->isLocked() );
+
+ delete doc;
+}
+
QTEST_GUILESS_MAIN(TestPassword)
#include "check_password.moc"
More information about the poppler
mailing list