summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorGunnar Mills <gmills@us.ibm.com>2018-09-14 14:50:03 -0500
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2018-10-18 16:43:22 -0400
commit94df8c9015798764d40665bb363bdbf27510f285 (patch)
treece26611a482f2f03a582838faec29eeb065a6c47 /test
parent7db89e36d7c5649b826b607cb2d90e38bb02ab86 (diff)
downloadopenpower-occ-control-94df8c9015798764d40665bb363bdbf27510f285.tar.gz
openpower-occ-control-94df8c9015798764d40665bb363bdbf27510f285.zip
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: Id6760866dedbaeafd83ea8ef2e0303e30b8955aa Signed-off-by: Gunnar Mills <gmills@us.ibm.com> Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'test')
-rw-r--r--test/TestI2cOcc.cpp9
-rw-r--r--test/utest.cpp60
2 files changed, 35 insertions, 34 deletions
diff --git a/test/TestI2cOcc.cpp b/test/TestI2cOcc.cpp
index bf976d7..92028fd 100644
--- a/test/TestI2cOcc.cpp
+++ b/test/TestI2cOcc.cpp
@@ -1,9 +1,10 @@
+#include "i2c_occ.hpp"
+
#include <experimental/filesystem>
#include <fstream>
-#include <gtest/gtest.h>
#include <string>
-#include "i2c_occ.hpp"
+#include <gtest/gtest.h>
#ifdef I2C_OCC
namespace i2c_occ
@@ -33,10 +34,9 @@ const auto P8_OCC_HWMON = "p8-occ-hwmon";
const auto OTHER_STRING = "SomeOtherString123"s;
-
class TestUtilGetOccHwmonDevices : public testing::Test
{
-public:
+ public:
TestUtilGetOccHwmonDevices()
{
// Prepare env for test case
@@ -171,4 +171,3 @@ TEST(TestI2cDbusNames, getI2cDeviceName)
} // namespace i2c_occ
#endif // I2C_OCC
-
diff --git a/test/utest.cpp b/test/utest.cpp
index dc80cc2..eb9ca0b 100644
--- a/test/utest.cpp
+++ b/test/utest.cpp
@@ -1,43 +1,45 @@
-#include <gtest/gtest.h>
+#include "powercap.hpp"
+
#include <occ_events.hpp>
#include <occ_manager.hpp>
-#include "powercap.hpp"
+
+#include <gtest/gtest.h>
using namespace open_power::occ;
class VerifyOccInput : public ::testing::Test
{
- public:
- VerifyOccInput() :
- bus(sdbusplus::bus::new_default()),
- rc(sd_event_default(&event)),
- eventP(event),
- manager(bus, eventP),
- occStatus(bus, eventP, "/test/path/occ1", manager),
- pcap(bus,occStatus)
- {
- EXPECT_GE(rc, 0);
- event = nullptr;
- }
- ~VerifyOccInput()
- {}
-
- sdbusplus::bus::bus bus;
- sd_event* event;
- int rc;
- open_power::occ::EventPtr eventP;
-
- Manager manager;
- Status occStatus;
- powercap::PowerCap pcap;
+ public:
+ VerifyOccInput() :
+ bus(sdbusplus::bus::new_default()), rc(sd_event_default(&event)),
+ eventP(event), manager(bus, eventP),
+ occStatus(bus, eventP, "/test/path/occ1", manager), pcap(bus, occStatus)
+ {
+ EXPECT_GE(rc, 0);
+ event = nullptr;
+ }
+ ~VerifyOccInput()
+ {
+ }
+
+ sdbusplus::bus::bus bus;
+ sd_event* event;
+ int rc;
+ open_power::occ::EventPtr eventP;
+
+ Manager manager;
+ Status occStatus;
+ powercap::PowerCap pcap;
};
-TEST_F(VerifyOccInput, PcapDisabled) {
- uint32_t occInput = pcap.getOccInput(100,false);
+TEST_F(VerifyOccInput, PcapDisabled)
+{
+ uint32_t occInput = pcap.getOccInput(100, false);
EXPECT_EQ(occInput, 0);
}
-TEST_F(VerifyOccInput, PcapEnabled) {
- uint32_t occInput = pcap.getOccInput(100,true);
+TEST_F(VerifyOccInput, PcapEnabled)
+{
+ uint32_t occInput = pcap.getOccInput(100, true);
EXPECT_EQ(occInput, 90);
}
OpenPOWER on IntegriCloud