mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-06-01 21:12:11 -04:00
Handle CustomData element.
This should make support for reading and writing KeePass 2 XML files complete (closes #1).
This commit is contained in:
parent
8df8f69e10
commit
3bf0564436
10 changed files with 65 additions and 67 deletions
|
@ -40,7 +40,8 @@ class TestParser : public QObject
|
|||
private Q_SLOTS:
|
||||
void initTestCase();
|
||||
void testMetadata();
|
||||
void testCustomIcon();
|
||||
void testCustomIcons();
|
||||
void testCustomData();
|
||||
void testGroupRoot();
|
||||
void testGroup1();
|
||||
void testGroup2();
|
||||
|
@ -97,7 +98,7 @@ void TestParser::testMetadata()
|
|||
QVERIFY(m_db->metadata()->lastTopVisibleGroup() == m_db->metadata()->lastSelectedGroup());
|
||||
}
|
||||
|
||||
void TestParser::testCustomIcon()
|
||||
void TestParser::testCustomIcons()
|
||||
{
|
||||
QCOMPARE(m_db->metadata()->customIcons().size(), 1);
|
||||
Uuid uuid = Uuid::fromBase64("++vyI+daLk6omox4a6kQGA==");
|
||||
|
@ -115,6 +116,15 @@ void TestParser::testCustomIcon()
|
|||
}
|
||||
}
|
||||
|
||||
void TestParser::testCustomData()
|
||||
{
|
||||
QHash<QString, QString> customFields = m_db->metadata()->customFields();
|
||||
|
||||
QCOMPARE(customFields.size(), 2);
|
||||
QCOMPARE(customFields.value("A Sample Test Key"), QString("valu"));
|
||||
QCOMPARE(customFields.value("custom key"), QString("blub"));
|
||||
}
|
||||
|
||||
void TestParser::testGroupRoot()
|
||||
{
|
||||
const Group* group = m_db->rootGroup();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue