diff options
author | saturneric <[email protected]> | 2023-12-16 05:41:38 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2023-12-16 05:41:38 +0000 |
commit | d6311ece3fa3e8e976befa7e253d453398046c7c (patch) | |
tree | a23183865059d06ee7796214d9747b8bf334016c /src/test/GpgFrontendTest.cpp | |
parent | fix: clean up envirnoment when app exits (diff) | |
download | GpgFrontend-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.cpp | 23 |
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 { |