mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-05-07 17:15:06 -04:00
Use a special enum for inherit/enable/disable variables.
This commit is contained in:
parent
be934b2fce
commit
afb285a476
6 changed files with 60 additions and 48 deletions
|
@ -33,6 +33,24 @@ namespace QTest {
|
|||
ba += ")";
|
||||
return qstrdup(ba.data());
|
||||
}
|
||||
|
||||
template<>
|
||||
char *toString(const Group::TriState &triState)
|
||||
{
|
||||
QString value;
|
||||
|
||||
if (triState == Group::Inherit) {
|
||||
value = "null";
|
||||
}
|
||||
else if (triState == Group::Enable) {
|
||||
value = "true";
|
||||
}
|
||||
else {
|
||||
value = "false";
|
||||
}
|
||||
|
||||
return qstrdup(value.toLocal8Bit().constData());
|
||||
}
|
||||
}
|
||||
|
||||
QDateTime TestKeePass2XmlReader::genDT(int year, int month, int day, int hour, int min, int second)
|
||||
|
@ -123,8 +141,8 @@ void TestKeePass2XmlReader::testGroupRoot()
|
|||
QCOMPARE(ti.usageCount(), 52);
|
||||
QCOMPARE(ti.locationChanged(), genDT(2010, 8, 8, 17, 24, 27));
|
||||
QCOMPARE(group->defaultAutoTypeSequence(), QString(""));
|
||||
QCOMPARE(group->autoTypeEnabled(), -1);
|
||||
QCOMPARE(group->searchingEnabed(), -1);
|
||||
QCOMPARE(group->autoTypeEnabled(), Group::Inherit);
|
||||
QCOMPARE(group->searchingEnabed(), Group::Inherit);
|
||||
QCOMPARE(group->lastTopVisibleEntry()->uuid().toBase64(), QString("+wSUOv6qf0OzW8/ZHAs2sA=="));
|
||||
|
||||
QCOMPARE(group->children().size(), 3);
|
||||
|
@ -144,8 +162,8 @@ void TestKeePass2XmlReader::testGroup1()
|
|||
QCOMPARE(group->iconUuid(), Uuid());
|
||||
QCOMPARE(group->isExpanded(), true);
|
||||
QCOMPARE(group->defaultAutoTypeSequence(), QString("{Password}{ENTER}"));
|
||||
QCOMPARE(group->autoTypeEnabled(), 1);
|
||||
QCOMPARE(group->searchingEnabed(), 0);
|
||||
QCOMPARE(group->autoTypeEnabled(), Group::Enable);
|
||||
QCOMPARE(group->searchingEnabed(), Group::Disable);
|
||||
QVERIFY(!group->lastTopVisibleEntry());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue