mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
Add test for a non-ascii password.
This commit is contained in:
parent
cf4e574c50
commit
2ecd11eb35
@ -196,6 +196,24 @@ void TestKeePass1Reader::testTwofish()
|
||||
delete db;
|
||||
}
|
||||
|
||||
void TestKeePass1Reader::testCP1252Password()
|
||||
{
|
||||
QString name = "CP-1252";
|
||||
|
||||
KeePass1Reader reader;
|
||||
|
||||
QString dbFilename = QString("%1/%2.kdb").arg(QString(KEEPASSX_TEST_DATA_DIR), name);
|
||||
QString password = QString::fromUtf8("\xe2\x80\x9e\x70\x61\x73\x73\x77\x6f\x72\x64\xe2\x80\x9d");
|
||||
|
||||
Database* db = reader.readDatabase(dbFilename, password, QByteArray());
|
||||
QVERIFY(db);
|
||||
QVERIFY(!reader.hasError());
|
||||
QCOMPARE(db->rootGroup()->children().size(), 1);
|
||||
QCOMPARE(db->rootGroup()->children().at(0)->name(), name);
|
||||
|
||||
delete db;
|
||||
}
|
||||
|
||||
void TestKeePass1Reader::cleanupTestCase()
|
||||
{
|
||||
delete m_db;
|
||||
|
@ -36,6 +36,7 @@ private Q_SLOTS:
|
||||
void testFileKey_data();
|
||||
void testCompositeKey();
|
||||
void testTwofish();
|
||||
void testCP1252Password();
|
||||
void cleanupTestCase();
|
||||
|
||||
private:
|
||||
|
BIN
tests/data/CP-1252.kdb
Normal file
BIN
tests/data/CP-1252.kdb
Normal file
Binary file not shown.
1
tests/data/CP-1252.kdb.key
Normal file
1
tests/data/CP-1252.kdb.key
Normal file
@ -0,0 +1 @@
|
||||
„password”
|
Loading…
Reference in New Issue
Block a user