blob: 17ccffaf552316d01751546aaf751d98dca9dac4 [file] [log] [blame]
Patrick Venturefe75b192018-06-08 11:19:43 -07001#include "sensors/manager.hpp"
2
3#include <gmock/gmock.h>
4#include <gtest/gtest.h>
5#include <sdbusplus/test/sdbus_mock.hpp>
6
7using ::testing::_;
8using ::testing::IsNull;
9using ::testing::Return;
10using ::testing::StrEq;
11
12TEST(SensorManagerTest, BoringConstructorTest) {
13 // Build a boring SensorManager.
14
15 sdbusplus::SdBusMock sdbus_mock_passive, sdbus_mock_host;
16 auto bus_mock_passive = sdbusplus::get_mocked_new(&sdbus_mock_passive);
17 auto bus_mock_host = sdbusplus::get_mocked_new(&sdbus_mock_host);
18
19 EXPECT_CALL(sdbus_mock_host,
20 sd_bus_add_object_manager(
21 IsNull(),
22 _,
23 StrEq("/xyz/openbmc_project/extsensors")))
24 .WillOnce(Return(0));
25
26 SensorManager s(std::move(bus_mock_passive), std::move(bus_mock_host));
27 // Success
28}