Add support for gzip compressed databases.

This commit is contained in:
Felix Geyer 2010-09-23 22:27:59 +02:00
parent f0e711ac23
commit b8dfb9cc4d
13 changed files with 1290 additions and 11 deletions

View file

@ -31,6 +31,7 @@ class TestKeePass2Reader : public QObject
private Q_SLOTS:
void initTestCase();
void testNonAscii();
void testCompressed();
};
void TestKeePass2Reader::initTestCase()
@ -50,6 +51,18 @@ void TestKeePass2Reader::testNonAscii()
QCOMPARE(db->metadata()->name(), QString("NonAsciiTest"));
}
void TestKeePass2Reader::testCompressed()
{
QString filename = QString(KEEPASSX_TEST_DIR).append("/Compressed.kdbx");
CompositeKey key;
key.addKey(PasswordKey(""));
KeePass2Reader* reader = new KeePass2Reader();
Database* db = reader->readDatabase(filename, key);
QVERIFY(db);
QVERIFY(!reader->error());
QCOMPARE(db->metadata()->name(), QString("Compressed"));
}
QTEST_MAIN(TestKeePass2Reader);
#include "TestKeePass2Reader.moc"