From b02fb84ecfa04624143a85ead3779518e08d4459 Mon Sep 17 00:00:00 2001 From: heck Date: Fri, 9 Apr 2021 00:14:06 +0200 Subject: [PATCH] Tests: lets use namespace pEp, but not more. (Its just a LOT easier to navigate especially for other people, plus the habit of just including every namespace everywhere does not scale, its messy). Use namespace aliases. And lets NOT import a namespace into an other namespace like importing std into Adapter. --- test/framework/framework.cc | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/test/framework/framework.cc b/test/framework/framework.cc index ffb3e1c..51b1618 100644 --- a/test/framework/framework.cc +++ b/test/framework/framework.cc @@ -21,16 +21,17 @@ #include #include -#include "../src/Adapter.hh" +#include "../../src/Adapter.hh" pEp::Test::Transport pEp::Test::transport; std::string pEp::Test::path; extern std::thread pEp::Adapter::_sync_thread; +using namespace pEp; +using namespace std; + namespace pEp { namespace Test { - using namespace Adapter; - void setup(vector &args) { #ifdef WIN32 @@ -87,7 +88,7 @@ namespace pEp { ::identity_list *il = NULL; cout << key.c_str() << endl; cout << key.length() << endl; - ::PEP_STATUS status = ::import_key(session(), key.c_str(), key.length(), &il); + ::PEP_STATUS status = ::import_key(Adapter::session(), key.c_str(), key.length(), &il); throw_status(status); assert(status == PEP_KEY_IMPORTED); ::free_identity_list(il); @@ -134,7 +135,7 @@ namespace pEp { stringlist_t *keylist; ::PEP_rating rating; ::PEP_decrypt_flags_t flags = 0; - ::PEP_STATUS status = ::decrypt_message(session(), msg.get(), &_dst, &keylist, &rating, &flags); + ::PEP_STATUS status = ::decrypt_message(Adapter::session(), msg.get(), &_dst, &keylist, &rating, &flags); throw_status(status); Message dst; @@ -168,8 +169,9 @@ namespace pEp { void join_sync_thread() { - if (_sync_thread.joinable()) - _sync_thread.join(); + if (Adapter::_sync_thread.joinable()) { + Adapter::_sync_thread.join(); + } } Message Transport::recv()