Skip to content

remove gmock #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<depend>libsqlite3-dev</depend>
<depend>libzmq3-dev</depend>

<test_depend condition="$ROS_VERSION == 2">ament_cmake_gmock</test_depend>
<test_depend condition="$ROS_VERSION == 2">ament_cmake_gtest</test_depend>

<export>
<build_type condition="$ROS_VERSION == 1">catkin</build_type>
Expand Down
20 changes: 14 additions & 6 deletions tests/gtest_subtree.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include <gtest/gtest.h>
#include <gmock/gmock-matchers.h>
#include "behaviortree_cpp/bt_factory.h"
#include "../sample_nodes/dummy_nodes.h"
#include "../sample_nodes/movebase_node.h"
Expand All @@ -8,8 +7,6 @@
#include "test_helper.hpp"

using namespace BT;
using ::testing::Contains;
using ::testing::Pair;

TEST(SubTree, SiblingPorts_Issue_72)
{
Expand Down Expand Up @@ -605,10 +602,21 @@ TEST(SubTree, SubtreeModels)
}
});

// Make sure ports are correct in the node config
ASSERT_NE(subtreeNode, nullptr);
EXPECT_THAT(subtreeNode->config().input_ports, Contains(Pair("in_name", "{my_name}")));
EXPECT_THAT(subtreeNode->config().output_ports, Contains(Pair("out_state", "{my_"
"state}")));
const PortsRemapping& input_ports = subtreeNode->config().input_ports;
EXPECT_EQ(input_ports.size(), 2);
ASSERT_TRUE(input_ports.contains("in_name"));
EXPECT_EQ(input_ports.at("in_name"), "{my_name}");
ASSERT_TRUE(input_ports.contains("in_value"));
EXPECT_EQ(input_ports.at("in_value"), "42");
const PortsRemapping& output_ports = subtreeNode->config().output_ports;
EXPECT_EQ(output_ports.size(), 2);
ASSERT_TRUE(output_ports.contains("out_result"));
EXPECT_EQ(output_ports.at("out_result"), "{output}");
ASSERT_TRUE(output_ports.contains("out_state"));
EXPECT_EQ(output_ports.at("out_state"), "{my_state}");

tree.tickWhileRunning();
}

Expand Down
Loading