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: Ic2c462525eb27b8295c2b298871e04268d93faf2
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
diff --git a/test/TestManager.cpp b/test/TestManager.cpp
index aa7a647..c0763c8 100644
--- a/test/TestManager.cpp
+++ b/test/TestManager.cpp
@@ -1,9 +1,10 @@
-#include <sdbusplus/bus.hpp>
-#include <gtest/gtest.h>
-
-#include "types.hpp"
#include "manager.hpp"
#include "mocked_property_change_listener.hpp"
+#include "types.hpp"
+
+#include <sdbusplus/bus.hpp>
+
+#include <gtest/gtest.h>
using ::testing::_;
@@ -14,52 +15,49 @@
class TestManager : public testing::Test
{
- public:
- sdbusplus::bus::bus bus;
- Manager manager;
- MockPropertyChangeListner listener1;
- MockPropertyChangeListner listener2;
+ public:
+ sdbusplus::bus::bus bus;
+ Manager manager;
+ MockPropertyChangeListner listener1;
+ MockPropertyChangeListner listener2;
- TestManager()
- : bus(sdbusplus::bus::new_default()),
- manager(bus)
- {
- // Add two mocked listeners so that we can test
- // the behavior related to listeners
- manager.addListener(&listener1);
- manager.addListener(&listener2);
- }
+ TestManager() : bus(sdbusplus::bus::new_default()), manager(bus)
+ {
+ // Add two mocked listeners so that we can test
+ // the behavior related to listeners
+ manager.addListener(&listener1);
+ manager.addListener(&listener2);
+ }
- // Proxies for Manager's private members and functions
- Mode getTimeMode()
- {
- return manager.timeMode;
- }
- Owner getTimeOwner()
- {
- return manager.timeOwner;
- }
- bool hostOn()
- {
- return manager.hostOn;
- }
- std::string getRequestedMode()
- {
- return manager.requestedMode;
- }
- std::string getRequestedOwner()
- {
- return manager.requestedOwner;
- }
- void notifyPropertyChanged(const std::string& key,
- const std::string& value)
- {
- manager.onPropertyChanged(key, value);
- }
- void notifyOnHostState(bool hostOn)
- {
- manager.onHostState(hostOn);
- }
+ // Proxies for Manager's private members and functions
+ Mode getTimeMode()
+ {
+ return manager.timeMode;
+ }
+ Owner getTimeOwner()
+ {
+ return manager.timeOwner;
+ }
+ bool hostOn()
+ {
+ return manager.hostOn;
+ }
+ std::string getRequestedMode()
+ {
+ return manager.requestedMode;
+ }
+ std::string getRequestedOwner()
+ {
+ return manager.requestedOwner;
+ }
+ void notifyPropertyChanged(const std::string& key, const std::string& value)
+ {
+ manager.onPropertyChanged(key, value);
+ }
+ void notifyOnHostState(bool hostOn)
+ {
+ manager.onHostState(hostOn);
+ }
};
TEST_F(TestManager, DISABLED_empty)
@@ -73,7 +71,6 @@
EXPECT_EQ(Owner::Both, getTimeOwner());
}
-
TEST_F(TestManager, DISABLED_hostStateChange)
{
notifyOnHostState(true);
@@ -96,9 +93,8 @@
notifyPropertyChanged(
"TimeSyncMethod",
"xyz.openbmc_project.Time.Synchronization.Method.Manual");
- notifyPropertyChanged(
- "TimeOwner",
- "xyz.openbmc_project.Time.Owner.Owners.Host");
+ notifyPropertyChanged("TimeOwner",
+ "xyz.openbmc_project.Time.Owner.Owners.Host");
EXPECT_EQ("", getRequestedMode());
EXPECT_EQ("", getRequestedOwner());
@@ -115,16 +111,14 @@
notifyPropertyChanged(
"TimeSyncMethod",
"xyz.openbmc_project.Time.Synchronization.Method.NTP");
- notifyPropertyChanged(
- "TimeOwner",
- "xyz.openbmc_project.Time.Owner.Owners.Split");
+ notifyPropertyChanged("TimeOwner",
+ "xyz.openbmc_project.Time.Owner.Owners.Split");
EXPECT_EQ("xyz.openbmc_project.Time.Synchronization.Method.NTP",
getRequestedMode());
EXPECT_EQ("xyz.openbmc_project.Time.Owner.Owners.Split",
getRequestedOwner());
-
// When host becomes off, the requested mode/owner shall be notified
// to listeners, and be cleared
EXPECT_CALL(listener1, onModeChanged(Mode::NTP)).Times(1);
@@ -149,9 +143,8 @@
notifyPropertyChanged(
"TimeSyncMethod",
"xyz.openbmc_project.Time.Synchronization.Method.Manual");
- notifyPropertyChanged(
- "TimeOwner",
- "xyz.openbmc_project.Time.Owner.Owners.Host");
+ notifyPropertyChanged("TimeOwner",
+ "xyz.openbmc_project.Time.Owner.Owners.Host");
// Set host on
notifyOnHostState(true);
@@ -165,9 +158,8 @@
notifyPropertyChanged(
"TimeSyncMethod",
"xyz.openbmc_project.Time.Synchronization.Method.NTP");
- notifyPropertyChanged(
- "TimeOwner",
- "xyz.openbmc_project.Time.Owner.Owners.Split");
+ notifyPropertyChanged("TimeOwner",
+ "xyz.openbmc_project.Time.Owner.Owners.Split");
// Saved as requested mode/owner
EXPECT_EQ("xyz.openbmc_project.Time.Synchronization.Method.NTP",
@@ -179,9 +171,8 @@
notifyPropertyChanged(
"TimeSyncMethod",
"xyz.openbmc_project.Time.Synchronization.Method.Manual");
- notifyPropertyChanged(
- "TimeOwner",
- "xyz.openbmc_project.Time.Owner.Owners.Host");
+ notifyPropertyChanged("TimeOwner",
+ "xyz.openbmc_project.Time.Owner.Owners.Host");
// Requested mode/owner shall be updated
EXPECT_EQ("xyz.openbmc_project.Time.Synchronization.Method.Manual",
@@ -206,5 +197,5 @@
// TODO: if gmock is ready, add case to test
// updateNtpSetting() and updateNetworkSetting()
-}
-}
+} // namespace time
+} // namespace phosphor