mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-03-30 09:58:15 -04:00
Add CompositeKey::clear().
This commit is contained in:
parent
279585fff4
commit
0ad1bf0a70
@ -36,6 +36,12 @@ CompositeKey::~CompositeKey()
|
|||||||
qDeleteAll(m_keys);
|
qDeleteAll(m_keys);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CompositeKey::clear()
|
||||||
|
{
|
||||||
|
qDeleteAll(m_keys);
|
||||||
|
m_keys.clear();
|
||||||
|
}
|
||||||
|
|
||||||
CompositeKey* CompositeKey::clone() const
|
CompositeKey* CompositeKey::clone() const
|
||||||
{
|
{
|
||||||
return new CompositeKey(*this);
|
return new CompositeKey(*this);
|
||||||
|
@ -28,6 +28,7 @@ public:
|
|||||||
CompositeKey();
|
CompositeKey();
|
||||||
CompositeKey(const CompositeKey& key);
|
CompositeKey(const CompositeKey& key);
|
||||||
~CompositeKey();
|
~CompositeKey();
|
||||||
|
void clear();
|
||||||
CompositeKey* clone() const;
|
CompositeKey* clone() const;
|
||||||
CompositeKey& operator=(const CompositeKey& key);
|
CompositeKey& operator=(const CompositeKey& key);
|
||||||
|
|
||||||
|
@ -56,6 +56,17 @@ void TestKeys::testComposite()
|
|||||||
QVERIFY(compositeKey2->transform(QByteArray(32, '\0'), 1).size() == 32);
|
QVERIFY(compositeKey2->transform(QByteArray(32, '\0'), 1).size() == 32);
|
||||||
|
|
||||||
delete compositeKey2;
|
delete compositeKey2;
|
||||||
|
|
||||||
|
CompositeKey* compositeKey3 = new CompositeKey();
|
||||||
|
CompositeKey* compositeKey4 = new CompositeKey();
|
||||||
|
|
||||||
|
compositeKey3->addKey(PasswordKey("test"));
|
||||||
|
compositeKey3->clear();
|
||||||
|
|
||||||
|
QCOMPARE(compositeKey3->rawKey(), compositeKey4->rawKey());
|
||||||
|
|
||||||
|
delete compositeKey3;
|
||||||
|
delete compositeKey4;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestKeys::testFileKey()
|
void TestKeys::testFileKey()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user