Skip to content

Commit e49a32a

Browse files
committed
pr comments part 1
1 parent 219532b commit e49a32a

File tree

5 files changed

+10
-6
lines changed

5 files changed

+10
-6
lines changed

src/viam/sdk/common/utils.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,7 @@ std::string random_debug_key() {
127127
}
128128

129129
AttributeMap debug_map() {
130-
auto debug_key = random_debug_key();
131-
return debug_map(debug_key);
130+
return debug_map(random_debug_key());
132131
}
133132

134133
AttributeMap debug_map(std::string debug_key) {

src/viam/sdk/common/utils.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,11 @@ AttributeMap debug_map();
7474
AttributeMap debug_map(std::string debug_key);
7575

7676
/// @brief Adds @param debug_key for server-side debug logging to @param map
77-
/// @throws Exception if the debug_key contains invalid (e.g., uppercase )gRPC characters
77+
/// @throws Exception if the debug_key contains invalid (e.g., uppercase) gRPC characters
7878
AttributeMap add_debug_entry(AttributeMap&& map, std::string debug_key);
7979

8080
/// @brief Adds @param debug_key for server-side debug logging to @param map
81-
/// @throws Exception if the debug_key contains invalid (e.g., uppercase )gRPC characters
81+
/// @throws Exception if the debug_key contains invalid (e.g., uppercase) gRPC characters
8282
AttributeMap add_debug_entry(AttributeMap map, std::string debug_key);
8383

8484
/// @brief Adds a random key to @param map for server-side debug logging

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ std::string MockMotion::move_on_globe(
6565
pose_in_frame MockMotion::get_pose(const Name&,
6666
const std::string&,
6767
const std::vector<WorldState::transform>&,
68-
const AttributeMap&) {
68+
const AttributeMap& extra) {
6969
return current_location;
7070
}
7171

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ class MockMotion : public sdk::Motion {
9191
std::string peek_destination_frame;
9292
double peek_heading;
9393
bool peek_stop_plan_called = false;
94+
std::string peek_debug_key;
9495
std::vector<sdk::geo_geometry> peek_obstacles;
9596
std::vector<sdk::GeometryConfig> peek_map_obstacles;
9697
std::shared_ptr<constraints> peek_constraints;
@@ -99,7 +100,7 @@ class MockMotion : public sdk::Motion {
99100
std::shared_ptr<sdk::WorldState> peek_world_state;
100101

101102
MockMotion(std::string name)
102-
: sdk::Motion(std::move(name)), current_location(init_fake_pose()){};
103+
: sdk::Motion(std::move(name)), current_location(init_fake_pose()) {};
103104
};
104105

105106
} // namespace motion

src/viam/sdk/tests/test_motion.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include <boost/test/included/unit_test.hpp>
44

55
#include <viam/sdk/common/pose.hpp>
6+
#include <viam/sdk/common/utils.hpp>
67
#include <viam/sdk/common/world_state.hpp>
78
#include <viam/sdk/services/motion.hpp>
89
#include <viam/sdk/spatialmath/geometry.hpp>
@@ -171,6 +172,9 @@ BOOST_AUTO_TEST_CASE(test_move_and_get_pose) {
171172
std::string destination_frame("destination");
172173
std::vector<WorldState::transform> transforms;
173174
AttributeMap extra = fake_map();
175+
std::string debug_key = "debug-key";
176+
extra = add_debug_entry(extra, debug_key);
177+
174178
pose_in_frame pose = client.get_pose(fake_component_name(), destination_frame, {}, extra);
175179
BOOST_CHECK_EQUAL(pose, init_fake_pose());
176180

0 commit comments

Comments
 (0)