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:
authorChristian Kieschnick <christian.kieschnick@hicknhack-software.com>2019-01-03 20:22:41 +0300
committerChristian Kieschnick <christian.kieschnick@hicknhack-software.com>2019-01-03 20:22:41 +0300
commit3d02013513429f5fdca35e01f2248911e112df17 (patch)
tree29e47b533ad5ed5235c6bd090d8d6ed6d59d103d /tests/TestSharing.cpp
parent2e183888256d51796f3e2fef933509f62aad231a (diff)
Changed KeeShareSettings to explicitly ask
KeeShareSettings now allow to trust, untrust or ask on next import from a specific publisher with a specific container
Diffstat (limited to 'tests/TestSharing.cpp')
-rw-r--r--tests/TestSharing.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/tests/TestSharing.cpp b/tests/TestSharing.cpp
index 78d8c1802..b1e85edb7 100644
--- a/tests/TestSharing.cpp
+++ b/tests/TestSharing.cpp
@@ -41,6 +41,7 @@ QTEST_GUILESS_MAIN(TestSharing)
Q_DECLARE_METATYPE(KeeShareSettings::Type)
Q_DECLARE_METATYPE(KeeShareSettings::Key)
Q_DECLARE_METATYPE(KeeShareSettings::Certificate)
+Q_DECLARE_METATYPE(KeeShareSettings::Trust)
Q_DECLARE_METATYPE(KeeShareSettings::ScopedCertificate)
Q_DECLARE_METATYPE(QList<KeeShareSettings::ScopedCertificate>)
@@ -140,7 +141,7 @@ void TestSharing::testNullObjects()
void TestSharing::testCertificateSerialization()
{
- QFETCH(bool, trusted);
+ QFETCH(KeeShareSettings::Trust, trusted);
const OpenSSHKey& key = stubkey();
KeeShareSettings::ScopedCertificate original;
original.path = "/path";
@@ -149,7 +150,7 @@ void TestSharing::testCertificateSerialization()
OpenSSHKey::serializeToBinary(OpenSSHKey::Public, key),
"Some <!> &#_\"\" weird string"
};
- original.trusted = trusted;
+ original.trust = trusted;
QString buffer;
QXmlStreamWriter writer(&buffer);
@@ -165,7 +166,7 @@ void TestSharing::testCertificateSerialization()
QCOMPARE(restored.certificate.key, original.certificate.key);
QCOMPARE(restored.certificate.signer, original.certificate.signer);
- QCOMPARE(restored.trusted, original.trusted);
+ QCOMPARE(restored.trust, original.trust);
QCOMPARE(restored.path, original.path);
QCOMPARE(restored.certificate.sshKey().publicParts(), key.publicParts());
@@ -173,9 +174,10 @@ void TestSharing::testCertificateSerialization()
void TestSharing::testCertificateSerialization_data()
{
- QTest::addColumn<bool>("trusted");
- QTest::newRow("Trusted") << true;
- QTest::newRow("Untrusted") << false;
+ QTest::addColumn<KeeShareSettings::Trust>("trusted");
+ QTest::newRow("Ask") << KeeShareSettings::Trust::Ask;
+ QTest::newRow("Trusted") << KeeShareSettings::Trust::Trusted;
+ QTest::newRow("Untrusted") << KeeShareSettings::Trust::Untrusted;
}
void TestSharing::testKeySerialization()
@@ -280,7 +282,7 @@ void TestSharing::testSettingsSerialization_data()
OpenSSHKey::serializeToBinary(OpenSSHKey::Public, sshKey0),
"Some <!> &#_\"\" weird string"
};
- certificate0.trusted = true;
+ certificate0.trust = KeeShareSettings::Trust::Trusted;
KeeShareSettings::Key key0;
key0.key = OpenSSHKey::serializeToBinary(OpenSSHKey::Private, sshKey0);
@@ -293,7 +295,7 @@ void TestSharing::testSettingsSerialization_data()
OpenSSHKey::serializeToBinary(OpenSSHKey::Public, sshKey1),
"Another "
};
- certificate1.trusted = false;
+ certificate1.trust = KeeShareSettings::Trust::Untrusted;
QTest::addColumn<bool>("importing");
QTest::addColumn<bool>("exporting");