aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/core/GpgCoreTestFileBasicOpera.cpp
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2024-10-26 13:51:55 +0000
committersaturneric <[email protected]>2024-10-26 13:51:55 +0000
commit5bc8c1cd21c18af82a9bf6ffd96457afda46a7bd (patch)
treecfaa815bd4492ec98a8709be0e4628be6911161b /src/test/core/GpgCoreTestFileBasicOpera.cpp
parentfix: add a resource item (diff)
downloadGpgFrontend-5bc8c1cd21c18af82a9bf6ffd96457afda46a7bd.tar.gz
GpgFrontend-5bc8c1cd21c18af82a9bf6ffd96457afda46a7bd.zip
fix: should check key status immediately after get it
Diffstat (limited to 'src/test/core/GpgCoreTestFileBasicOpera.cpp')
-rw-r--r--src/test/core/GpgCoreTestFileBasicOpera.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test/core/GpgCoreTestFileBasicOpera.cpp b/src/test/core/GpgCoreTestFileBasicOpera.cpp
index ce7359b2..9a0c6a34 100644
--- a/src/test/core/GpgCoreTestFileBasicOpera.cpp
+++ b/src/test/core/GpgCoreTestFileBasicOpera.cpp
@@ -42,6 +42,7 @@ namespace GpgFrontend::Test {
TEST_F(GpgCoreTest, CoreFileEncryptDecrTest) {
auto encrypt_key = GpgKeyGetter::GetInstance().GetPubkey(
"E87C6A2D8D95C818DE93B3AE6A2764F8298DEB29");
+ ASSERT_TRUE(encrypt_key.IsGood());
auto buffer = GFBuffer(QString("Hello GpgFrontend!"));
auto input_file = CreateTempFileAndWriteData(buffer);
@@ -73,6 +74,7 @@ TEST_F(GpgCoreTest, CoreFileEncryptDecrTest) {
TEST_F(GpgCoreTest, CoreFileEncryptDecrBinaryTest) {
auto encrypt_key = GpgKeyGetter::GetInstance().GetPubkey(
"E87C6A2D8D95C818DE93B3AE6A2764F8298DEB29");
+ ASSERT_TRUE(encrypt_key.IsGood());
auto buffer = GFBuffer(QString("Hello GpgFrontend!"));
auto input_file = CreateTempFileAndWriteData(buffer);
@@ -165,6 +167,8 @@ TEST_F(GpgCoreTest, CoreFileEncryptSymmetricDecrBinaryTest) {
TEST_F(GpgCoreTest, CoreFileSignVerifyNormalTest) {
auto sign_key = GpgKeyGetter::GetInstance().GetPubkey(
"467F14220CE8DCF780CF4BAD8465C55B25C9B7D1");
+ ASSERT_TRUE(sign_key.IsGood());
+
auto input_file = CreateTempFileAndWriteData("Hello GpgFrontend!");
auto output_file = GetTempFilePath();
@@ -190,6 +194,8 @@ TEST_F(GpgCoreTest, CoreFileSignVerifyNormalTest) {
TEST_F(GpgCoreTest, CoreFileSignVerifyNormalBinaryTest) {
auto sign_key = GpgKeyGetter::GetInstance().GetPubkey(
"467F14220CE8DCF780CF4BAD8465C55B25C9B7D1");
+ ASSERT_TRUE(sign_key.IsGood());
+
auto input_file = CreateTempFileAndWriteData("Hello GpgFrontend!");
auto output_file = GetTempFilePath();
@@ -215,8 +221,12 @@ TEST_F(GpgCoreTest, CoreFileSignVerifyNormalBinaryTest) {
TEST_F(GpgCoreTest, CoreFileEncryptSignDecrVerifyTest) {
auto encrypt_key = GpgKeyGetter::GetInstance().GetPubkey(
"467F14220CE8DCF780CF4BAD8465C55B25C9B7D1");
+ ASSERT_TRUE(encrypt_key.IsGood());
+
auto sign_key = GpgKeyGetter::GetInstance().GetKey(
"8933EB283A18995F45D61DAC021D89771B680FFB");
+ ASSERT_TRUE(sign_key.IsGood());
+
auto buffer = GFBuffer(QString("Hello GpgFrontend!"));
auto input_file = CreateTempFileAndWriteData(buffer);
auto output_file = GetTempFilePath();
@@ -259,8 +269,11 @@ TEST_F(GpgCoreTest, CoreFileEncryptSignDecrVerifyTest) {
TEST_F(GpgCoreTest, CoreFileEncryptSignDecrVerifyBinaryTest) {
auto encrypt_key = GpgKeyGetter::GetInstance().GetPubkey(
"467F14220CE8DCF780CF4BAD8465C55B25C9B7D1");
+ ASSERT_TRUE(encrypt_key.IsGood());
auto sign_key = GpgKeyGetter::GetInstance().GetKey(
"8933EB283A18995F45D61DAC021D89771B680FFB");
+ ASSERT_TRUE(sign_key.IsGood());
+
auto buffer = GFBuffer(QString("Hello GpgFrontend!"));
auto input_file = CreateTempFileAndWriteData(buffer);
auto output_file = GetTempFilePath();