24#ifndef TEST_HARNESS_SUITE_H
25#define TEST_HARNESS_SUITE_H
27#include <gtest/gtest.h>
53template <
typename test_service_t,
char const *component_name,
60 bool component_load(
char const *component_to_load,
char const *svc_to_load) {
61 EXPECT_TRUE(
m_urn.empty());
63 EXPECT_EQ(
m_dl,
nullptr);
65 EXPECT_TRUE(
m_dl->is_valid());
68 if (PLUGIN_DIR !=
nullptr) {
69 const char *
path = PLUGIN_DIR;
71 std::string plugin_buf(PLUGIN_DIR);
72 for (
auto f : plugin_buf)
73 if (f ==
'\\') f =
'/';
74 path = plugin_buf.c_str();
78 m_urn.append(component_to_load);
79 const char *urns[] = {
m_urn.c_str()};
80 if ((*m_dl)->load(urns, 1)) {
85 if (
m_dl && svc_to_load !=
nullptr)
96 if (
m_urn.size() > 0 &&
m_dl->is_valid()) {
97 const char *urns[] = {
m_urn.c_str()};
98 (*m_dl)->unload(urns, 1);
106 if (component_name !=
nullptr &&
Implements a Gmock Test suite class to test a component.
Definition: test_harness_suite.h:55
void TearDown() override
Definition: test_harness_suite.h:119
void SetUp() override
Definition: test_harness_suite.h:117
bool component_load(char const *component_to_load, char const *svc_to_load)
Definition: test_harness_suite.h:60
my_service< mysql_dyloader_t > * m_dl
Reference to the registry.
Definition: test_harness_suite.h:123
TestHarnessSuite_templ()
Definition: test_harness_suite.h:102
my_service< test_service_t > * m_test_svc
reference to the dynamic loader
Definition: test_harness_suite.h:124
std::string m_urn
reference to the test service
Definition: test_harness_suite.h:125
~TestHarnessSuite_templ() override
Definition: test_harness_suite.h:111
mysql_registry_t * m_reg
Definition: test_harness_suite.h:122
void component_unload()
Definition: test_harness_suite.h:91
Wraps my_h_service struct conforming ABI into RAII C++ object with ability to cast to desired service...
Definition: my_service.h:35
Fido Client Authentication nullptr
Definition: fido_client_plugin.cc:222
bool minimal_chassis_init(mysql_service_registry_t **registry, mysql_component_t *comp_ref)
This is the entry function for minimal_chassis static library, which has to be called by the applicat...
Definition: minimal_chassis.cc:148
bool minimal_chassis_deinit(mysql_service_registry_t *registry, mysql_component_t *comp_ref)
This is the exit function for minimal_chassis static library, which has to be called just before the ...
Definition: minimal_chassis.cc:223
static char * path
Definition: mysqldump.cc:137
#define SERVICE_TYPE(name)
Generates the standard Service type name.
Definition: service.h:76
#define SERVICE_TYPE_NO_CONST(name)
Generates the standard Service type name.
Definition: service.h:71
Carries information on the specific Component, all Service Implementations it provides,...
Definition: dynamic_loader.h:263
Service for managing the list of loaded Components.
Definition: dynamic_loader.h:41
Service for acquiring and releasing references to all registered Service Implementations.
Definition: registry.h:48