Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Commit

Permalink
Rename test interfaces package to make it a shorter name
Browse files Browse the repository at this point in the history
Signed-off-by: Emerson Knapp <emerson.b.knapp@gmail.com>
  • Loading branch information
emersonknapp committed Oct 12, 2022
1 parent a7a5440 commit 4bc90dc
Show file tree
Hide file tree
Showing 13 changed files with 41 additions and 44 deletions.
2 changes: 1 addition & 1 deletion rosbag2_storage_mcap/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<test_depend>rosbag2_cpp</test_depend>
<test_depend>rosbag2_test_common</test_depend>
<test_depend>std_msgs</test_depend>
<test_depend>rosbag2_storage_mcap_test_fixture_interfaces</test_depend>
<test_depend>rosbag2_storage_mcap_test_msgs</test_depend>

<export>
<build_type>ament_cmake</build_type>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,61 +25,58 @@ using ::testing::UnorderedElementsAre;

TEST(test_message_definition_cache, can_find_idl_includes) {
const char sample[] = R"r(
#include "rosbag2_storage_mcap_test_fixture_interfaces/msg/BasicIdlA.idl"
#include "rosbag2_storage_mcap_test_msgs/msg/BasicIdlA.idl"
#include <rosbag2_storage_mcap_test_fixture_interfaces/msg/BasicIdlB.idl>
#include <rosbag2_storage_mcap_test_msgs/msg/BasicIdlB.idl>
module rosbag2_storage_mcap_test_fixture_interfaces {
module rosbag2_storage_mcap_test_msgs {
module msg {
struct ComplexIdl {
rosbag2_storage_mcap_test_fixture_interfaces::msg::BasicIdlA a;
rosbag2_storage_mcap_test_fixture_interfaces::msg::BasicIdlB b;
rosbag2_storage_mcap_test_msgs::msg::BasicIdlA a;
rosbag2_storage_mcap_test_msgs::msg::BasicIdlB b;
};
};
};
)r";
std::set<std::string> dependencies = parse_dependencies(Format::IDL, sample, "");
ASSERT_THAT(dependencies,
UnorderedElementsAre("rosbag2_storage_mcap_test_fixture_interfaces/msg/BasicIdlA",
"rosbag2_storage_mcap_test_fixture_interfaces/msg/BasicIdlB"));
ASSERT_THAT(dependencies, UnorderedElementsAre("rosbag2_storage_mcap_test_msgs/msg/BasicIdlA",
"rosbag2_storage_mcap_test_msgs/msg/BasicIdlB"));
}

TEST(test_message_definition_cache, can_find_msg_deps) {
MessageDefinitionCache cache;
auto [format, content] =
cache.get_full_text("rosbag2_storage_mcap_test_fixture_interfaces/ComplexMsg");
auto [format, content] = cache.get_full_text("rosbag2_storage_mcap_test_msgs/ComplexMsg");
ASSERT_EQ(format, Format::MSG);
ASSERT_EQ(content,
R"r(rosbag2_storage_mcap_test_fixture_interfaces/BasicMsg b
R"r(rosbag2_storage_mcap_test_msgs/BasicMsg b
================================================================================
MSG: rosbag2_storage_mcap_test_fixture_interfaces/BasicMsg
MSG: rosbag2_storage_mcap_test_msgs/BasicMsg
float32 c
)r");
}

