Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/keepassxreboot/keepassxc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Geyer <debfx@fobos.de>2012-07-20 01:21:12 +0400
committerFelix Geyer <debfx@fobos.de>2012-07-20 01:21:12 +0400
commitb6d9c2e48683bef9a7e8d9c96ea146880447449e (patch)
tree67625d5b0a81bc8871a55015395db7c0c9e2c7b7 /tests/TestKeePass1Reader.cpp
parent8cf6289d9cf527f5d964d65f5e4696d95f7e0b47 (diff)
Import Auto-Type associations in KeePass1Reader.
Diffstat (limited to 'tests/TestKeePass1Reader.cpp')
-rw-r--r--tests/TestKeePass1Reader.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/TestKeePass1Reader.cpp b/tests/TestKeePass1Reader.cpp
index b15e8a032..a7e1114fe 100644
--- a/tests/TestKeePass1Reader.cpp
+++ b/tests/TestKeePass1Reader.cpp
@@ -139,6 +139,36 @@ void TestKeePass1Reader::testGroupExpanded()
false);
}
+void TestKeePass1Reader::testAutoType()
+{
+ Group* group = m_db->rootGroup()->children().at(0)->children().at(0);
+ QCOMPARE(group->entries().size(), 2);
+
+ Entry* entry1 = group->entries().at(0);
+ QCOMPARE(entry1->notes(), QString("last line"));
+ QCOMPARE(entry1->defaultAutoTypeSequence(), QString("{USERNAME}{ENTER}"));
+ QCOMPARE(entry1->autoTypeAssociations()->size(), 5);
+ QCOMPARE(entry1->autoTypeAssociations()->get(0).sequence, QString(""));
+ QCOMPARE(entry1->autoTypeAssociations()->get(0).window, QString("a window"));
+ QCOMPARE(entry1->autoTypeAssociations()->get(1).sequence, QString(""));
+ QCOMPARE(entry1->autoTypeAssociations()->get(1).window, QString("a second window"));
+ QCOMPARE(entry1->autoTypeAssociations()->get(2).sequence, QString("{PASSWORD}{ENTER}"));
+ QCOMPARE(entry1->autoTypeAssociations()->get(2).window, QString("Window Nr 1a"));
+ QCOMPARE(entry1->autoTypeAssociations()->get(3).sequence, QString("{PASSWORD}{ENTER}"));
+ QCOMPARE(entry1->autoTypeAssociations()->get(3).window, QString("Window Nr 1b"));
+ QCOMPARE(entry1->autoTypeAssociations()->get(4).sequence, QString(""));
+ QCOMPARE(entry1->autoTypeAssociations()->get(4).window, QString("Window 2"));
+
+ Entry* entry2 = group->entries().at(1);
+ QCOMPARE(entry2->notes(), QString("start line\nend line"));
+ QCOMPARE(entry2->defaultAutoTypeSequence(), QString(""));
+ QCOMPARE(entry2->autoTypeAssociations()->size(), 2);
+ QCOMPARE(entry2->autoTypeAssociations()->get(0).sequence, QString(""));
+ QCOMPARE(entry2->autoTypeAssociations()->get(0).window, QString("Main Window"));
+ QCOMPARE(entry2->autoTypeAssociations()->get(1).sequence, QString(""));
+ QCOMPARE(entry2->autoTypeAssociations()->get(1).window, QString("Test Window"));
+}
+
void TestKeePass1Reader::testFileKey()
{
QFETCH(QString, type);