mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
TestKdbx4Format: use MockClock
Otherwise, assertions in TestKdbx4::testCustomData() may fail on rare occasions, because the customData in a cloned entry won't be identical to its original, because of its potentially-updated LastModified property. Originally noticed in https://github.com/keepassxreboot/keepassxc/pull/7783#issuecomment-1101404487.
This commit is contained in:
parent
9bf61bfc5c
commit
f15ee90429
@ -27,6 +27,7 @@
|
||||
#include "keys/FileKey.h"
|
||||
#include "keys/PasswordKey.h"
|
||||
#include "mock/MockChallengeResponseKey.h"
|
||||
#include "mock/MockClock.h"
|
||||
#include <QTest>
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
@ -113,6 +114,17 @@ void TestKdbx4AesKdf::initTestCaseImpl()
|
||||
}
|
||||
|
||||
Q_DECLARE_METATYPE(QUuid)
|
||||
|
||||
void TestKdbx4Format::init()
|
||||
{
|
||||
MockClock::setup(new MockClock());
|
||||
}
|
||||
|
||||
void TestKdbx4Format::cleanup()
|
||||
{
|
||||
MockClock::teardown();
|
||||
}
|
||||
|
||||
void TestKdbx4Format::testFormat400()
|
||||
{
|
||||
QString filename = QString(KEEPASSX_TEST_DATA_DIR).append("/Format400.kdbx");
|
||||
|
@ -56,6 +56,8 @@ class TestKdbx4Format : public QObject
|
||||
Q_OBJECT
|
||||
|
||||
private slots:
|
||||
void init();
|
||||
void cleanup();
|
||||
void testFormat400();
|
||||
void testFormat400Upgrade();
|
||||
void testFormat400Upgrade_data();
|
||||
|
Loading…
Reference in New Issue
Block a user