Skip to content

Commit 62cd369

Browse files
committed
remove gmock
1 parent 8618fb8 commit 62cd369

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

package.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<depend>libsqlite3-dev</depend>
2525
<depend>libzmq3-dev</depend>
2626

27-
<test_depend condition="$ROS_VERSION == 2">ament_cmake_gmock</test_depend>
27+
<test_depend condition="$ROS_VERSION == 2">ament_cmake_gtest</test_depend>
2828

2929
<export>
3030
<build_type condition="$ROS_VERSION == 1">catkin</build_type>

tests/gtest_subtree.cpp

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#include <gtest/gtest.h>
2-
#include <gmock/gmock-matchers.h>
32
#include "behaviortree_cpp/bt_factory.h"
43
#include "../sample_nodes/dummy_nodes.h"
54
#include "../sample_nodes/movebase_node.h"
@@ -8,8 +7,6 @@
87
#include "test_helper.hpp"
98

109
using namespace BT;
11-
using ::testing::Contains;
12-
using ::testing::Pair;
1310

1411
TEST(SubTree, SiblingPorts_Issue_72)
1512
{
@@ -605,10 +602,21 @@ TEST(SubTree, SubtreeModels)
605602
}
606603
});
607604

605+
// Make sure ports are correct in the node config
608606
ASSERT_NE(subtreeNode, nullptr);
609-
EXPECT_THAT(subtreeNode->config().input_ports, Contains(Pair("in_name", "{my_name}")));
610-
EXPECT_THAT(subtreeNode->config().output_ports, Contains(Pair("out_state", "{my_"
611-
"state}")));
607+
const PortsRemapping& input_ports = subtreeNode->config().input_ports;
608+
EXPECT_EQ(input_ports.size(), 2);
609+
ASSERT_TRUE(input_ports.contains("in_name"));
610+
EXPECT_EQ(input_ports.at("in_name"), "{my_name}");
611+
ASSERT_TRUE(input_ports.contains("in_value"));
612+
EXPECT_EQ(input_ports.at("in_value"), "42");
613+
const PortsRemapping& output_ports = subtreeNode->config().output_ports;
614+
EXPECT_EQ(output_ports.size(), 2);
615+
ASSERT_TRUE(output_ports.contains("out_result"));
616+
EXPECT_EQ(output_ports.at("out_result"), "{output}");
617+
ASSERT_TRUE(output_ports.contains("out_state"));
618+
EXPECT_EQ(output_ports.at("out_state"), "{my_state}");
619+
612620
tree.tickWhileRunning();
613621
}
614622

0 commit comments

Comments
 (0)