Aligned namespaces with an actual master (#18671)
This commit is contained in:
parent
349a0d420f
commit
4f13f0c5c9
@ -12,7 +12,9 @@
|
||||
#include <map>
|
||||
#include <sstream>
|
||||
|
||||
namespace CommonTestUtils {
|
||||
namespace ov {
|
||||
namespace test {
|
||||
namespace utils {
|
||||
|
||||
/// \brief Enables dynamic load of libpq module
|
||||
#define PGQL_DYNAMIC_LOAD
|
||||
@ -274,5 +276,6 @@ bool parse_test_name(const char* line, std::map<std::string, std::string>& keyVa
|
||||
/// \returns Returns true if all input string was compiled, false in case of any compilation error
|
||||
bool compile_string(const std::string& srcStr, const std::map<std::string, std::string>& keyValue, std::string& result);
|
||||
} // namespace PostgreSQLHelpers
|
||||
|
||||
} // namespace CommonTestUtils
|
||||
} // namespace utils
|
||||
} // namespace test
|
||||
} // namespace ov
|
||||
|
@ -9,7 +9,9 @@
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
namespace CommonTestUtils {
|
||||
namespace ov {
|
||||
namespace test {
|
||||
namespace utils {
|
||||
|
||||
/// \brief Class-container for PostgreSQLLink-specific data, declared and implemented
|
||||
/// out of header. Definition mustn't be a part of this header.
|
||||
@ -72,8 +74,9 @@ public:
|
||||
/// Works only if previously called set_manual_start()
|
||||
void manual_start(void) const;
|
||||
};
|
||||
|
||||
} // namespace CommonTestUtils
|
||||
} // namespace utils
|
||||
} // namespace test
|
||||
} // namespace ov
|
||||
|
||||
#ifdef ENABLE_CONFORMANCE_PGQL
|
||||
namespace PostgreSQLLink {
|
||||
|
@ -25,7 +25,9 @@ using ov::test::TestsCommon;
|
||||
|
||||
namespace ov {
|
||||
namespace test {
|
||||
namespace utils {
|
||||
class PostgreSQLLink;
|
||||
} //namespace utils
|
||||
|
||||
class TestsCommon : virtual public ::testing::Test {
|
||||
/// \brief Holds a pointer on PostgreSQL interface implementation (see postgres_link.hpp).
|
||||
@ -35,7 +37,7 @@ class TestsCommon : virtual public ::testing::Test {
|
||||
/// uses in a project, which doesn't define expected definition.
|
||||
/// But if no handler of the variable is linked to a final runtime, then it
|
||||
/// will show an assert if some code tries to use it by a corresponding getter.
|
||||
PostgreSQLLink* PGLink;
|
||||
utils::PostgreSQLLink* PGLink;
|
||||
|
||||
protected:
|
||||
TestsCommon();
|
||||
@ -55,7 +57,7 @@ protected:
|
||||
/// by a wrong behaviour.
|
||||
/// \returns If object supports PostgreSQL reporting, then the method returns a pointer on
|
||||
/// PostgreSQL interface implementation, otherwise - shows an assert or return a nullptr.
|
||||
PostgreSQLLink* GetPGLink() {
|
||||
utils::PostgreSQLLink* GetPGLink() {
|
||||
#ifdef ENABLE_CONFORMANCE_PGQL
|
||||
assert(this->PGLink != nullptr);
|
||||
#endif
|
||||
|
@ -4,7 +4,9 @@
|
||||
|
||||
#include "common_test_utils/postgres_helpers.hpp"
|
||||
|
||||
namespace CommonTestUtils {
|
||||
namespace ov {
|
||||
namespace test {
|
||||
namespace utils {
|
||||
|
||||
const char* PGQL_ENV_CONN_NAME = "OV_POSTGRES_CONN"; // Environment variable with connection settings
|
||||
const char* PGQL_ENV_SESS_NAME = "OV_TEST_SESSION_ID"; // Environment variable identifies current session
|
||||
@ -242,15 +244,17 @@ bool PostgreSQLConnection::load_libpq(void) {
|
||||
});
|
||||
}
|
||||
if (*modLibPQ == (HMODULE)0) {
|
||||
modLibPQ = std::shared_ptr<HMODULE>(new HMODULE(dlopen("/opt/homebrew/opt/libpq/lib/libpq.dylib", RTLD_LAZY)), [](HMODULE* ptr) {
|
||||
if (*ptr != (HMODULE)0) {
|
||||
std::cerr << PG_INF << "Freeing /opt/homebrew/opt/libpq/lib/libPQ.dylib handle\n";
|
||||
try {
|
||||
dlclose(*ptr);
|
||||
} catch (...) {
|
||||
modLibPQ = std::shared_ptr<HMODULE>(
|
||||
new HMODULE(dlopen("/opt/homebrew/opt/libpq/lib/libpq.dylib", RTLD_LAZY)),
|
||||
[](HMODULE* ptr) {
|
||||
if (*ptr != (HMODULE)0) {
|
||||
std::cerr << PG_INF << "Freeing /opt/homebrew/opt/libpq/lib/libPQ.dylib handle\n";
|
||||
try {
|
||||
dlclose(*ptr);
|
||||
} catch (...) {
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
# endif
|
||||
if (*modLibPQ == (HMODULE)0) {
|
||||
@ -624,5 +628,6 @@ bool compile_string(const std::string& srcStr,
|
||||
return readPos = srcStr.length();
|
||||
}
|
||||
} // namespace PostgreSQLHelpers
|
||||
|
||||
} // namespace CommonTestUtils
|
||||
} // namespace utils
|
||||
} // namespace test
|
||||
} // namespace ov
|
||||
|
@ -12,7 +12,9 @@ static std::map<std::string, std::string>
|
||||
static std::map<std::string, std::string>
|
||||
ExtTestNames; // Map of extended test name convertors. It is used to change a test name automatically.
|
||||
|
||||
namespace CommonTestUtils {
|
||||
namespace ov {
|
||||
namespace test {
|
||||
namespace utils {
|
||||
|
||||
using namespace PostgreSQLHelpers;
|
||||
|
||||
@ -808,7 +810,10 @@ bool PostgreSQLLink::remove_custom_field(const std::string fieldName) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace CommonTestUtils
|
||||
} // namespace utils
|
||||
} // namespace test
|
||||
} // namespace ov
|
||||
|
||||
namespace PostgreSQLLink {
|
||||
std::map<std::string, std::string>* get_ext_test_queries(void) {
|
||||
return &ExtTestQueries;
|
||||
|
@ -72,7 +72,7 @@ TestsCommon::~TestsCommon() {
|
||||
|
||||
TestsCommon::TestsCommon()
|
||||
#ifdef ENABLE_CONFORMANCE_PGQL
|
||||
: PGLink(new PostgreSQLLink(this))
|
||||
: PGLink(new utils::PostgreSQLLink(this))
|
||||
#endif
|
||||
{
|
||||
auto memsize = getVmSizeInKB();
|
||||
|
Loading…
Reference in New Issue
Block a user