Cleanup formatting
Wew, that's a lot of stuff. But I thought it makes sense after the
sysrepo migration.
Change-Id: If363d2ce1b11106113a9f0c37a3bcd59a940bd0b
diff --git a/tests/mock/sysrepo_subscription.cpp b/tests/mock/sysrepo_subscription.cpp
index 03be075..5c5fd27 100644
--- a/tests/mock/sysrepo_subscription.cpp
+++ b/tests/mock/sysrepo_subscription.cpp
@@ -22,11 +22,11 @@
}
int operator()(
- sysrepo::S_Session sess,
- [[maybe_unused]] const char *module_name,
- [[maybe_unused]] const char *xpath,
- [[maybe_unused]] sr_event_t event,
- [[maybe_unused]] uint32_t request_id)
+ sysrepo::S_Session sess,
+ [[maybe_unused]] const char* module_name,
+ [[maybe_unused]] const char* xpath,
+ [[maybe_unused]] sr_event_t event,
+ [[maybe_unused]] uint32_t request_id)
{
using namespace std::string_literals;
if (event == SR_EV_CHANGE) {
@@ -64,7 +64,7 @@
if (rec) {
cb = MyCallback{moduleName, rec};
} else {
- cb = [] (auto, auto, auto, auto, auto) { return SR_ERR_OK; };
+ cb = [](auto, auto, auto, auto, auto) { return SR_ERR_OK; };
}
m_subscription->module_change_subscribe(moduleName.c_str(), cb);
@@ -72,7 +72,7 @@
struct leafDataToSysrepoVal {
- leafDataToSysrepoVal (sysrepo::S_Val v, const std::string& xpath)
+ leafDataToSysrepoVal(sysrepo::S_Val v, const std::string& xpath)
: v(v)
, xpath(xpath)
{
@@ -108,7 +108,6 @@
std::stringstream ss;
std::copy(what.m_bits.begin(), what.m_bits.end(), std::experimental::make_ostream_joiner(ss, " "));
v->set(xpath.c_str(), ss.str().c_str());
-
}
template <typename Type>
@@ -133,35 +132,36 @@
{
}
int operator()(
- [[maybe_unused]] sysrepo::S_Session sess,
- [[maybe_unused]] const char *module_name,
- const char* path,
- [[maybe_unused]] const char* request_xpath,
- [[maybe_unused]] uint32_t request_id,
- libyang::S_Data_Node& parent)
+ [[maybe_unused]] sysrepo::S_Session sess,
+ [[maybe_unused]] const char* module_name,
+ const char* path,
+ [[maybe_unused]] const char* request_xpath,
+ [[maybe_unused]] uint32_t request_id,
+ libyang::S_Data_Node& parent)
{
auto data = m_dataSupplier.get_data(path);
libyang::S_Data_Node res;
for (const auto& [p, v] : data) {
if (!res) {
res = std::make_shared<libyang::Data_Node>(
- sess->get_context(),
- p.c_str(),
- v.type() == typeid(empty_) ? nullptr : leafDataToString(v).c_str(),
- LYD_ANYDATA_CONSTSTRING,
- 0);
+ sess->get_context(),
+ p.c_str(),
+ v.type() == typeid(empty_) ? nullptr : leafDataToString(v).c_str(),
+ LYD_ANYDATA_CONSTSTRING,
+ 0);
} else {
res->new_path(
- sess->get_context(),
- p.c_str(),
- v.type() == typeid(empty_) ? nullptr : leafDataToString(v).c_str(),
- LYD_ANYDATA_CONSTSTRING,
- 0);
+ sess->get_context(),
+ p.c_str(),
+ v.type() == typeid(empty_) ? nullptr : leafDataToString(v).c_str(),
+ LYD_ANYDATA_CONSTSTRING,
+ 0);
}
}
parent = res;
return SR_ERR_OK;
}
+
private:
const DataSupplier& m_dataSupplier;
};
diff --git a/tests/mock/sysrepo_subscription.hpp b/tests/mock/sysrepo_subscription.hpp
index 06ac405..c3f1f69 100644
--- a/tests/mock/sysrepo_subscription.hpp
+++ b/tests/mock/sysrepo_subscription.hpp
@@ -8,8 +8,8 @@
#pragma once
-#include <optional>
#include <memory>
+#include <optional>
#include "datastore_access.hpp"
namespace sysrepo {
@@ -47,6 +47,7 @@
class OperationalDataSubscription {
public:
OperationalDataSubscription(const std::string& moduleName, const std::string& path, const DataSupplier& dataSupplier);
+
private:
std::shared_ptr<sysrepo::Connection> m_connection;
std::shared_ptr<sysrepo::Session> m_session;
diff --git a/tests/mock/sysrepo_subscription_python.cpp b/tests/mock/sysrepo_subscription_python.cpp
index 55c6289..cde24d1 100644
--- a/tests/mock/sysrepo_subscription_python.cpp
+++ b/tests/mock/sysrepo_subscription_python.cpp
@@ -10,9 +10,10 @@
using namespace pybind11::literals;
-PYBIND11_MODULE(sysrepo_subscription_py, m) {
+PYBIND11_MODULE(sysrepo_subscription_py, m)
+{
m.doc() = "SysrepoSubscription Python interface";
pybind11::class_<SysrepoSubscription>(m, "SysrepoSubscription")
- .def(pybind11::init<const std::string&>(), "moduleName"_a);
+ .def(pybind11::init<const std::string&>(), "moduleName"_a);
}