style: comply with OpenBMC style guidelines
Change-Id: I72f86c59a0502777c861de901907c0a556c4c6c5
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/src/argument.cpp b/src/argument.cpp
index b656deb..bdaa916 100644
--- a/src/argument.cpp
+++ b/src/argument.cpp
@@ -21,8 +21,8 @@
#include <iostream>
#include <iterator>
-const std::string ArgumentParser::true_string = "true";
-const std::string ArgumentParser::empty_string = "";
+const std::string ArgumentParser::trueString = "true";
+const std::string ArgumentParser::emptyString = "";
const char* ArgumentParser::optionstr = "s:b:i:?h";
const option ArgumentParser::options[] = {
@@ -50,7 +50,7 @@
++i;
if (i->val)
- arguments[i->name] = (i->has_arg ? optarg : true_string);
+ arguments[i->name] = (i->has_arg ? optarg : trueString);
}
}
@@ -59,7 +59,7 @@
auto i = arguments.find(opt);
if (i == arguments.end())
{
- return empty_string;
+ return emptyString;
}
else
{
diff --git a/src/argument.hpp b/src/argument.hpp
index 71a2c76..5974535 100644
--- a/src/argument.hpp
+++ b/src/argument.hpp
@@ -33,10 +33,10 @@
static void usage(char** argv);
/** @brief Set to 'true' when an option is passed */
- static const std::string true_string;
+ static const std::string trueString;
/** @brief Set to '' when an option is not passed */
- static const std::string empty_string;
+ static const std::string emptyString;
private:
/** @brief Option to argument mapping */
diff --git a/src/associations.cpp b/src/associations.cpp
index cc6c723..995b1a4 100644
--- a/src/associations.cpp
+++ b/src/associations.cpp
@@ -172,7 +172,7 @@
}
else
{
- i = objectServer.add_interface(assocPath, XYZ_ASSOCIATION_INTERFACE);
+ i = objectServer.add_interface(assocPath, xyzAssociationInterface);
i->register_property("endpoints", endpoints);
i->initialize();
}
@@ -181,7 +181,7 @@
void associationChanged(sdbusplus::asio::object_server& objectServer,
const std::vector<Association>& associations,
const std::string& path, const std::string& owner,
- const interface_map_type& interfaceMap,
+ const InterfaceMapType& interfaceMap,
AssociationMaps& assocMaps)
{
AssociationPaths objects;
@@ -357,7 +357,7 @@
}
void checkIfPendingAssociation(const std::string& objectPath,
- const interface_map_type& interfaceMap,
+ const InterfaceMapType& interfaceMap,
AssociationMaps& assocMaps,
sdbusplus::asio::object_server& server)
{
diff --git a/src/associations.hpp b/src/associations.hpp
index dd6cbdb..380b7cf 100644
--- a/src/associations.hpp
+++ b/src/associations.hpp
@@ -2,7 +2,7 @@
#include "types.hpp"
-constexpr const char* XYZ_ASSOCIATION_INTERFACE =
+constexpr const char* xyzAssociationInterface =
"xyz.openbmc_project.Association";
/** @brief Remove input association
@@ -81,7 +81,7 @@
void associationChanged(sdbusplus::asio::object_server& objectServer,
const std::vector<Association>& associations,
const std::string& path, const std::string& owner,
- const interface_map_type& interfaceMap,
+ const InterfaceMapType& interfaceMap,
AssociationMaps& assocMaps);
/** @brief Add a pending associations entry
@@ -149,7 +149,7 @@
* @param[in,out] server - sdbus system object
*/
void checkIfPendingAssociation(const std::string& objectPath,
- const interface_map_type& interfaceMap,
+ const InterfaceMapType& interfaceMap,
AssociationMaps& assocMaps,
sdbusplus::asio::object_server& server);
diff --git a/src/main.cpp b/src/main.cpp
index f1e06de..69ab8e1 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -23,101 +23,101 @@
static AllowDenyList serviceAllowList;
static AllowDenyList serviceDenyList;
-void update_owners(sdbusplus::asio::connection* conn,
- boost::container::flat_map<std::string, std::string>& owners,
- const std::string& new_object)
+void updateOwners(sdbusplus::asio::connection* conn,
+ boost::container::flat_map<std::string, std::string>& owners,
+ const std::string& newObject)
{
- if (boost::starts_with(new_object, ":"))
+ if (boost::starts_with(newObject, ":"))
{
return;
}
conn->async_method_call(
- [&, new_object](const boost::system::error_code ec,
- const std::string& nameOwner) {
+ [&, newObject](const boost::system::error_code ec,
+ const std::string& nameOwner) {
if (ec)
{
- std::cerr << "Error getting owner of " << new_object << " : "
+ std::cerr << "Error getting owner of " << newObject << " : "
<< ec << "\n";
return;
}
- owners[nameOwner] = new_object;
+ owners[nameOwner] = newObject;
},
"org.freedesktop.DBus", "/", "org.freedesktop.DBus", "GetNameOwner",
- new_object);
+ newObject);
}
-void send_introspection_complete_signal(sdbusplus::asio::connection* system_bus,
- const std::string& process_name)
+void sendIntrospectionCompleteSignal(sdbusplus::asio::connection* systemBus,
+ const std::string& processName)
{
// TODO(ed) This signal doesn't get exposed properly in the
// introspect right now. Find out how to register signals in
// sdbusplus
- sdbusplus::message::message m = system_bus->new_signal(
+ sdbusplus::message::message m = systemBus->new_signal(
"/xyz/openbmc_project/object_mapper",
"xyz.openbmc_project.ObjectMapper.Private", "IntrospectionComplete");
- m.append(process_name);
+ m.append(processName);
m.signal_send();
}
struct InProgressIntrospect
{
InProgressIntrospect(
- sdbusplus::asio::connection* system_bus, boost::asio::io_context& io,
- const std::string& process_name, AssociationMaps& am
+ sdbusplus::asio::connection* systemBus, boost::asio::io_context& io,
+ const std::string& processName, AssociationMaps& am
#ifdef DEBUG
,
std::shared_ptr<std::chrono::time_point<std::chrono::steady_clock>>
- global_start_time
+ globalStartTime
#endif
) :
- system_bus(system_bus),
- io(io), process_name(process_name), assocMaps(am)
+ systemBus(systemBus),
+ io(io), processName(processName), assocMaps(am)
#ifdef DEBUG
,
- global_start_time(global_start_time),
- process_start_time(std::chrono::steady_clock::now())
+ globalStartTime(globalStartTime),
+ processStartTime(std::chrono::steady_clock::now())
#endif
{}
~InProgressIntrospect()
{
- send_introspection_complete_signal(system_bus, process_name);
+ sendIntrospectionCompleteSignal(systemBus, processName);
#ifdef DEBUG
std::chrono::duration<float> diff =
- std::chrono::steady_clock::now() - process_start_time;
- std::cout << std::setw(50) << process_name << " scan took "
+ std::chrono::steady_clock::now() - processStartTime;
+ std::cout << std::setw(50) << processName << " scan took "
<< diff.count() << " seconds\n";
// If we're the last outstanding caller globally, calculate the
// time it took
- if (global_start_time != nullptr && global_start_time.use_count() == 1)
+ if (globalStartTime != nullptr && globalStartTime.use_count() == 1)
{
- diff = std::chrono::steady_clock::now() - *global_start_time;
+ diff = std::chrono::steady_clock::now() - *globalStartTime;
std::cout << "Total scan took " << diff.count()
<< " seconds to complete\n";
}
#endif
}
- sdbusplus::asio::connection* system_bus;
+ sdbusplus::asio::connection* systemBus;
boost::asio::io_context& io;
- std::string process_name;
+ std::string processName;
AssociationMaps& assocMaps;
#ifdef DEBUG
std::shared_ptr<std::chrono::time_point<std::chrono::steady_clock>>
- global_start_time;
- std::chrono::time_point<std::chrono::steady_clock> process_start_time;
+ globalStartTime;
+ std::chrono::time_point<std::chrono::steady_clock> processStartTime;
#endif
};
-void do_associations(sdbusplus::asio::connection* system_bus,
- interface_map_type& interfaceMap,
- sdbusplus::asio::object_server& objectServer,
- const std::string& processName, const std::string& path,
- int timeoutRetries = 0)
+void doAssociations(sdbusplus::asio::connection* systemBus,
+ InterfaceMapType& interfaceMap,
+ sdbusplus::asio::object_server& objectServer,
+ const std::string& processName, const std::string& path,
+ int timeoutRetries = 0)
{
constexpr int maxTimeoutRetries = 3;
- system_bus->async_method_call(
- [&objectServer, path, processName, &interfaceMap, system_bus,
+ systemBus->async_method_call(
+ [&objectServer, path, processName, &interfaceMap, systemBus,
timeoutRetries](
const boost::system::error_code ec,
const std::variant<std::vector<Association>>& variantAssociations) {
@@ -126,8 +126,8 @@
if (ec.value() == boost::system::errc::timed_out &&
timeoutRetries < maxTimeoutRetries)
{
- do_associations(system_bus, interfaceMap, objectServer,
- processName, path, timeoutRetries + 1);
+ doAssociations(systemBus, interfaceMap, objectServer,
+ processName, path, timeoutRetries + 1);
return;
}
std::cerr << "Error getting associations from " << path << "\n";
@@ -141,36 +141,36 @@
assocDefsInterface, assocDefsProperty);
}
-void do_introspect(sdbusplus::asio::connection* system_bus,
- std::shared_ptr<InProgressIntrospect> transaction,
- interface_map_type& interface_map,
- sdbusplus::asio::object_server& objectServer,
- std::string path, int timeoutRetries = 0)
+void doIntrospect(sdbusplus::asio::connection* systemBus,
+ std::shared_ptr<InProgressIntrospect> transaction,
+ InterfaceMapType& interfaceMap,
+ sdbusplus::asio::object_server& objectServer,
+ std::string path, int timeoutRetries = 0)
{
constexpr int maxTimeoutRetries = 3;
- system_bus->async_method_call(
- [&interface_map, &objectServer, transaction, path, system_bus,
+ systemBus->async_method_call(
+ [&interfaceMap, &objectServer, transaction, path, systemBus,
timeoutRetries](const boost::system::error_code ec,
- const std::string& introspect_xml) {
+ const std::string& introspectXml) {
if (ec)
{
if (ec.value() == boost::system::errc::timed_out &&
timeoutRetries < maxTimeoutRetries)
{
- do_introspect(system_bus, transaction, interface_map,
- objectServer, path, timeoutRetries + 1);
+ doIntrospect(systemBus, transaction, interfaceMap,
+ objectServer, path, timeoutRetries + 1);
return;
}
std::cerr << "Introspect call failed with error: " << ec << ", "
<< ec.message()
- << " on process: " << transaction->process_name
+ << " on process: " << transaction->processName
<< " path: " << path << "\n";
return;
}
tinyxml2::XMLDocument doc;
- tinyxml2::XMLError e = doc.Parse(introspect_xml.c_str());
+ tinyxml2::XMLError e = doc.Parse(introspectXml.c_str());
if (e != tinyxml2::XMLError::XML_SUCCESS)
{
std::cerr << "XML parsing failed\n";
@@ -183,23 +183,23 @@
std::cerr << "XML document did not contain any data\n";
return;
}
- auto& thisPathMap = interface_map[path];
+ auto& thisPathMap = interfaceMap[path];
tinyxml2::XMLElement* pElement =
pRoot->FirstChildElement("interface");
while (pElement != nullptr)
{
- const char* iface_name = pElement->Attribute("name");
- if (iface_name == nullptr)
+ const char* ifaceName = pElement->Attribute("name");
+ if (ifaceName == nullptr)
{
continue;
}
- thisPathMap[transaction->process_name].emplace(iface_name);
+ thisPathMap[transaction->processName].emplace(ifaceName);
- if (std::strcmp(iface_name, assocDefsInterface) == 0)
+ if (std::strcmp(ifaceName, assocDefsInterface) == 0)
{
- do_associations(system_bus, interface_map, objectServer,
- transaction->process_name, path);
+ doAssociations(systemBus, interfaceMap, objectServer,
+ transaction->processName, path);
}
pElement = pElement->NextSiblingElement("interface");
@@ -207,54 +207,53 @@
// Check if this new path has a pending association that can
// now be completed.
- checkIfPendingAssociation(path, interface_map,
+ checkIfPendingAssociation(path, interfaceMap,
transaction->assocMaps, objectServer);
pElement = pRoot->FirstChildElement("node");
while (pElement != nullptr)
{
- const char* child_path = pElement->Attribute("name");
- if (child_path != nullptr)
+ const char* childPath = pElement->Attribute("name");
+ if (childPath != nullptr)
{
- std::string parent_path(path);
- if (parent_path == "/")
+ std::string parentPath(path);
+ if (parentPath == "/")
{
- parent_path.clear();
+ parentPath.clear();
}
- do_introspect(system_bus, transaction, interface_map,
- objectServer, parent_path + "/" + child_path);
+ doIntrospect(systemBus, transaction, interfaceMap,
+ objectServer, parentPath + "/" + childPath);
}
pElement = pElement->NextSiblingElement("node");
}
},
- transaction->process_name, path, "org.freedesktop.DBus.Introspectable",
+ transaction->processName, path, "org.freedesktop.DBus.Introspectable",
"Introspect");
}
-void start_new_introspect(
- sdbusplus::asio::connection* system_bus, boost::asio::io_context& io,
- interface_map_type& interface_map, const std::string& process_name,
+void startNewIntrospect(
+ sdbusplus::asio::connection* systemBus, boost::asio::io_context& io,
+ InterfaceMapType& interfaceMap, const std::string& processName,
AssociationMaps& assocMaps,
#ifdef DEBUG
std::shared_ptr<std::chrono::time_point<std::chrono::steady_clock>>
- global_start_time,
+ globalStartTime,
#endif
sdbusplus::asio::object_server& objectServer)
{
- if (needToIntrospect(process_name, serviceAllowList, serviceDenyList))
+ if (needToIntrospect(processName, serviceAllowList, serviceDenyList))
{
std::shared_ptr<InProgressIntrospect> transaction =
- std::make_shared<InProgressIntrospect>(system_bus, io, process_name,
+ std::make_shared<InProgressIntrospect>(systemBus, io, processName,
assocMaps
#ifdef DEBUG
,
- global_start_time
+ globalStartTime
#endif
);
- do_introspect(system_bus, transaction, interface_map, objectServer,
- "/");
+ doIntrospect(systemBus, transaction, interfaceMap, objectServer, "/");
}
}
@@ -280,15 +279,15 @@
}
void doListNames(
- boost::asio::io_context& io, interface_map_type& interface_map,
- sdbusplus::asio::connection* system_bus,
- boost::container::flat_map<std::string, std::string>& name_owners,
+ boost::asio::io_context& io, InterfaceMapType& interfaceMap,
+ sdbusplus::asio::connection* systemBus,
+ boost::container::flat_map<std::string, std::string>& nameOwners,
AssociationMaps& assocMaps, sdbusplus::asio::object_server& objectServer)
{
- system_bus->async_method_call(
- [&io, &interface_map, &name_owners, &objectServer, system_bus,
+ systemBus->async_method_call(
+ [&io, &interfaceMap, &nameOwners, &objectServer, systemBus,
&assocMaps](const boost::system::error_code ec,
- std::vector<std::string> process_names) {
+ std::vector<std::string> processNames) {
if (ec)
{
std::cerr << "Error getting names: " << ec << "\n";
@@ -296,25 +295,25 @@
return;
}
// Try to make startup consistent
- std::sort(process_names.begin(), process_names.end());
+ std::sort(processNames.begin(), processNames.end());
#ifdef DEBUG
std::shared_ptr<std::chrono::time_point<std::chrono::steady_clock>>
- global_start_time = std::make_shared<
+ globalStartTime = std::make_shared<
std::chrono::time_point<std::chrono::steady_clock>>(
std::chrono::steady_clock::now());
#endif
- for (const std::string& process_name : process_names)
+ for (const std::string& processName : processNames)
{
- if (needToIntrospect(process_name, serviceAllowList,
+ if (needToIntrospect(processName, serviceAllowList,
serviceDenyList))
{
- start_new_introspect(system_bus, io, interface_map,
- process_name, assocMaps,
+ startNewIntrospect(systemBus, io, interfaceMap, processName,
+ assocMaps,
#ifdef DEBUG
- global_start_time,
+ globalStartTime,
#endif
- objectServer);
- update_owners(system_bus, name_owners, process_name);
+ objectServer);
+ updateOwners(systemBus, nameOwners, processName);
}
}
},
@@ -341,7 +340,7 @@
}
void addObjectMapResult(
- std::vector<interface_map_type::value_type>& objectMap,
+ std::vector<InterfaceMapType::value_type>& objectMap,
const std::string& objectPath,
const std::pair<std::string, boost::container::flat_set<std::string>>&
interfaceMap)
@@ -361,7 +360,7 @@
}
else
{
- interface_map_type::value_type object;
+ InterfaceMapType::value_type object;
object.first = objectPath;
object.second.emplace(interfaceMap);
objectMap.push_back(object);
@@ -375,7 +374,7 @@
// 2) Have no other child for this owner
void removeUnneededParents(const std::string& objectPath,
const std::string& owner,
- interface_map_type& interface_map)
+ InterfaceMapType& interfaceMap)
{
auto parent = objectPath;
@@ -388,39 +387,39 @@
}
parent = parent.substr(0, pos);
- auto parent_it = interface_map.find(parent);
- if (parent_it == interface_map.end())
+ auto parentIt = interfaceMap.find(parent);
+ if (parentIt == interfaceMap.end())
{
break;
}
- auto ifaces_it = parent_it->second.find(owner);
- if (ifaces_it == parent_it->second.end())
+ auto ifacesIt = parentIt->second.find(owner);
+ if (ifacesIt == parentIt->second.end())
{
break;
}
- if (ifaces_it->second.size() != 3)
+ if (ifacesIt->second.size() != 3)
{
break;
}
- auto child_path = parent + '/';
+ auto childPath = parent + '/';
// Remove this parent if there isn't a remaining child on this owner
auto child = std::find_if(
- interface_map.begin(), interface_map.end(),
- [&owner, &child_path](const auto& entry) {
- return boost::starts_with(entry.first, child_path) &&
+ interfaceMap.begin(), interfaceMap.end(),
+ [&owner, &childPath](const auto& entry) {
+ return boost::starts_with(entry.first, childPath) &&
(entry.second.find(owner) != entry.second.end());
});
- if (child == interface_map.end())
+ if (child == interfaceMap.end())
{
- parent_it->second.erase(ifaces_it);
- if (parent_it->second.empty())
+ parentIt->second.erase(ifacesIt);
+ if (parentIt->second.empty())
{
- interface_map.erase(parent_it);
+ interfaceMap.erase(parentIt);
}
}
else
@@ -430,42 +429,42 @@
}
}
-std::vector<interface_map_type::value_type>
- getAncestors(const interface_map_type& interface_map, std::string req_path,
+std::vector<InterfaceMapType::value_type>
+ getAncestors(const InterfaceMapType& interfaceMap, std::string reqPath,
std::vector<std::string>& interfaces)
{
// Interfaces need to be sorted for intersect to function
std::sort(interfaces.begin(), interfaces.end());
- if (boost::ends_with(req_path, "/"))
+ if (boost::ends_with(reqPath, "/"))
{
- req_path.pop_back();
+ reqPath.pop_back();
}
- if (req_path.size() && interface_map.find(req_path) == interface_map.end())
+ if (reqPath.size() && interfaceMap.find(reqPath) == interfaceMap.end())
{
throw sdbusplus::xyz::openbmc_project::Common::Error::
ResourceNotFound();
}
- std::vector<interface_map_type::value_type> ret;
- for (auto& object_path : interface_map)
+ std::vector<InterfaceMapType::value_type> ret;
+ for (auto& objectPath : interfaceMap)
{
- auto& this_path = object_path.first;
- if (boost::starts_with(req_path, this_path) && (req_path != this_path))
+ auto& thisPath = objectPath.first;
+ if (boost::starts_with(reqPath, thisPath) && (reqPath != thisPath))
{
if (interfaces.empty())
{
- ret.emplace_back(object_path);
+ ret.emplace_back(objectPath);
}
else
{
- for (auto& interface_map : object_path.second)
+ for (auto& interfaceMap : objectPath.second)
{
if (intersect(interfaces.begin(), interfaces.end(),
- interface_map.second.begin(),
- interface_map.second.end()))
+ interfaceMap.second.begin(),
+ interfaceMap.second.end()))
{
- addObjectMapResult(ret, this_path, interface_map);
+ addObjectMapResult(ret, thisPath, interfaceMap);
}
}
}
@@ -476,7 +475,7 @@
}
boost::container::flat_map<std::string, boost::container::flat_set<std::string>>
- getObject(const interface_map_type& interface_map, const std::string& path,
+ getObject(const InterfaceMapType& interfaceMap, const std::string& path,
std::vector<std::string>& interfaces)
{
boost::container::flat_map<std::string,
@@ -485,22 +484,22 @@
// Interfaces need to be sorted for intersect to function
std::sort(interfaces.begin(), interfaces.end());
- auto path_ref = interface_map.find(path);
- if (path_ref == interface_map.end())
+ auto pathRef = interfaceMap.find(path);
+ if (pathRef == interfaceMap.end())
{
throw sdbusplus::xyz::openbmc_project::Common::Error::
ResourceNotFound();
}
if (interfaces.empty())
{
- return path_ref->second;
+ return pathRef->second;
}
- for (auto& interface_map : path_ref->second)
+ for (auto& interfaceMap : pathRef->second)
{
if (intersect(interfaces.begin(), interfaces.end(),
- interface_map.second.begin(), interface_map.second.end()))
+ interfaceMap.second.begin(), interfaceMap.second.end()))
{
- results.emplace(interface_map.first, interface_map.second);
+ results.emplace(interfaceMap.first, interfaceMap.second);
}
}
@@ -513,8 +512,8 @@
return results;
}
-std::vector<interface_map_type::value_type>
- getSubTree(const interface_map_type& interface_map, std::string req_path,
+std::vector<InterfaceMapType::value_type>
+ getSubTree(const InterfaceMapType& interfaceMap, std::string reqPath,
int32_t depth, std::vector<std::string>& interfaces)
{
if (depth <= 0)
@@ -523,42 +522,42 @@
}
// Interfaces need to be sorted for intersect to function
std::sort(interfaces.begin(), interfaces.end());
- std::vector<interface_map_type::value_type> ret;
+ std::vector<InterfaceMapType::value_type> ret;
- if (boost::ends_with(req_path, "/"))
+ if (boost::ends_with(reqPath, "/"))
{
- req_path.pop_back();
+ reqPath.pop_back();
}
- if (req_path.size() && interface_map.find(req_path) == interface_map.end())
+ if (reqPath.size() && interfaceMap.find(reqPath) == interfaceMap.end())
{
throw sdbusplus::xyz::openbmc_project::Common::Error::
ResourceNotFound();
}
- for (auto& object_path : interface_map)
+ for (auto& objectPath : interfaceMap)
{
- auto& this_path = object_path.first;
+ auto& thisPath = objectPath.first;
- if (this_path == req_path)
+ if (thisPath == reqPath)
{
continue;
}
- if (boost::starts_with(this_path, req_path))
+ if (boost::starts_with(thisPath, reqPath))
{
// count the number of slashes past the search term
- int32_t this_depth = std::count(this_path.begin() + req_path.size(),
- this_path.end(), '/');
- if (this_depth <= depth)
+ int32_t thisDepth = std::count(thisPath.begin() + reqPath.size(),
+ thisPath.end(), '/');
+ if (thisDepth <= depth)
{
- for (auto& interface_map : object_path.second)
+ for (auto& interfaceMap : objectPath.second)
{
if (intersect(interfaces.begin(), interfaces.end(),
- interface_map.second.begin(),
- interface_map.second.end()) ||
+ interfaceMap.second.begin(),
+ interfaceMap.second.end()) ||
interfaces.empty())
{
- addObjectMapResult(ret, this_path, interface_map);
+ addObjectMapResult(ret, thisPath, interfaceMap);
}
}
}
@@ -568,10 +567,9 @@
return ret;
}
-std::vector<std::string>
- getSubTreePaths(const interface_map_type& interface_map,
- std::string req_path, int32_t depth,
- std::vector<std::string>& interfaces)
+std::vector<std::string> getSubTreePaths(const InterfaceMapType& interfaceMap,
+ std::string reqPath, int32_t depth,
+ std::vector<std::string>& interfaces)
{
if (depth <= 0)
{
@@ -581,38 +579,38 @@
std::sort(interfaces.begin(), interfaces.end());
std::vector<std::string> ret;
- if (boost::ends_with(req_path, "/"))
+ if (boost::ends_with(reqPath, "/"))
{
- req_path.pop_back();
+ reqPath.pop_back();
}
- if (req_path.size() && interface_map.find(req_path) == interface_map.end())
+ if (reqPath.size() && interfaceMap.find(reqPath) == interfaceMap.end())
{
throw sdbusplus::xyz::openbmc_project::Common::Error::
ResourceNotFound();
}
- for (auto& object_path : interface_map)
+ for (auto& objectPath : interfaceMap)
{
- auto& this_path = object_path.first;
+ auto& thisPath = objectPath.first;
- if (this_path == req_path)
+ if (thisPath == reqPath)
{
continue;
}
- if (boost::starts_with(this_path, req_path))
+ if (boost::starts_with(thisPath, reqPath))
{
// count the number of slashes past the search term
- int this_depth = std::count(this_path.begin() + req_path.size(),
- this_path.end(), '/');
- if (this_depth <= depth)
+ int thisDepth = std::count(thisPath.begin() + reqPath.size(),
+ thisPath.end(), '/');
+ if (thisDepth <= depth)
{
bool add = interfaces.empty();
- for (auto& interface_map : object_path.second)
+ for (auto& interfaceMap : objectPath.second)
{
if (intersect(interfaces.begin(), interfaces.end(),
- interface_map.second.begin(),
- interface_map.second.end()))
+ interfaceMap.second.begin(),
+ interfaceMap.second.end()))
{
add = true;
break;
@@ -621,7 +619,7 @@
if (add)
{
// TODO(ed) this is a copy
- ret.emplace_back(this_path);
+ ret.emplace_back(thisPath);
}
}
}
@@ -634,7 +632,7 @@
{
auto options = ArgumentParser(argc, argv);
boost::asio::io_context io;
- std::shared_ptr<sdbusplus::asio::connection> system_bus =
+ std::shared_ptr<sdbusplus::asio::connection> systemBus =
std::make_shared<sdbusplus::asio::connection>(io);
splitArgs(options["service-namespaces"], serviceAllowList);
@@ -645,32 +643,32 @@
boost::container::flat_set<std::string> ifaceAllowlist;
splitArgs(options["interface-namespaces"], ifaceAllowlist);
- sdbusplus::asio::object_server server(system_bus);
+ sdbusplus::asio::object_server server(systemBus);
// Construct a signal set registered for process termination.
boost::asio::signal_set signals(io, SIGINT, SIGTERM);
signals.async_wait(
[&io](const boost::system::error_code&, int) { io.stop(); });
- interface_map_type interface_map;
- boost::container::flat_map<std::string, std::string> name_owners;
+ InterfaceMapType interfaceMap;
+ boost::container::flat_map<std::string, std::string> nameOwners;
std::function<void(sdbusplus::message::message & message)>
- nameChangeHandler = [&interface_map, &io, &name_owners, &server,
- system_bus](sdbusplus::message::message& message) {
- std::string name; // well-known
- std::string old_owner; // unique-name
- std::string new_owner; // unique-name
+ nameChangeHandler = [&interfaceMap, &io, &nameOwners, &server,
+ systemBus](sdbusplus::message::message& message) {
+ std::string name; // well-known
+ std::string oldOwner; // unique-name
+ std::string newOwner; // unique-name
- message.read(name, old_owner, new_owner);
+ message.read(name, oldOwner, newOwner);
- if (!old_owner.empty())
+ if (!oldOwner.empty())
{
- processNameChangeDelete(name_owners, name, old_owner,
- interface_map, associationMaps, server);
+ processNameChangeDelete(nameOwners, name, oldOwner,
+ interfaceMap, associationMaps, server);
}
- if (!new_owner.empty())
+ if (!newOwner.empty())
{
#ifdef DEBUG
auto transaction = std::make_shared<
@@ -680,116 +678,116 @@
// New daemon added
if (needToIntrospect(name, serviceAllowList, serviceDenyList))
{
- name_owners[new_owner] = name;
- start_new_introspect(system_bus.get(), io, interface_map,
- name, associationMaps,
+ nameOwners[newOwner] = name;
+ startNewIntrospect(systemBus.get(), io, interfaceMap, name,
+ associationMaps,
#ifdef DEBUG
- transaction,
+ transaction,
#endif
- server);
+ server);
}
}
};
sdbusplus::bus::match::match nameOwnerChanged(
- static_cast<sdbusplus::bus::bus&>(*system_bus),
+ static_cast<sdbusplus::bus::bus&>(*systemBus),
sdbusplus::bus::match::rules::nameOwnerChanged(), nameChangeHandler);
std::function<void(sdbusplus::message::message & message)>
- interfacesAddedHandler = [&interface_map, &name_owners, &server](
+ interfacesAddedHandler = [&interfaceMap, &nameOwners, &server](
sdbusplus::message::message& message) {
- sdbusplus::message::object_path obj_path;
- InterfacesAdded interfaces_added;
- message.read(obj_path, interfaces_added);
- std::string well_known;
- if (!getWellKnown(name_owners, message.get_sender(), well_known))
+ sdbusplus::message::object_path objPath;
+ InterfacesAdded interfacesAdded;
+ message.read(objPath, interfacesAdded);
+ std::string wellKnown;
+ if (!getWellKnown(nameOwners, message.get_sender(), wellKnown))
{
return; // only introspect well-known
}
- if (needToIntrospect(well_known, serviceAllowList, serviceDenyList))
+ if (needToIntrospect(wellKnown, serviceAllowList, serviceDenyList))
{
- processInterfaceAdded(interface_map, obj_path, interfaces_added,
- well_known, associationMaps, server);
+ processInterfaceAdded(interfaceMap, objPath, interfacesAdded,
+ wellKnown, associationMaps, server);
}
};
sdbusplus::bus::match::match interfacesAdded(
- static_cast<sdbusplus::bus::bus&>(*system_bus),
+ static_cast<sdbusplus::bus::bus&>(*systemBus),
sdbusplus::bus::match::rules::interfacesAdded(),
interfacesAddedHandler);
std::function<void(sdbusplus::message::message & message)>
- interfacesRemovedHandler = [&interface_map, &name_owners, &server](
+ interfacesRemovedHandler = [&interfaceMap, &nameOwners, &server](
sdbusplus::message::message& message) {
- sdbusplus::message::object_path obj_path;
- std::vector<std::string> interfaces_removed;
- message.read(obj_path, interfaces_removed);
- auto connection_map = interface_map.find(obj_path.str);
- if (connection_map == interface_map.end())
+ sdbusplus::message::object_path objPath;
+ std::vector<std::string> interfacesRemoved;
+ message.read(objPath, interfacesRemoved);
+ auto connectionMap = interfaceMap.find(objPath.str);
+ if (connectionMap == interfaceMap.end())
{
return;
}
std::string sender;
- if (!getWellKnown(name_owners, message.get_sender(), sender))
+ if (!getWellKnown(nameOwners, message.get_sender(), sender))
{
return;
}
- for (const std::string& interface : interfaces_removed)
+ for (const std::string& interface : interfacesRemoved)
{
- auto interface_set = connection_map->second.find(sender);
- if (interface_set == connection_map->second.end())
+ auto interfaceSet = connectionMap->second.find(sender);
+ if (interfaceSet == connectionMap->second.end())
{
continue;
}
if (interface == assocDefsInterface)
{
- removeAssociation(obj_path.str, sender, server,
+ removeAssociation(objPath.str, sender, server,
associationMaps);
}
- interface_set->second.erase(interface);
+ interfaceSet->second.erase(interface);
- if (interface_set->second.empty())
+ if (interfaceSet->second.empty())
{
// If this was the last interface on this connection,
// erase the connection
- connection_map->second.erase(interface_set);
+ connectionMap->second.erase(interfaceSet);
// Instead of checking if every single path is the endpoint
// of an association that needs to be moved to pending,
// only check when the only remaining owner of this path is
// ourself, which would be because we still own the
// association path.
- if ((connection_map->second.size() == 1) &&
- (connection_map->second.begin()->first ==
+ if ((connectionMap->second.size() == 1) &&
+ (connectionMap->second.begin()->first ==
"xyz.openbmc_project.ObjectMapper"))
{
// Remove the 2 association D-Bus paths and move the
// association to pending.
- moveAssociationToPending(obj_path.str, associationMaps,
+ moveAssociationToPending(objPath.str, associationMaps,
server);
}
}
}
// If this was the last connection on this object path,
// erase the object path
- if (connection_map->second.empty())
+ if (connectionMap->second.empty())
{
- interface_map.erase(connection_map);
+ interfaceMap.erase(connectionMap);
}
- removeUnneededParents(obj_path.str, sender, interface_map);
+ removeUnneededParents(objPath.str, sender, interfaceMap);
};
sdbusplus::bus::match::match interfacesRemoved(
- static_cast<sdbusplus::bus::bus&>(*system_bus),
+ static_cast<sdbusplus::bus::bus&>(*systemBus),
sdbusplus::bus::match::rules::interfacesRemoved(),
interfacesRemovedHandler);
std::function<void(sdbusplus::message::message & message)>
- associationChangedHandler = [&server, &name_owners, &interface_map](
+ associationChangedHandler = [&server, &nameOwners, &interfaceMap](
sdbusplus::message::message& message) {
std::string objectName;
boost::container::flat_map<std::string,
@@ -802,18 +800,17 @@
std::vector<Association> associations =
std::get<std::vector<Association>>(prop->second);
- std::string well_known;
- if (!getWellKnown(name_owners, message.get_sender(),
- well_known))
+ std::string wellKnown;
+ if (!getWellKnown(nameOwners, message.get_sender(), wellKnown))
{
return;
}
associationChanged(server, associations, message.get_path(),
- well_known, interface_map, associationMaps);
+ wellKnown, interfaceMap, associationMaps);
}
};
sdbusplus::bus::match::match assocChangedMatch(
- static_cast<sdbusplus::bus::bus&>(*system_bus),
+ static_cast<sdbusplus::bus::bus&>(*systemBus),
sdbusplus::bus::match::rules::interface(
"org.freedesktop.DBus.Properties") +
sdbusplus::bus::match::rules::member("PropertiesChanged") +
@@ -825,38 +822,38 @@
"xyz.openbmc_project.ObjectMapper");
iface->register_method(
- "GetAncestors", [&interface_map](std::string& req_path,
- std::vector<std::string>& interfaces) {
- return getAncestors(interface_map, req_path, interfaces);
+ "GetAncestors", [&interfaceMap](std::string& reqPath,
+ std::vector<std::string>& interfaces) {
+ return getAncestors(interfaceMap, reqPath, interfaces);
});
iface->register_method(
- "GetObject", [&interface_map](const std::string& path,
+ "GetObject", [&interfaceMap](const std::string& path,
+ std::vector<std::string>& interfaces) {
+ return getObject(interfaceMap, path, interfaces);
+ });
+
+ iface->register_method(
+ "GetSubTree", [&interfaceMap](std::string& reqPath, int32_t depth,
std::vector<std::string>& interfaces) {
- return getObject(interface_map, path, interfaces);
- });
-
- iface->register_method(
- "GetSubTree", [&interface_map](std::string& req_path, int32_t depth,
- std::vector<std::string>& interfaces) {
- return getSubTree(interface_map, req_path, depth, interfaces);
+ return getSubTree(interfaceMap, reqPath, depth, interfaces);
});
iface->register_method(
"GetSubTreePaths",
- [&interface_map](std::string& req_path, int32_t depth,
- std::vector<std::string>& interfaces) {
- return getSubTreePaths(interface_map, req_path, depth, interfaces);
+ [&interfaceMap](std::string& reqPath, int32_t depth,
+ std::vector<std::string>& interfaces) {
+ return getSubTreePaths(interfaceMap, reqPath, depth, interfaces);
});
iface->initialize();
io.post([&]() {
- doListNames(io, interface_map, system_bus.get(), name_owners,
+ doListNames(io, interfaceMap, systemBus.get(), nameOwners,
associationMaps, server);
});
- system_bus->request_name("xyz.openbmc_project.ObjectMapper");
+ systemBus->request_name("xyz.openbmc_project.ObjectMapper");
io.run();
}
diff --git a/src/processing.cpp b/src/processing.cpp
index 255433c..5239818 100644
--- a/src/processing.cpp
+++ b/src/processing.cpp
@@ -43,7 +43,7 @@
void processNameChangeDelete(
boost::container::flat_map<std::string, std::string>& nameOwners,
const std::string& wellKnown, const std::string& oldOwner,
- interface_map_type& interfaceMap, AssociationMaps& assocMaps,
+ InterfaceMapType& interfaceMap, AssociationMaps& assocMaps,
sdbusplus::asio::object_server& server)
{
if (boost::starts_with(oldOwner, ":"))
@@ -55,7 +55,7 @@
}
}
// Connection removed
- interface_map_type::iterator pathIt = interfaceMap.begin();
+ InterfaceMapType::iterator pathIt = interfaceMap.begin();
while (pathIt != interfaceMap.end())
{
// If an associations interface is being removed,
@@ -96,7 +96,7 @@
}
}
-void processInterfaceAdded(interface_map_type& interfaceMap,
+void processInterfaceAdded(InterfaceMapType& interfaceMap,
const sdbusplus::message::object_path& objPath,
const InterfacesAdded& intfAdded,
const std::string& wellKnown,
@@ -145,7 +145,7 @@
//
// This is all needed so that mapper operations can be done
// on the new parent paths.
- using iface_map_iterator = interface_map_type::iterator;
+ using iface_map_iterator = InterfaceMapType::iterator;
using iface_map_value_type =
boost::container::flat_map<std::string,
boost::container::flat_set<std::string>>;
diff --git a/src/processing.hpp b/src/processing.hpp
index 1569c32..e72c584 100644
--- a/src/processing.hpp
+++ b/src/processing.hpp
@@ -41,7 +41,7 @@
*/
bool getWellKnown(
const boost::container::flat_map<std::string, std::string>& owners,
- const std::string& request, std::string& well_known);
+ const std::string& request, std::string& wellKnown);
/** @brief Determine if dbus service is something to monitor
*
@@ -53,7 +53,7 @@
* @param[in] allowList - The allow list
* @param[in] denyList - The deny list
*
- * @return True if input process_name should be monitored, false otherwise
+ * @return True if input processName should be monitored, false otherwise
*/
bool needToIntrospect(const std::string& processName,
const AllowDenyList& allowList,
@@ -72,7 +72,7 @@
void processNameChangeDelete(
boost::container::flat_map<std::string, std::string>& nameOwners,
const std::string& wellKnown, const std::string& oldOwner,
- interface_map_type& interfaceMap, AssociationMaps& assocMaps,
+ InterfaceMapType& interfaceMap, AssociationMaps& assocMaps,
sdbusplus::asio::object_server& server);
/** @brief Handle an interfaces added signal
@@ -85,7 +85,7 @@
* @param[in,out] server - sdbus system object
*
*/
-void processInterfaceAdded(interface_map_type& interfaceMap,
+void processInterfaceAdded(InterfaceMapType& interfaceMap,
const sdbusplus::message::object_path& objPath,
const InterfacesAdded& intfAdded,
const std::string& wellKnown,
diff --git a/src/test/associations.cpp b/src/test/associations.cpp
index 4e1b2bd..cf2f7d0 100644
--- a/src/test/associations.cpp
+++ b/src/test/associations.cpp
@@ -21,7 +21,7 @@
std::string sourcePath = "/xyz/openbmc_project/no/association";
AssociationMaps assocMaps;
- removeAssociation(sourcePath, DEFAULT_DBUS_SVC, *server, assocMaps);
+ removeAssociation(sourcePath, defaultDbusSvc, *server, assocMaps);
}
// Verify call when owner is not in associated owners
@@ -30,8 +30,7 @@
AssociationMaps assocMaps;
assocMaps.owners = createDefaultOwnerAssociation();
- removeAssociation(DEFAULT_SOURCE_PATH, DEFAULT_DBUS_SVC, *server,
- assocMaps);
+ removeAssociation(defaultSourcePath, defaultDbusSvc, *server, assocMaps);
}
// Verify call when path is not in associated interfaces
@@ -41,8 +40,7 @@
assocMaps.owners = createDefaultOwnerAssociation();
- removeAssociation(DEFAULT_SOURCE_PATH, DEFAULT_DBUS_SVC, *server,
- assocMaps);
+ removeAssociation(defaultSourcePath, defaultDbusSvc, *server, assocMaps);
EXPECT_TRUE(assocMaps.owners.empty());
}
@@ -56,17 +54,16 @@
assocMaps.owners = createDefaultOwnerAssociation();
assocMaps.ifaces = createDefaultInterfaceAssociation(server);
- removeAssociation(DEFAULT_SOURCE_PATH, DEFAULT_DBUS_SVC, *server,
- assocMaps);
+ removeAssociation(defaultSourcePath, defaultDbusSvc, *server, assocMaps);
// Verify owner association was deleted
EXPECT_TRUE(assocMaps.owners.empty());
// Verify endpoint was deleted from interface association
auto intfEndpoints =
- std::get<endpointsPos>(assocMaps.ifaces[DEFAULT_FWD_PATH]);
+ std::get<endpointsPos>(assocMaps.ifaces[defaultFwdPath]);
EXPECT_EQ(intfEndpoints.size(), 0);
- intfEndpoints = std::get<endpointsPos>(assocMaps.ifaces[DEFAULT_REV_PATH]);
+ intfEndpoints = std::get<endpointsPos>(assocMaps.ifaces[defaultRevPath]);
EXPECT_EQ(intfEndpoints.size(), 0);
}
@@ -82,60 +79,58 @@
// Add another endpoint to the assoc interfaces
addEndpointToInterfaceAssociation(assocMaps.ifaces);
- removeAssociation(DEFAULT_SOURCE_PATH, DEFAULT_DBUS_SVC, *server,
- assocMaps);
+ removeAssociation(defaultSourcePath, defaultDbusSvc, *server, assocMaps);
// Verify owner association was deleted
EXPECT_TRUE(assocMaps.owners.empty());
// Verify all endpoints are deleted since source path was deleted
auto intfEndpoints =
- std::get<endpointsPos>(assocMaps.ifaces[DEFAULT_FWD_PATH]);
+ std::get<endpointsPos>(assocMaps.ifaces[defaultFwdPath]);
EXPECT_EQ(intfEndpoints.size(), 0);
- intfEndpoints = std::get<endpointsPos>(assocMaps.ifaces[DEFAULT_REV_PATH]);
+ intfEndpoints = std::get<endpointsPos>(assocMaps.ifaces[defaultRevPath]);
EXPECT_EQ(intfEndpoints.size(), 0);
}
// Verify no associations or endpoints removed when the change is identical
TEST_F(TestAssociations, checkAssociationEndpointRemovesNoEpRemove)
{
- AssociationPaths newAssocPaths = {
- {DEFAULT_FWD_PATH, {DEFAULT_ENDPOINT}},
- {DEFAULT_REV_PATH, {DEFAULT_SOURCE_PATH}}};
+ AssociationPaths newAssocPaths = {{defaultFwdPath, {defaultEndpoint}},
+ {defaultRevPath, {defaultSourcePath}}};
AssociationMaps assocMaps;
assocMaps.owners = createDefaultOwnerAssociation();
assocMaps.ifaces = createDefaultInterfaceAssociation(server);
- checkAssociationEndpointRemoves(DEFAULT_SOURCE_PATH, DEFAULT_DBUS_SVC,
+ checkAssociationEndpointRemoves(defaultSourcePath, defaultDbusSvc,
newAssocPaths, *server, assocMaps);
// Verify endpoints were not deleted because they matche with what was
// in the original
auto intfEndpoints =
- std::get<endpointsPos>(assocMaps.ifaces[DEFAULT_FWD_PATH]);
+ std::get<endpointsPos>(assocMaps.ifaces[defaultFwdPath]);
EXPECT_EQ(intfEndpoints.size(), 1);
- intfEndpoints = std::get<endpointsPos>(assocMaps.ifaces[DEFAULT_REV_PATH]);
+ intfEndpoints = std::get<endpointsPos>(assocMaps.ifaces[defaultRevPath]);
EXPECT_EQ(intfEndpoints.size(), 1);
}
// Verify endpoint is removed when assoc path is different
TEST_F(TestAssociations, checkAssociationEndpointRemovesEpRemoveApDiff)
{
- AssociationPaths newAssocPaths = {{"/different/path", {DEFAULT_ENDPOINT}}};
+ AssociationPaths newAssocPaths = {{"/different/path", {defaultEndpoint}}};
AssociationMaps assocMaps;
assocMaps.owners = createDefaultOwnerAssociation();
assocMaps.ifaces = createDefaultInterfaceAssociation(server);
- checkAssociationEndpointRemoves(DEFAULT_SOURCE_PATH, DEFAULT_DBUS_SVC,
+ checkAssociationEndpointRemoves(defaultSourcePath, defaultDbusSvc,
newAssocPaths, *server, assocMaps);
// Verify initial endpoints were deleted because the new path
auto intfEndpoints =
- std::get<endpointsPos>(assocMaps.ifaces[DEFAULT_FWD_PATH]);
+ std::get<endpointsPos>(assocMaps.ifaces[defaultFwdPath]);
EXPECT_EQ(intfEndpoints.size(), 0);
- intfEndpoints = std::get<endpointsPos>(assocMaps.ifaces[DEFAULT_REV_PATH]);
+ intfEndpoints = std::get<endpointsPos>(assocMaps.ifaces[defaultRevPath]);
EXPECT_EQ(intfEndpoints.size(), 0);
}
@@ -143,21 +138,21 @@
TEST_F(TestAssociations, checkAssociationEndpointRemovesEpRemoveEpChanged)
{
AssociationPaths newAssocPaths = {
- {DEFAULT_FWD_PATH, {DEFAULT_ENDPOINT + "/different"}},
- {DEFAULT_REV_PATH, {DEFAULT_SOURCE_PATH + "/different"}}};
+ {defaultFwdPath, {defaultEndpoint + "/different"}},
+ {defaultRevPath, {defaultSourcePath + "/different"}}};
AssociationMaps assocMaps;
assocMaps.owners = createDefaultOwnerAssociation();
assocMaps.ifaces = createDefaultInterfaceAssociation(server);
- checkAssociationEndpointRemoves(DEFAULT_SOURCE_PATH, DEFAULT_DBUS_SVC,
+ checkAssociationEndpointRemoves(defaultSourcePath, defaultDbusSvc,
newAssocPaths, *server, assocMaps);
// Verify initial endpoints were deleted because of different endpoints
auto intfEndpoints =
- std::get<endpointsPos>(assocMaps.ifaces[DEFAULT_FWD_PATH]);
+ std::get<endpointsPos>(assocMaps.ifaces[defaultFwdPath]);
EXPECT_EQ(intfEndpoints.size(), 0);
- intfEndpoints = std::get<endpointsPos>(assocMaps.ifaces[DEFAULT_REV_PATH]);
+ intfEndpoints = std::get<endpointsPos>(assocMaps.ifaces[defaultRevPath]);
EXPECT_EQ(intfEndpoints.size(), 0);
}
@@ -166,21 +161,21 @@
{
std::vector<Association> associations = {
{"inventory_cee", "error_cee", ""}};
- interface_map_type interfaceMap;
+ InterfaceMapType interfaceMap;
AssociationMaps assocMaps;
assocMaps.owners = createDefaultOwnerAssociation();
assocMaps.ifaces = createDefaultInterfaceAssociation(server);
// Empty endpoint will result in deletion of corresponding assocInterface
- associationChanged(*server, associations, DEFAULT_SOURCE_PATH,
- DEFAULT_DBUS_SVC, interfaceMap, assocMaps);
+ associationChanged(*server, associations, defaultSourcePath, defaultDbusSvc,
+ interfaceMap, assocMaps);
// Both of these should be 0 since we have an invalid endpoint
auto intfEndpoints =
- std::get<endpointsPos>(assocMaps.ifaces[DEFAULT_FWD_PATH]);
+ std::get<endpointsPos>(assocMaps.ifaces[defaultFwdPath]);
EXPECT_EQ(intfEndpoints.size(), 0);
- intfEndpoints = std::get<endpointsPos>(assocMaps.ifaces[DEFAULT_REV_PATH]);
+ intfEndpoints = std::get<endpointsPos>(assocMaps.ifaces[defaultRevPath]);
EXPECT_EQ(intfEndpoints.size(), 0);
EXPECT_EQ(assocMaps.pending.size(), 0);
@@ -197,12 +192,12 @@
assocMaps.ifaces = createDefaultInterfaceAssociation(server);
// Make it look like the assoc endpoints are on D-Bus
- interface_map_type interfaceMap = {
- {"/new/source/path", {{DEFAULT_DBUS_SVC, {"a"}}}},
- {"/xyz/openbmc_project/new/endpoint", {{DEFAULT_DBUS_SVC, {"a"}}}}};
+ InterfaceMapType interfaceMap = {
+ {"/new/source/path", {{defaultDbusSvc, {"a"}}}},
+ {"/xyz/openbmc_project/new/endpoint", {{defaultDbusSvc, {"a"}}}}};
associationChanged(*server, associations, "/new/source/path",
- DEFAULT_DBUS_SVC, interfaceMap, assocMaps);
+ defaultDbusSvc, interfaceMap, assocMaps);
// Two source paths
EXPECT_EQ(assocMaps.owners.size(), 2);
@@ -215,7 +210,7 @@
// New endpoint so assocMaps.ifaces should be same size
auto intfEndpoints =
- std::get<endpointsPos>(assocMaps.ifaces[DEFAULT_FWD_PATH]);
+ std::get<endpointsPos>(assocMaps.ifaces[defaultFwdPath]);
EXPECT_EQ(intfEndpoints.size(), 1);
}
@@ -233,10 +228,10 @@
AssociationMaps assocMaps;
// Make it look like the assoc endpoints are on D-Bus
- interface_map_type interfaceMap = createDefaultInterfaceMap();
+ InterfaceMapType interfaceMap = createDefaultInterfaceMap();
- associationChanged(*server, associations, DEFAULT_SOURCE_PATH,
- DEFAULT_DBUS_SVC, interfaceMap, assocMaps);
+ associationChanged(*server, associations, defaultSourcePath, defaultDbusSvc,
+ interfaceMap, assocMaps);
// New associations so ensure it now contains a single entry
EXPECT_EQ(assocMaps.owners.size(), 1);
@@ -246,8 +241,8 @@
// Verify corresponding assoc paths each have one endpoint in assoc
// interfaces and that those endpoints match
- auto singleOwner = assocMaps.owners[DEFAULT_SOURCE_PATH];
- auto singleIntf = singleOwner[DEFAULT_DBUS_SVC];
+ auto singleOwner = assocMaps.owners[defaultSourcePath];
+ auto singleIntf = singleOwner[defaultDbusSvc];
for (auto i : singleIntf)
{
auto intfEndpoints = std::get<endpointsPos>(assocMaps.ifaces[i.first]);
@@ -265,13 +260,13 @@
"/xyz/openbmc_project/inventory/system/chassis"}};
// Make it look like the assoc endpoints are on D-Bus
- interface_map_type interfaceMap = createDefaultInterfaceMap();
+ InterfaceMapType interfaceMap = createDefaultInterfaceMap();
AssociationMaps assocMaps;
assocMaps.owners = createDefaultOwnerAssociation();
assocMaps.ifaces = createDefaultInterfaceAssociation(server);
- associationChanged(*server, associations, DEFAULT_SOURCE_PATH, newOwner,
+ associationChanged(*server, associations, defaultSourcePath, newOwner,
interfaceMap, assocMaps);
// New endpoint so assocOwners should be same size
@@ -279,11 +274,11 @@
// Ensure only one endpoint under first path
auto intfEndpoints =
- std::get<endpointsPos>(assocMaps.ifaces[DEFAULT_FWD_PATH]);
+ std::get<endpointsPos>(assocMaps.ifaces[defaultFwdPath]);
EXPECT_EQ(intfEndpoints.size(), 1);
// Ensure the 2 new association endpoints are under the new owner
- auto a = assocMaps.owners.find(DEFAULT_SOURCE_PATH);
+ auto a = assocMaps.owners.find(defaultSourcePath);
auto o = a->second.find(newOwner);
EXPECT_EQ(o->second.size(), 2);
@@ -298,14 +293,14 @@
{"abc", "error", "/xyz/openbmc_project/inventory/system/chassis"}};
// Make it look like the assoc endpoints are on D-Bus
- interface_map_type interfaceMap = createDefaultInterfaceMap();
+ InterfaceMapType interfaceMap = createDefaultInterfaceMap();
AssociationMaps assocMaps;
assocMaps.owners = createDefaultOwnerAssociation();
assocMaps.ifaces = createDefaultInterfaceAssociation(server);
- associationChanged(*server, associations, DEFAULT_SOURCE_PATH,
- DEFAULT_DBUS_SVC, interfaceMap, assocMaps);
+ associationChanged(*server, associations, defaultSourcePath, defaultDbusSvc,
+ interfaceMap, assocMaps);
// Should have 3 entries in AssociationInterfaces, one is just missing an
// endpoint
@@ -313,12 +308,12 @@
// Change to existing interface so it will be removed here
auto intfEndpoints =
- std::get<endpointsPos>(assocMaps.ifaces[DEFAULT_FWD_PATH]);
+ std::get<endpointsPos>(assocMaps.ifaces[defaultFwdPath]);
EXPECT_EQ(intfEndpoints.size(), 0);
// The new endpoint should exist though in it's place
intfEndpoints = std::get<endpointsPos>(
- assocMaps.ifaces[DEFAULT_SOURCE_PATH + "/" + "abc"]);
+ assocMaps.ifaces[defaultSourcePath + "/" + "abc"]);
EXPECT_EQ(intfEndpoints.size(), 1);
// Added to an existing owner path so still 1
@@ -332,16 +327,16 @@
{
AssociationMaps assocMaps;
- addPendingAssociation(DEFAULT_SOURCE_PATH, "inventory", DEFAULT_ENDPOINT,
- "error", DEFAULT_DBUS_SVC, assocMaps);
+ addPendingAssociation(defaultSourcePath, "inventory", defaultEndpoint,
+ "error", defaultDbusSvc, assocMaps);
EXPECT_TRUE(assocMaps.ifaces.empty());
EXPECT_TRUE(assocMaps.owners.empty());
EXPECT_EQ(assocMaps.pending.size(), 1);
- addPendingAssociation("some/other/path", "inventory", DEFAULT_ENDPOINT,
- "error", DEFAULT_DBUS_SVC, assocMaps);
+ addPendingAssociation("some/other/path", "inventory", defaultEndpoint,
+ "error", defaultDbusSvc, assocMaps);
EXPECT_TRUE(assocMaps.ifaces.empty());
EXPECT_TRUE(assocMaps.owners.empty());
@@ -354,19 +349,18 @@
{
AssociationMaps assocMaps;
- addPendingAssociation(DEFAULT_SOURCE_PATH, "inventory", DEFAULT_ENDPOINT,
- "error", DEFAULT_DBUS_SVC, assocMaps);
+ addPendingAssociation(defaultSourcePath, "inventory", defaultEndpoint,
+ "error", defaultDbusSvc, assocMaps);
EXPECT_EQ(assocMaps.pending.size(), 1);
- addPendingAssociation(DEFAULT_SOURCE_PATH, "inventory",
- "some/other/endpoint", "error", DEFAULT_DBUS_SVC,
- assocMaps);
+ addPendingAssociation(defaultSourcePath, "inventory", "some/other/endpoint",
+ "error", defaultDbusSvc, assocMaps);
// Same pending path, so still just 1 entry
EXPECT_EQ(assocMaps.pending.size(), 1);
- auto assoc = assocMaps.pending.find(DEFAULT_SOURCE_PATH);
+ auto assoc = assocMaps.pending.find(defaultSourcePath);
EXPECT_NE(assoc, assocMaps.pending.end());
auto& endpoints = assoc->second;
@@ -378,17 +372,17 @@
{
AssociationMaps assocMaps;
- addPendingAssociation(DEFAULT_SOURCE_PATH, "inventory", DEFAULT_ENDPOINT,
- "error", DEFAULT_DBUS_SVC, assocMaps);
+ addPendingAssociation(defaultSourcePath, "inventory", defaultEndpoint,
+ "error", defaultDbusSvc, assocMaps);
EXPECT_EQ(assocMaps.pending.size(), 1);
- addPendingAssociation(DEFAULT_SOURCE_PATH, "inventory", DEFAULT_ENDPOINT,
+ addPendingAssociation(defaultSourcePath, "inventory", defaultEndpoint,
"error", "new owner", assocMaps);
EXPECT_EQ(assocMaps.pending.size(), 1);
- auto assoc = assocMaps.pending.find(DEFAULT_SOURCE_PATH);
+ auto assoc = assocMaps.pending.find(defaultSourcePath);
EXPECT_NE(assoc, assocMaps.pending.end());
auto& endpoints = assoc->second;
@@ -402,10 +396,10 @@
{"abc", "def", "/xyz/openbmc_project/new/endpoint"}};
AssociationMaps assocMaps;
- interface_map_type interfaceMap;
+ InterfaceMapType interfaceMap;
associationChanged(*server, associations, "/new/source/path",
- DEFAULT_DBUS_SVC, interfaceMap, assocMaps);
+ defaultDbusSvc, interfaceMap, assocMaps);
// No associations were actually added
EXPECT_EQ(assocMaps.owners.size(), 0);
@@ -420,12 +414,11 @@
{
AssociationMaps assocMaps;
- addPendingAssociation(DEFAULT_SOURCE_PATH, "inventory", DEFAULT_ENDPOINT,
- "error", DEFAULT_DBUS_SVC, assocMaps);
+ addPendingAssociation(defaultSourcePath, "inventory", defaultEndpoint,
+ "error", defaultDbusSvc, assocMaps);
- addPendingAssociation(DEFAULT_SOURCE_PATH, "inventory",
- "some/other/endpoint", "error", DEFAULT_DBUS_SVC,
- assocMaps);
+ addPendingAssociation(defaultSourcePath, "inventory", "some/other/endpoint",
+ "error", defaultDbusSvc, assocMaps);
EXPECT_EQ(assocMaps.pending.size(), 1);
@@ -434,13 +427,13 @@
// Still 1 pending entry, but down to 1 endpoint
EXPECT_EQ(assocMaps.pending.size(), 1);
- auto assoc = assocMaps.pending.find(DEFAULT_SOURCE_PATH);
+ auto assoc = assocMaps.pending.find(defaultSourcePath);
EXPECT_NE(assoc, assocMaps.pending.end());
auto& endpoints = assoc->second;
EXPECT_EQ(endpoints.size(), 1);
// Now nothing pending
- removeFromPendingAssociations(DEFAULT_ENDPOINT, assocMaps);
+ removeFromPendingAssociations(defaultEndpoint, assocMaps);
EXPECT_EQ(assocMaps.pending.size(), 0);
}
@@ -448,17 +441,16 @@
TEST_F(TestAssociations, checkIfPending)
{
AssociationMaps assocMaps;
- interface_map_type interfaceMap = {
- {DEFAULT_SOURCE_PATH, {{DEFAULT_DBUS_SVC, {"a"}}}},
- {DEFAULT_ENDPOINT, {{DEFAULT_DBUS_SVC, {"b"}}}}};
+ InterfaceMapType interfaceMap = {
+ {defaultSourcePath, {{defaultDbusSvc, {"a"}}}},
+ {defaultEndpoint, {{defaultDbusSvc, {"b"}}}}};
- addPendingAssociation(DEFAULT_SOURCE_PATH, "inventory_cip",
- DEFAULT_ENDPOINT, "error_cip", DEFAULT_DBUS_SVC,
- assocMaps);
+ addPendingAssociation(defaultSourcePath, "inventory_cip", defaultEndpoint,
+ "error_cip", defaultDbusSvc, assocMaps);
EXPECT_EQ(assocMaps.pending.size(), 1);
// Move the pending association to a real association
- checkIfPendingAssociation(DEFAULT_SOURCE_PATH, interfaceMap, assocMaps,
+ checkIfPendingAssociation(defaultSourcePath, interfaceMap, assocMaps,
*server);
EXPECT_TRUE(assocMaps.pending.empty());
@@ -523,7 +515,7 @@
AssociationMaps assocMaps;
// Not an association, so it shouldn't do anything
- moveAssociationToPending(DEFAULT_ENDPOINT, assocMaps, *server);
+ moveAssociationToPending(defaultEndpoint, assocMaps, *server);
EXPECT_TRUE(assocMaps.pending.empty());
EXPECT_TRUE(assocMaps.owners.empty());
@@ -536,18 +528,18 @@
assocMaps.owners = createDefaultOwnerAssociation();
assocMaps.ifaces = createDefaultInterfaceAssociation(server);
- moveAssociationToPending(DEFAULT_ENDPOINT, assocMaps, *server);
+ moveAssociationToPending(defaultEndpoint, assocMaps, *server);
// Check it's now pending
EXPECT_EQ(assocMaps.pending.size(), 1);
- EXPECT_EQ(assocMaps.pending.begin()->first, DEFAULT_ENDPOINT);
+ EXPECT_EQ(assocMaps.pending.begin()->first, defaultEndpoint);
// No more assoc owners
EXPECT_TRUE(assocMaps.owners.empty());
// Check the association interfaces were removed
{
- auto assocs = assocMaps.ifaces.find(DEFAULT_FWD_PATH);
+ auto assocs = assocMaps.ifaces.find(defaultFwdPath);
auto& iface = std::get<ifacePos>(assocs->second);
auto& endpoints = std::get<endpointsPos>(assocs->second);
@@ -555,7 +547,7 @@
EXPECT_TRUE(endpoints.empty());
}
{
- auto assocs = assocMaps.ifaces.find(DEFAULT_REV_PATH);
+ auto assocs = assocMaps.ifaces.find(defaultRevPath);
auto& iface = std::get<ifacePos>(assocs->second);
auto& endpoints = std::get<endpointsPos>(assocs->second);
diff --git a/src/test/interfaces_added.cpp b/src/test/interfaces_added.cpp
index 20d8716..1ada2a0 100644
--- a/src/test/interfaces_added.cpp
+++ b/src/test/interfaces_added.cpp
@@ -37,20 +37,20 @@
auto intfAdded =
createInterfacesAdded(assocDefsInterface, assocDefsProperty);
- processInterfaceAdded(interfaceMap, DEFAULT_SOURCE_PATH, intfAdded,
- DEFAULT_DBUS_SVC, assocMaps, *server);
+ processInterfaceAdded(interfaceMap, defaultSourcePath, intfAdded,
+ defaultDbusSvc, assocMaps, *server);
// Interface map will get the following:
// /logging/entry/1 /logging/entry /logging/ / system/chassis
- // dump_InterfaceMapType(interfaceMap);
+ // dumpInterfaceMapType(interfaceMap);
EXPECT_EQ(interfaceMap.size(), 5);
// New association ower created so ensure it now contains a single entry
- // dump_AssociationOwnersType(assocOwners);
+ // dumpAssociationOwnersType(assocOwners);
EXPECT_EQ(assocMaps.owners.size(), 1);
// Ensure the 2 association interfaces were created
- // dump_AssociationInterfaces(assocInterfaces);
+ // dumpAssociationInterfaces(assocInterfaces);
EXPECT_EQ(assocMaps.ifaces.size(), 2);
// No pending associations
diff --git a/src/test/name_change.cpp b/src/test/name_change.cpp
index 32ad56c..cd491a5 100644
--- a/src/test/name_change.cpp
+++ b/src/test/name_change.cpp
@@ -16,7 +16,7 @@
{":1.99", "test-name"}};
std::string wellKnown = {"test-name"};
std::string oldOwner = {":1.99"};
- interface_map_type interfaceMap;
+ InterfaceMapType interfaceMap;
AssociationMaps assocMaps;
processNameChangeDelete(nameOwners, wellKnown, oldOwner, interfaceMap,
@@ -28,7 +28,7 @@
TEST_F(TestNameChange, UniqueNameAssociationsAndInterface)
{
boost::container::flat_map<std::string, std::string> nameOwners = {
- {":1.99", DEFAULT_DBUS_SVC}};
+ {":1.99", defaultDbusSvc}};
std::string oldOwner = {":1.99"};
boost::container::flat_set<std::string> assocInterfacesSet = {
assocDefsInterface};
@@ -38,11 +38,11 @@
AssociationMaps assocMaps;
assocMaps.owners = createDefaultOwnerAssociation();
assocMaps.ifaces = createDefaultInterfaceAssociation(server);
- auto interfaceMap = createInterfaceMap(
- DEFAULT_SOURCE_PATH, DEFAULT_DBUS_SVC, assocInterfacesSet);
+ auto interfaceMap = createInterfaceMap(defaultSourcePath, defaultDbusSvc,
+ assocInterfacesSet);
- processNameChangeDelete(nameOwners, DEFAULT_DBUS_SVC, oldOwner,
- interfaceMap, assocMaps, *server);
+ processNameChangeDelete(nameOwners, defaultDbusSvc, oldOwner, interfaceMap,
+ assocMaps, *server);
EXPECT_EQ(nameOwners.size(), 0);
// Verify owner association was deleted
@@ -50,9 +50,9 @@
// Verify endpoint was deleted from interface association
auto intfEndpoints =
- std::get<endpointsPos>(assocMaps.ifaces[DEFAULT_FWD_PATH]);
+ std::get<endpointsPos>(assocMaps.ifaces[defaultFwdPath]);
EXPECT_EQ(intfEndpoints.size(), 0);
- intfEndpoints = std::get<endpointsPos>(assocMaps.ifaces[DEFAULT_REV_PATH]);
+ intfEndpoints = std::get<endpointsPos>(assocMaps.ifaces[defaultRevPath]);
EXPECT_EQ(intfEndpoints.size(), 0);
// Verify interface map was deleted
diff --git a/src/test/need_to_introspect.cpp b/src/test/need_to_introspect.cpp
index 51972ef..1b4fa86 100644
--- a/src/test/need_to_introspect.cpp
+++ b/src/test/need_to_introspect.cpp
@@ -7,9 +7,9 @@
{
AllowDenyList allowList;
AllowDenyList denyList;
- std::string process_name;
+ std::string processName;
- EXPECT_FALSE(needToIntrospect(process_name, allowList, denyList));
+ EXPECT_FALSE(needToIntrospect(processName, allowList, denyList));
}
// Verify if name is on allowlist, true is returned
@@ -17,9 +17,9 @@
{
AllowDenyList allowList = {"xyz.openbmc_project"};
AllowDenyList denyList;
- std::string process_name = "xyz.openbmc_project.State.Host";
+ std::string processName = "xyz.openbmc_project.State.Host";
- EXPECT_TRUE(needToIntrospect(process_name, allowList, denyList));
+ EXPECT_TRUE(needToIntrospect(processName, allowList, denyList));
}
// Verify if name is on denylist, false is returned
@@ -27,9 +27,9 @@
{
AllowDenyList allowList;
AllowDenyList denyList = {"xyz.openbmc_project.State.Host"};
- std::string process_name = "xyz.openbmc_project.State.Host";
+ std::string processName = "xyz.openbmc_project.State.Host";
- EXPECT_FALSE(needToIntrospect(process_name, allowList, denyList));
+ EXPECT_FALSE(needToIntrospect(processName, allowList, denyList));
}
// Verify if name is on allowlist and denylist, false is returned
@@ -37,7 +37,7 @@
{
AllowDenyList allowList = {"xyz.openbmc_project"};
AllowDenyList denyList = {"xyz.openbmc_project.State.Host"};
- std::string process_name = "xyz.openbmc_project.State.Host";
+ std::string processName = "xyz.openbmc_project.State.Host";
- EXPECT_FALSE(needToIntrospect(process_name, allowList, denyList));
+ EXPECT_FALSE(needToIntrospect(processName, allowList, denyList));
}
diff --git a/src/test/util/association_objects.hpp b/src/test/util/association_objects.hpp
index 632e5ff..f6b6d1d 100644
--- a/src/test/util/association_objects.hpp
+++ b/src/test/util/association_objects.hpp
@@ -1,22 +1,22 @@
#include "src/associations.hpp"
#include "src/processing.hpp"
-const std::string DEFAULT_SOURCE_PATH = "/logging/entry/1";
-const std::string DEFAULT_DBUS_SVC = "xyz.openbmc_project.New.Interface";
-const std::string DEFAULT_FWD_PATH = {DEFAULT_SOURCE_PATH + "/" + "inventory"};
-const std::string DEFAULT_ENDPOINT =
+const std::string defaultSourcePath = "/logging/entry/1";
+const std::string defaultDbusSvc = "xyz.openbmc_project.New.Interface";
+const std::string defaultFwdPath = {defaultSourcePath + "/" + "inventory"};
+const std::string defaultEndpoint =
"/xyz/openbmc_project/inventory/system/chassis";
-const std::string DEFAULT_REV_PATH = {DEFAULT_ENDPOINT + "/" + "error"};
-const std::string EXTRA_ENDPOINT = "/xyz/openbmc_project/differnt/endpoint";
+const std::string defaultRevPath = {defaultEndpoint + "/" + "error"};
+const std::string extraEndpoint = "/xyz/openbmc_project/differnt/endpoint";
// Create a default AssociationOwnersType object
AssociationOwnersType createDefaultOwnerAssociation()
{
- AssociationPaths assocPathMap = {{DEFAULT_FWD_PATH, {DEFAULT_ENDPOINT}},
- {DEFAULT_REV_PATH, {DEFAULT_SOURCE_PATH}}};
+ AssociationPaths assocPathMap = {{defaultFwdPath, {defaultEndpoint}},
+ {defaultRevPath, {defaultSourcePath}}};
boost::container::flat_map<std::string, AssociationPaths> serviceMap = {
- {DEFAULT_DBUS_SVC, assocPathMap}};
- AssociationOwnersType ownerAssoc = {{DEFAULT_SOURCE_PATH, serviceMap}};
+ {defaultDbusSvc, assocPathMap}};
+ AssociationOwnersType ownerAssoc = {{defaultSourcePath, serviceMap}};
return ownerAssoc;
}
@@ -26,15 +26,15 @@
{
AssociationInterfaces interfaceAssoc;
- auto& iface = interfaceAssoc[DEFAULT_FWD_PATH];
+ auto& iface = interfaceAssoc[defaultFwdPath];
auto& endpoints = std::get<endpointsPos>(iface);
- endpoints.push_back(DEFAULT_ENDPOINT);
- server->add_interface(DEFAULT_FWD_PATH, DEFAULT_DBUS_SVC);
+ endpoints.push_back(defaultEndpoint);
+ server->add_interface(defaultFwdPath, defaultDbusSvc);
- auto& iface2 = interfaceAssoc[DEFAULT_REV_PATH];
+ auto& iface2 = interfaceAssoc[defaultRevPath];
auto& endpoints2 = std::get<endpointsPos>(iface2);
- endpoints2.push_back(DEFAULT_SOURCE_PATH);
- server->add_interface(DEFAULT_REV_PATH, DEFAULT_DBUS_SVC);
+ endpoints2.push_back(defaultSourcePath);
+ server->add_interface(defaultRevPath, defaultDbusSvc);
return interfaceAssoc;
}
@@ -42,30 +42,30 @@
// Just add an extra endpoint to the first association
void addEndpointToInterfaceAssociation(AssociationInterfaces& interfaceAssoc)
{
- auto iface = interfaceAssoc[DEFAULT_FWD_PATH];
+ auto iface = interfaceAssoc[defaultFwdPath];
auto endpoints = std::get<endpointsPos>(iface);
- endpoints.push_back(EXTRA_ENDPOINT);
+ endpoints.push_back(extraEndpoint);
}
-// Create a default interface_map_type with input values
-interface_map_type createInterfaceMap(
- const std::string& path, const std::string& connection_name,
- const boost::container::flat_set<std::string>& interface_names)
+// Create a default interfaceMapType with input values
+InterfaceMapType createInterfaceMap(
+ const std::string& path, const std::string& connectionName,
+ const boost::container::flat_set<std::string>& interfaceNames)
{
boost::container::flat_map<std::string,
boost::container::flat_set<std::string>>
- connectionMap = {{connection_name, interface_names}};
- interface_map_type interfaceMap = {{path, connectionMap}};
+ connectionMap = {{connectionName, interfaceNames}};
+ InterfaceMapType interfaceMap = {{path, connectionMap}};
return interfaceMap;
}
-// Create a default interface_map_type with 2 entries with the same
+// Create a default interfaceMapType with 2 entries with the same
// owner.
-interface_map_type createDefaultInterfaceMap()
+InterfaceMapType createDefaultInterfaceMap()
{
- interface_map_type interfaceMap = {
- {DEFAULT_SOURCE_PATH, {{DEFAULT_DBUS_SVC, {"a"}}}},
- {DEFAULT_ENDPOINT, {{DEFAULT_DBUS_SVC, {"b"}}}}};
+ InterfaceMapType interfaceMap = {
+ {defaultSourcePath, {{defaultDbusSvc, {"a"}}}},
+ {defaultEndpoint, {{defaultDbusSvc, {"b"}}}}};
return interfaceMap;
}
diff --git a/src/test/util/debug_output.hpp b/src/test/util/debug_output.hpp
index 460f01f..3cdf42b 100644
--- a/src/test/util/debug_output.hpp
+++ b/src/test/util/debug_output.hpp
@@ -4,7 +4,7 @@
// Some debug functions for dumping out the main data structures in objmgr
-void dump_AssociationOwnersType(AssociationOwnersType& assocOwners)
+void dumpAssociationOwnersType(AssociationOwnersType& assocOwners)
{
using namespace std;
cout << "##### AssociationOwnersType #####" << endl;
@@ -31,7 +31,7 @@
}
}
-void dump_AssociationInterfaces(AssociationInterfaces& assocInterfaces)
+void dumpAssociationInterfaces(AssociationInterfaces& assocInterfaces)
{
using namespace std;
cout << "##### AssociationInterfaces #####" << endl;
@@ -49,10 +49,10 @@
}
}
-void dump_InterfaceMapType(interface_map_type& intfMap)
+void dumpInterfaceMapType(InterfaceMapType& intfMap)
{
using namespace std;
- cout << "##### interface_map_type #####" << endl;
+ cout << "##### interfaceMapType #####" << endl;
for (auto i : intfMap)
{
cout << "------------------------------------" << endl;
diff --git a/src/test/well_known.cpp b/src/test/well_known.cpp
index c9f119c..6d9cee0 100644
--- a/src/test/well_known.cpp
+++ b/src/test/well_known.cpp
@@ -7,10 +7,10 @@
{
boost::container::flat_map<std::string, std::string> owners;
const std::string request = "test";
- std::string well_known;
+ std::string wellKnown;
- EXPECT_TRUE(getWellKnown(owners, request, well_known));
- EXPECT_EQ(well_known, request);
+ EXPECT_TRUE(getWellKnown(owners, request, wellKnown));
+ EXPECT_EQ(wellKnown, request);
}
// Verify if name is not found, false is returned
@@ -18,10 +18,10 @@
{
boost::container::flat_map<std::string, std::string> owners;
const std::string request = ":test";
- std::string well_known;
+ std::string wellKnown;
- EXPECT_FALSE(getWellKnown(owners, request, well_known));
- EXPECT_TRUE(well_known.empty());
+ EXPECT_FALSE(getWellKnown(owners, request, wellKnown));
+ EXPECT_TRUE(wellKnown.empty());
}
// Verify if name is found, true is returned and name is correct
@@ -29,9 +29,9 @@
{
boost::container::flat_map<std::string, std::string> owners;
const std::string request = ":1.25";
- std::string well_known;
+ std::string wellKnown;
owners[request] = "test";
- EXPECT_TRUE(getWellKnown(owners, request, well_known));
- EXPECT_EQ(well_known, "test");
+ EXPECT_TRUE(getWellKnown(owners, request, wellKnown));
+ EXPECT_EQ(wellKnown, "test");
}
diff --git a/src/types.hpp b/src/types.hpp
index 0e89852..3e446df 100644
--- a/src/types.hpp
+++ b/src/types.hpp
@@ -16,7 +16,7 @@
* connection names
* interface names
*/
-using interface_map_type = boost::container::flat_map<
+using InterfaceMapType = boost::container::flat_map<
std::string, boost::container::flat_map<
std::string, boost::container::flat_set<std::string>>>;