Skip to content

Commit 958c2be

Browse files
dsobekdyackzan
authored andcommitted
remove gmock
1 parent f6ae2e2 commit 958c2be

File tree

3 files changed

+17
-9
lines changed

3 files changed

+17
-9
lines changed

package.xml

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

26-
<test_depend >ament_cmake_gmock</test_depend>
26+
<test_depend >ament_cmake_gtest</test_depend>
2727

2828
<export>
2929
<build_type >ament_cmake</build_type>

tests/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ set(BT_TESTS
3636

3737
if(ament_cmake_FOUND)
3838

39-
find_package(ament_cmake_gmock REQUIRED)
39+
find_package(ament_cmake_gtest REQUIRED)
4040

41-
ament_add_gmock(${BTCPP_LIBRARY}_test ${BT_TESTS})
41+
ament_add_gtest(${BTCPP_LIBRARY}_test ${BT_TESTS})
4242
target_link_libraries(${BTCPP_LIBRARY}_test
4343
${TEST_DEPENDECIES}
4444
${ament_LIBRARIES})

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)