aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/core/GpgCoreTestKeyModel.cpp
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2024-01-12 15:08:38 +0000
committersaturneric <[email protected]>2024-01-12 15:08:38 +0000
commit6983b5c1dd82d159236ebd06cf17f071cc9c1ee9 (patch)
treefc53f790e33546320b2ecd306a1a9ade6fbdfe7a /src/test/core/GpgCoreTestKeyModel.cpp
parentfix: slove a heap-use-after-free issue (diff)
downloadGpgFrontend-6983b5c1dd82d159236ebd06cf17f071cc9c1ee9.tar.gz
GpgFrontend-6983b5c1dd82d159236ebd06cf17f071cc9c1ee9.zip
refactor: remove boost and use QString instead of std::filesystem::path
Diffstat (limited to 'src/test/core/GpgCoreTestKeyModel.cpp')
-rw-r--r--src/test/core/GpgCoreTestKeyModel.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/test/core/GpgCoreTestKeyModel.cpp b/src/test/core/GpgCoreTestKeyModel.cpp
index 1f3a5292..cf1fd9ea 100644
--- a/src/test/core/GpgCoreTestKeyModel.cpp
+++ b/src/test/core/GpgCoreTestKeyModel.cpp
@@ -84,18 +84,18 @@ TEST_F(GpgCoreTest, GpgKeyTest) {
ASSERT_EQ(key.GetId(), "81704859182661FB");
ASSERT_EQ(key.GetFingerprint(), "9490795B78F8AFE9F93BD09281704859182661FB");
ASSERT_EQ(key.GetExpireTime(),
- boost::posix_time::from_iso_string("20230905T040000"));
+ QDateTime::fromString("20230905T040000", Qt::ISODate));
ASSERT_EQ(key.GetPublicKeyAlgo(), "RSA");
ASSERT_EQ(key.GetPrimaryKeyLength(), 3072);
ASSERT_EQ(key.GetLastUpdateTime(),
- boost::posix_time::from_iso_string("19700101T000000"));
+ QDateTime::fromString("19700101T000000", Qt::ISODate));
ASSERT_EQ(key.GetCreateTime(),
- boost::posix_time::from_iso_string("20210905T060153"));
+ QDateTime::fromString("20210905T060153", Qt::ISODate));
ASSERT_EQ(key.GetOwnerTrust(), "Unknown");
- ASSERT_EQ(key.IsExpired(), key.GetExpireTime() <
- boost::posix_time::second_clock::local_time());
+ ASSERT_EQ(key.IsExpired(),
+ key.GetExpireTime() < QDateTime::currentDateTime());
}
TEST_F(GpgCoreTest, GpgSubKeyTest) {
@@ -109,7 +109,7 @@ TEST_F(GpgCoreTest, GpgSubKeyTest) {
ASSERT_FALSE(sub_key.IsRevoked());
ASSERT_FALSE(sub_key.IsDisabled());
ASSERT_EQ(sub_key.GetCreateTime(),
- boost::posix_time::from_iso_string("20210905T060153"));
+ QDateTime::fromString("20210905T060153", Qt::ISODate));
ASSERT_FALSE(sub_key.IsCardKey());
ASSERT_TRUE(sub_key.IsPrivateKey());
@@ -123,11 +123,10 @@ TEST_F(GpgCoreTest, GpgSubKeyTest) {
ASSERT_FALSE(sub_key.IsHasSigningCapability());
ASSERT_TRUE(sub_key.IsHasEncryptionCapability());
ASSERT_EQ(key.GetExpireTime(),
- boost::posix_time::from_iso_string("20230905T040000"));
+ QDateTime::fromString("20230905T040000", Qt::ISODate));
- ASSERT_EQ(
- sub_key.IsExpired(),
- sub_key.GetExpireTime() < boost::posix_time::second_clock::local_time());
+ ASSERT_EQ(sub_key.IsExpired(),
+ sub_key.GetExpireTime() < QDateTime::currentDateTime());
}
TEST_F(GpgCoreTest, GpgUIDTest) {