aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/GpgFrontendTest.cpp
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2023-12-16 05:41:38 +0000
committersaturneric <[email protected]>2023-12-16 05:41:38 +0000
commitd6311ece3fa3e8e976befa7e253d453398046c7c (patch)
treea23183865059d06ee7796214d9747b8bf334016c /src/test/GpgFrontendTest.cpp
parentfix: clean up envirnoment when app exits (diff)
downloadGpgFrontend-d6311ece3fa3e8e976befa7e253d453398046c7c.tar.gz
GpgFrontend-d6311ece3fa3e8e976befa7e253d453398046c7c.zip
fix: slove memory problem of gpg context
Diffstat (limited to 'src/test/GpgFrontendTest.cpp')
-rw-r--r--src/test/GpgFrontendTest.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/test/GpgFrontendTest.cpp b/src/test/GpgFrontendTest.cpp
index 7b318aec..b356a380 100644
--- a/src/test/GpgFrontendTest.cpp
+++ b/src/test/GpgFrontendTest.cpp
@@ -36,8 +36,10 @@
#include <boost/dll.hpp>
#include <filesystem>
+#include "core/GpgConstants.h"
#include "core/GpgCoreInit.h"
#include "core/function/GlobalSettingStation.h"
+#include "core/function/basic/ChannelObject.h"
#include "core/function/gpg/GpgContext.h"
#include "spdlog/spdlog.h"
@@ -107,17 +109,16 @@ void ConfigureGpgContext() {
std::filesystem::create_directory(db_path);
}
- // GpgContext::CreateInstance(
- // kGpgFrontendDefaultChannel, [&]() -> ChannelObjectPtr {
- // GpgContextInitArgs args;
- // args.test_mode = true;
- // args.offline_mode = true;
- // args.db_path = db_path.string();
-
- // return
- // ConvertToChannelObjectPtr<>(SecureCreateUniqueObject<GpgContext>(
- // args, kGpgFrontendDefaultChannel));
- // });
+ GpgContext::CreateInstance(
+ kGpgFrontendDefaultChannel, [=]() -> ChannelObjectPtr {
+ GpgContextInitArgs args;
+ args.test_mode = true;
+ args.offline_mode = true;
+ args.db_path = db_path.string();
+
+ return ConvertToChannelObjectPtr<>(SecureCreateUniqueObject<GpgContext>(
+ args, kGpgFrontendDefaultChannel));
+ });
}
auto ExecuteAllTestCase(GpgFrontendContext args) -> int {