Extract readKeyFromLine.

This commit is contained in:
Louis-Bertrand Varin 2017-01-14 13:25:30 -05:00
parent 1ca5b72073
commit 798041fe11
6 changed files with 54 additions and 42 deletions

View file

@ -83,6 +83,22 @@ void TestKeys::testComposite()
delete compositeKey4;
}
void TestKeys::testCompositeKeyReadFromLine()
{
QString keyFilename = QString("%1/FileKeyXml.key").arg(QString(KEEPASSX_TEST_DATA_DIR));
CompositeKey compositeFileKey = CompositeKey::readFromLine(keyFilename);
FileKey fileKey;
fileKey.load(keyFilename);
QCOMPARE(compositeFileKey.rawKey().size(), fileKey.rawKey().size());
CompositeKey compositePasswordKey = CompositeKey::readFromLine(QString("password"));
PasswordKey passwordKey(QString("password"));
QCOMPARE(compositePasswordKey.rawKey().size(), passwordKey.rawKey().size());
}
void TestKeys::testFileKey()
{
QFETCH(QString, type);