Skip to content

Commit

Permalink
Revert uncrustify changes from previous commit.
Browse files Browse the repository at this point in the history
- Rationale: We are moving to the new version of the uncrustify in
rolling and still haven't done it yet fully for the baseline.
The discrepancy in style for other untouched files like logging.hpp
shall be addressed in a separate PR.

Signed-off-by: Michael Orlov <[email protected]>
  • Loading branch information
morlov-apexai committed Apr 9, 2024
1 parent 94d418f commit 00bff3e
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 37 deletions.
24 changes: 12 additions & 12 deletions rosbag2_cpp/include/rosbag2_cpp/logging.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,36 +26,36 @@
RCUTILS_LOG_INFO_NAMED(ROSBAG2_CPP_PACKAGE_NAME, __VA_ARGS__)

#define ROSBAG2_CPP_LOG_INFO_STREAM(args) do { \
std::stringstream __ss; \
__ss << args; \
RCUTILS_LOG_INFO_NAMED(ROSBAG2_CPP_PACKAGE_NAME, "%s", __ss.str().c_str()); \
std::stringstream __ss; \
__ss << args; \
RCUTILS_LOG_INFO_NAMED(ROSBAG2_CPP_PACKAGE_NAME, "%s", __ss.str().c_str()); \
} while (0)

#define ROSBAG2_CPP_LOG_ERROR(...) \
RCUTILS_LOG_ERROR_NAMED(ROSBAG2_CPP_PACKAGE_NAME, __VA_ARGS__)

#define ROSBAG2_CPP_LOG_ERROR_STREAM(args) do { \
std::stringstream __ss; \
__ss << args; \
RCUTILS_LOG_ERROR_NAMED(ROSBAG2_CPP_PACKAGE_NAME, "%s", __ss.str().c_str()); \
std::stringstream __ss; \
__ss << args; \
RCUTILS_LOG_ERROR_NAMED(ROSBAG2_CPP_PACKAGE_NAME, "%s", __ss.str().c_str()); \
} while (0)

#define ROSBAG2_CPP_LOG_WARN(...) \
RCUTILS_LOG_WARN_NAMED(ROSBAG2_CPP_PACKAGE_NAME, __VA_ARGS__)

#define ROSBAG2_CPP_LOG_WARN_STREAM(args) do { \
std::stringstream __ss; \
__ss << args; \
RCUTILS_LOG_WARN_NAMED(ROSBAG2_CPP_PACKAGE_NAME, "%s", __ss.str().c_str()); \
std::stringstream __ss; \
__ss << args; \
RCUTILS_LOG_WARN_NAMED(ROSBAG2_CPP_PACKAGE_NAME, "%s", __ss.str().c_str()); \
} while (0)

#define ROSBAG2_CPP_LOG_DEBUG(...) \
RCUTILS_LOG_DEBUG_NAMED(ROSBAG2_CPP_PACKAGE_NAME, __VA_ARGS__)

#define ROSBAG2_CPP_LOG_DEBUG_STREAM(args) do { \
std::stringstream __ss; \
__ss << args; \
RCUTILS_LOG_DEBUG_NAMED(ROSBAG2_CPP_PACKAGE_NAME, "%s", __ss.str().c_str()); \
std::stringstream __ss; \
__ss << args; \
RCUTILS_LOG_DEBUG_NAMED(ROSBAG2_CPP_PACKAGE_NAME, "%s", __ss.str().c_str()); \
} while (0)

#endif // ROSBAG2_CPP__LOGGING_HPP_
2 changes: 1 addition & 1 deletion rosbag2_cpp/test/rosbag2_cpp/test_sequential_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ TEST_F(
write(An<const std::vector<std::shared_ptr<const rosbag2_storage::SerializedBagMessage>> &>())).
WillByDefault(
[this, &written_messages]
(const std::vector<std::shared_ptr<const rosbag2_storage::SerializedBagMessage>> & msgs)
(const std::vector<std::shared_ptr<const rosbag2_storage::SerializedBagMessage>> & msgs)
{
written_messages += msgs.size();
fake_storage_size_.fetch_add(static_cast<uint32_t>(msgs.size()));
Expand Down
8 changes: 4 additions & 4 deletions rosbag2_tests/test/rosbag2_tests/test_reindexer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,10 @@ TEST_P(ReindexTestFixture, test_multiple_files) {
target_metadata.topics_with_message_count.end(),
[&gen_topic](rosbag2_storage::TopicInformation & t) {
return (t.topic_metadata.name == gen_topic.topic_metadata.name) &&
(t.message_count == gen_topic.message_count) &&
(t.topic_metadata.offered_qos_profiles ==
gen_topic.topic_metadata.offered_qos_profiles) &&
(t.topic_metadata.type == gen_topic.topic_metadata.type);
(t.message_count == gen_topic.message_count) &&
(t.topic_metadata.offered_qos_profiles ==
gen_topic.topic_metadata.offered_qos_profiles) &&
(t.topic_metadata.type == gen_topic.topic_metadata.type);
}
) != target_metadata.topics_with_message_count.end()
);
Expand Down
24 changes: 12 additions & 12 deletions rosbag2_transport/src/rosbag2_transport/logging.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,36 +26,36 @@
RCUTILS_LOG_INFO_NAMED(ROSBAG2_TRANSPORT_PACKAGE_NAME, __VA_ARGS__)

#define ROSBAG2_TRANSPORT_LOG_INFO_STREAM(args) do { \
std::stringstream __ss; \
__ss << args; \
RCUTILS_LOG_INFO_NAMED(ROSBAG2_TRANSPORT_PACKAGE_NAME, "%s", __ss.str().c_str()); \
std::stringstream __ss; \
__ss << args; \
RCUTILS_LOG_INFO_NAMED(ROSBAG2_TRANSPORT_PACKAGE_NAME, "%s", __ss.str().c_str()); \
} while (0)