TEST(test_message_definition_cache, can_find_idl_deps) {
MessageDefinitionCache cache;
auto [format, content] =
cache.get_full_text("rosbag2_storage_mcap_test_fixture_interfaces/msg/ComplexIdl");
auto [format, content] = cache.get_full_text("rosbag2_storage_mcap_test_msgs/msg/ComplexIdl");
EXPECT_EQ(format, Format::IDL);
EXPECT_EQ(content,
R"r(================================================================================
IDL: rosbag2_storage_mcap_test_fixture_interfaces/msg/ComplexIdl
#include "rosbag2_storage_mcap_test_fixture_interfaces/msg/BasicIdl.idl"
IDL: rosbag2_storage_mcap_test_msgs/msg/ComplexIdl
#include "rosbag2_storage_mcap_test_msgs/msg/BasicIdl.idl"
module rosbag2_storage_mcap_test_fixture_interfaces {
module rosbag2_storage_mcap_test_msgs {
module msg {
struct ComplexIdl {
rosbag2_storage_mcap_test_fixture_interfaces::msg::BasicIdl a;
rosbag2_storage_mcap_test_msgs::msg::BasicIdl a;
};
};
};
================================================================================
IDL: rosbag2_storage_mcap_test_fixture_interfaces/msg/BasicIdl
module rosbag2_storage_mcap_test_fixture_interfaces {
IDL: rosbag2_storage_mcap_test_msgs/msg/BasicIdl
module rosbag2_storage_mcap_test_msgs {
module msg {
struct BasicIdl {
float x;
Expand All @@ -92,28 +89,28 @@ module rosbag2_storage_mcap_test_fixture_interfaces {
TEST(test_message_definition_cache, can_resolve_msg_with_idl_deps) {
MessageDefinitionCache cache;
auto [format, content] =
cache.get_full_text("rosbag2_storage_mcap_test_fixture_interfaces/msg/ComplexMsgDependsOnIdl");
cache.get_full_text("rosbag2_storage_mcap_test_msgs/msg/ComplexMsgDependsOnIdl");
EXPECT_EQ(format, Format::IDL);
EXPECT_EQ(content,
R"r(================================================================================
IDL: rosbag2_storage_mcap_test_fixture_interfaces/msg/ComplexMsgDependsOnIdl
IDL: rosbag2_storage_mcap_test_msgs/msg/ComplexMsgDependsOnIdl
// generated from rosidl_adapter/resource/msg.idl.em
// with input from rosbag2_storage_mcap_test_fixture_interfaces/msg/ComplexMsgDependsOnIdl.msg
// with input from rosbag2_storage_mcap_test_msgs/msg/ComplexMsgDependsOnIdl.msg
// generated code does not contain a copyright notice
#include "rosbag2_storage_mcap_test_fixture_interfaces/msg/BasicIdl.idl"
#include "rosbag2_storage_mcap_test_msgs/msg/BasicIdl.idl"
module rosbag2_storage_mcap_test_fixture_interfaces {
module rosbag2_storage_mcap_test_msgs {
module msg {
struct ComplexMsgDependsOnIdl {
rosbag2_storage_mcap_test_fixture_interfaces::msg::BasicIdl a;
rosbag2_storage_mcap_test_msgs::msg::BasicIdl a;
};
};
};
================================================================================
IDL: rosbag2_storage_mcap_test_fixture_interfaces/msg/BasicIdl
module rosbag2_storage_mcap_test_fixture_interfaces {
IDL: rosbag2_storage_mcap_test_msgs/msg/BasicIdl
module rosbag2_storage_mcap_test_msgs {
module msg {
struct BasicIdl {
float x;
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Changelog for package rosbag2_storage_mcap_test_fixture_interfaces
Changelog for package rosbag2_storage_mcap_test_msgs
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0.4.0 (2022-10-06)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.8)
project(rosbag2_storage_mcap_test_fixture_interfaces)
project(rosbag2_storage_mcap_test_msgs)

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module rosbag2_storage_mcap_test_fixture_interfaces {
module rosbag2_storage_mcap_test_msgs {
module msg {
struct BasicIdl {
float x;
Expand Down
9 changes: 9 additions & 0 deletions rosbag2_storage_mcap_test_msgs/msg/ComplexIdl.idl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include "rosbag2_storage_mcap_test_msgs/msg/BasicIdl.idl"

module rosbag2_storage_mcap_test_msgs {
module msg {
struct ComplexIdl {
rosbag2_storage_mcap_test_msgs::msg::BasicIdl a;
};
};
};
1 change: 1 addition & 0 deletions rosbag2_storage_mcap_test_msgs/msg/ComplexMsg.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rosbag2_storage_mcap_test_msgs/BasicMsg b
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rosbag2_storage_mcap_test_msgs/BasicIdl a
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>rosbag2_storage_mcap_test_fixture_interfaces</name>
<name>rosbag2_storage_mcap_test_msgs</name>
<version>0.4.0</version>
<description>message definition test fixtures for MCAP schema recording</description>
<maintainer email="james@foxglove.dev">James Smith</maintainer>
Expand Down

0 comments on commit 4bc90dc

Please sign in to comment.