clang-format: Update to match docs repo
Update the .clang-format file and run clang-format-6.0.
This .clang-format matches the example one in
https://github.com/openbmc/docs/blob/master/cpp-style-and-conventions.md#clang-formatting
Change-Id: Ia331c9a5b040e1a3c45a0ebf1b8d776d93b05ae5
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
diff --git a/test/test_network_manager.cpp b/test/test_network_manager.cpp
index 2776bcf..1c0a116 100644
--- a/test/test_network_manager.cpp
+++ b/test/test_network_manager.cpp
@@ -1,20 +1,19 @@
-#include "network_manager.hpp"
#include "mock_syscall.hpp"
-
-#include "xyz/openbmc_project/Common/error.hpp"
-#include <phosphor-logging/elog-errors.hpp>
+#include "network_manager.hpp"
#include "timer.hpp"
+#include "xyz/openbmc_project/Common/error.hpp"
-#include <gtest/gtest.h>
-#include <sdbusplus/bus.hpp>
-
+#include <arpa/inet.h>
#include <net/if.h>
#include <netinet/in.h>
-#include <arpa/inet.h>
#include <stdlib.h>
#include <exception>
#include <experimental/filesystem>
+#include <phosphor-logging/elog-errors.hpp>
+#include <sdbusplus/bus.hpp>
+
+#include <gtest/gtest.h>
namespace phosphor
{
@@ -25,49 +24,48 @@
class TestNetworkManager : public testing::Test
{
- public:
+ public:
+ sdbusplus::bus::bus bus;
+ Manager manager;
+ std::string confDir;
+ TestNetworkManager() :
+ bus(sdbusplus::bus::new_default()),
+ manager(bus, "/xyz/openbmc_test/abc", "/tmp")
+ {
+ setConfDir();
+ }
- sdbusplus::bus::bus bus;
- Manager manager;
- std::string confDir;
- TestNetworkManager()
- : bus(sdbusplus::bus::new_default()),
- manager(bus, "/xyz/openbmc_test/abc", "/tmp")
+ ~TestNetworkManager()
+ {
+ if (confDir != "")
{
- setConfDir();
+ fs::remove_all(confDir);
}
+ }
- ~TestNetworkManager()
- {
- if(confDir != "")
- {
- fs::remove_all(confDir);
- }
- }
+ void setConfDir()
+ {
+ char tmp[] = "/tmp/NetworkManager.XXXXXX";
+ confDir = mkdtemp(tmp);
+ manager.setConfDir(confDir);
+ }
- void setConfDir()
- {
- char tmp[] = "/tmp/NetworkManager.XXXXXX";
- confDir = mkdtemp(tmp);
- manager.setConfDir(confDir);
- }
+ void createInterfaces()
+ {
+ manager.createInterfaces();
+ }
- void createInterfaces()
- {
- manager.createInterfaces();
- }
+ int getSize()
+ {
+ return manager.interfaces.size();
+ }
- int getSize()
- {
- return manager.interfaces.size();
- }
-
- bool isInterfaceAdded(std::string intf)
- {
- return manager.interfaces.find(intf) != manager.interfaces.end() ?
- true :
- false;
- }
+ bool isInterfaceAdded(std::string intf)
+ {
+ return manager.interfaces.find(intf) != manager.interfaces.end()
+ ? true
+ : false;
+ }
};
// getifaddrs will not return any interface
@@ -130,5 +128,5 @@
}
}
-}// namespce network
-}// namespace phosphor
+} // namespace network
+} // namespace phosphor