Skip to content

Commit 40990da

Browse files
committed
caught more copy pastes
1 parent 99e1629 commit 40990da

File tree

4 files changed

+36
-26
lines changed

4 files changed

+36
-26
lines changed

src/viam/sdk/services/private/discovery_server.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/// @file services/private/discovery_server.hpp
2-
///
2+
///
33
/// @brief Implements a gRPC server for the `Discovery` service
44
#pragma once
55

66
#include <viam/api/service/discovery/v1/discovery.grpc.pb.h>
77
#include <viam/api/service/discovery/v1/discovery.pb.h>
88

9-
#include <viam/sdk/services/discovery.hpp>
109
#include <viam/sdk/resource/resource_manager.hpp>
1110
#include <viam/sdk/resource/resource_server_base.hpp>
11+
#include <viam/sdk/services/discovery.hpp>
1212

1313
namespace viam {
1414
namespace sdk {
@@ -18,7 +18,8 @@ namespace impl {
1818
/// @brief gRPC server implementation of a `Discovery` service.
1919
/// @ingroup Discovery
2020

21-
class ArmServer : public ResourceServer, public viam::service::discovery::v1::DiscoveryService::Service {
21+
class DiscoveryServer : public ResourceServer,
22+
public viam::service::discovery::v1::DiscoveryService::Service {
2223
public:
2324
using interface_type = Discovery;
2425
using service_type = service::discovery::v1::DiscoveryService;
@@ -34,7 +35,6 @@ class ArmServer : public ResourceServer, public viam::service::discovery::v1::Di
3435
::grpc::ServerContext* context,
3536
const ::viam::service::discovery::v1::DoCommandRequest* request,
3637
::viam::service::discovery::v1::DoCommandResponse* response) noexcept override;
37-
3838
};
3939

4040
} // namespace impl

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class MockDiscovery : public sdk::Discovery {
1919
sdk::ProtoStruct peek_command;
2020
};
2121

22-
} // namespace discovery
23-
} // namespace sdktests
24-
} // namespace viam
22+
} // namespace discovery
23+
} // namespace sdktests
24+
} // namespace viam
2525

src/viam/sdk/tests/test_discovery.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ BOOST_AUTO_TEST_CASE(mock_get_api) {
2929
BOOST_AUTO_TEST_CASE(test_discover_resources) {
3030
std::shared_ptr<MockDiscovery> mock = MockDiscovery::get_mock_discovery();
3131
client_to_mock_pipeline<Discovery>(mock, [](Discovery& client) {
32-
const auto & resources = client.discover_resources();
32+
const auto& resources = client.discover_resources();
3333
BOOST_CHECK_EQUAL(resource, fake_discovered_resources());
3434
});
3535
}
3636

37-
BOOST_AUTO_TEST_CASE(test_do_command) {
37+
BOOST_AUTO_TEST_CASE(test_do_command) {
3838
std::shared_ptr<MockDiscovery> mock = MockDiscovery::get_mock_discovery();
3939
client_to_mock_pipeline<Discovery>(mock, [](Discovery& client) {
4040
ProtoStruct expected = fake_map();
@@ -46,5 +46,5 @@ BOOST_AUTO_TEST_CASE(test_do_command) {
4646
});
4747
}
4848

49-
} // namespace sdktests
50-
} // namespace viam
49+
} // namespace sdktests
50+
} // namespace viam

src/viam/sdk/tests/test_utils.cpp

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,31 @@ std::vector<GeometryConfig> fake_geometries() {
2828

2929
std::vector<ResourceConfig> fake_discovered_resources() {
3030
return {
31-
ResourceConfig("camera", "mycam", "rdk", {
32-
{"width", 640},
33-
{"height", 480},
34-
{"format", "mjpeg"}
35-
}, "rdk:component:camera", "rdk:builtin:webcam"),
36-
ResourceConfig("motor", "arm_motor", "rand", {
37-
{"pins", {{"pwm", 18}, {"dir", 23}}},
38-
{"max_rpm", 100},
39-
{"encoder_steps", 200},
40-
}, "rdk:component:motor", "rand:cool:motor" ),
41-
ResourceConfig("sensor", "temp_sensor", "viam", {
42-
{"type", "temperature"},
43-
{"unit", "celsius"},
44-
{"poll_rate", 1000}
45-
}, "rdk:component:sensor", "viam:temp:sensor1"),
31+
ResourceConfig(
32+
"camera",
33+
"mycam",
34+
"rdk",
35+
{{"width", 640}, {"height", 480}, {"format", "mjpeg"}},
36+
"rdk:component:camera",
37+
"rdk:builtin:webcam"),
38+
ResourceConfig(
39+
"motor",
40+
"arm_motor",
41+
"rand",
42+
{
43+
{"pins", {{"pwm", 18}, {"dir", 23}}},
44+
{"max_rpm", 100},
45+
{"encoder_steps", 200},
46+
},
47+
"rdk:component:motor",
48+
"rand:cool:motor"),
49+
ResourceConfig(
50+
"sensor",
51+
"temp_sensor",
52+
"viam",
53+
{{"type", "temperature"}, {"unit", "celsius"}, {"poll_rate", 1000}},
54+
"rdk:component:sensor",
55+
"viam:temp:sensor1"),
4656
};
4757
}
4858

0 commit comments

Comments
 (0)