Skip to content

Commit fc3ce19

Browse files
committed
address ethan's pr comments
1 parent 4b45a7e commit fc3ce19

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

src/viam/sdk/services/discovery.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ class Discovery : public Service {
2727
public:
2828
/// @brief Discover valid viam configuration of resources that are physically
2929
/// connected to your machine.
30-
/// @ingroup Discovery
30+
/// @return array of potential viam configurations for hardware physically
31+
/// connected to your viam server
3132
inline std::vector<ResourceConfig> discover_resources() {
3233
return discover_resources({});
3334
}

src/viam/sdk/tests/mocks/mock_discovery.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ std::vector<sdk::ResourceConfig> MockDiscovery::discover_resources(const sdk::Pr
1414
}
1515

1616
ProtoStruct MockDiscovery::do_command(const sdk::ProtoStruct& command) {
17-
return ProtoStruct{};
17+
return fake_map();
1818
}
1919

2020
} // namespace discovery

src/viam/sdk/tests/test_discovery.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,12 @@ BOOST_AUTO_TEST_CASE(test_discover_resources) {
2727
BOOST_AUTO_TEST_CASE(test_do_command) {
2828
auto mock = std::make_shared<MockDiscovery>("mock_discovery");
2929
client_to_mock_pipeline<Discovery>(mock, [&](Discovery& client) {
30-
const auto ret = client.do_command({});
31-
BOOST_CHECK_EQUAL(ret.size(), 0);
30+
ProtoStruct expected = fake_map();
31+
32+
ProtoStruct command = fake_map();
33+
ProtoStruct result_map = client.do_command(command);
34+
35+
BOOST_CHECK(result_map.at("test") == expected.at("test"));
3236
});
3337
}
3438

0 commit comments

Comments
 (0)