#define ROSBAG2_TRANSPORT_LOG_ERROR(...) \
RCUTILS_LOG_ERROR_NAMED(ROSBAG2_TRANSPORT_PACKAGE_NAME, __VA_ARGS__)

#define ROSBAG2_TRANSPORT_LOG_ERROR_STREAM(args) do { \
std::stringstream __ss; \
__ss << args; \
RCUTILS_LOG_ERROR_NAMED(ROSBAG2_TRANSPORT_PACKAGE_NAME, "%s", __ss.str().c_str()); \
std::stringstream __ss; \
__ss << args; \
RCUTILS_LOG_ERROR_NAMED(ROSBAG2_TRANSPORT_PACKAGE_NAME, "%s", __ss.str().c_str()); \
} while (0)

#define ROSBAG2_TRANSPORT_LOG_WARN(...) \
RCUTILS_LOG_WARN_NAMED(ROSBAG2_TRANSPORT_PACKAGE_NAME, __VA_ARGS__)

#define ROSBAG2_TRANSPORT_LOG_WARN_STREAM(args) do { \
std::stringstream __ss; \
__ss << args; \
RCUTILS_LOG_WARN_NAMED(ROSBAG2_TRANSPORT_PACKAGE_NAME, "%s", __ss.str().c_str()); \
std::stringstream __ss; \
__ss << args; \
RCUTILS_LOG_WARN_NAMED(ROSBAG2_TRANSPORT_PACKAGE_NAME, "%s", __ss.str().c_str()); \
} while (0)

#define ROSBAG2_TRANSPORT_LOG_DEBUG(...) \
RCUTILS_LOG_DEBUG_NAMED(ROSBAG2_TRANSPORT_PACKAGE_NAME, __VA_ARGS__)

#define ROSBAG2_TRANSPORT_LOG_DEBUG_STREAM(args) do { \
std::stringstream __ss; \
__ss << args; \
RCUTILS_LOG_DEBUG_NAMED(ROSBAG2_TRANSPORT_PACKAGE_NAME, "%s", __ss.str().c_str()); \
std::stringstream __ss; \
__ss << args; \
RCUTILS_LOG_DEBUG_NAMED(ROSBAG2_TRANSPORT_PACKAGE_NAME, "%s", __ss.str().c_str()); \
} while (0)

#endif // ROSBAG2_TRANSPORT__LOGGING_HPP_
6 changes: 4 additions & 2 deletions rosbag2_transport/test/rosbag2_transport/test_play.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,8 @@ TEST_F(RosBag2PlayTestFixture, player_gracefully_exit_by_rclcpp_shutdown_in_paus
player->wait_for_playback_to_finish();
}

TEST_F(RosBag2PlayTestFixture,
TEST_F(
RosBag2PlayTestFixture,
player_with_service_request_from_recorded_service_introspection_message)
{
auto services_types = std::vector<rosbag2_storage::TopicMetadata>{
Expand Down Expand Up @@ -891,7 +892,8 @@ TEST_F(RosBag2PlayTestFixture,
EXPECT_EQ(service1_receive_requests.size(), 2);
}

TEST_F(RosBag2PlayTestFixture,
TEST_F(
RosBag2PlayTestFixture,
player_with_service_request_from_recorded_client_introspection_message)
{
auto services_types = std::vector<rosbag2_storage::TopicMetadata>{
Expand Down
12 changes: 6 additions & 6 deletions rosbag2_transport/test/rosbag2_transport/test_record.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,8 @@ TEST_F(RecordIntegrationTestFixture, mixed_qos_subscribes) {
[publisher_volatile, publisher_transient_local]() {
// This test is a success if rosbag2 has connected to both publishers
return
publisher_volatile->get_subscription_count() &&
publisher_transient_local->get_subscription_count();
publisher_volatile->get_subscription_count() &&
publisher_transient_local->get_subscription_count();
});
ASSERT_TRUE(succeeded);
}
Expand Down Expand Up @@ -359,10 +359,10 @@ TEST_F(RecordIntegrationTestFixture, duration_and_noncompatibility_policies_mixe
std::chrono::seconds(5), recorder,
[publisher_history, publisher_lifespan, publisher_deadline, publisher_liveliness]() {
return
publisher_history->get_subscription_count() &&
publisher_lifespan->get_subscription_count() &&
publisher_deadline->get_subscription_count() &&
publisher_liveliness->get_subscription_count();
publisher_history->get_subscription_count() &&
publisher_lifespan->get_subscription_count() &&
publisher_deadline->get_subscription_count() &&
publisher_liveliness->get_subscription_count();
});
ASSERT_TRUE(succeeded);
}
Expand Down

0 comments on commit 00bff3e

Please sign in to comment.