Covered resolve_use_intra_process (#1359)
* Covered resolve_use_intra_process Signed-off-by: ahcorde <ahcorde@gmail.com> * used RCLCPP_EXPECT_THROW_EQ in test_subscription_throws_intraprocess Signed-off-by: ahcorde <ahcorde@gmail.com>
This commit is contained in:
parent
cb6ac99a49
commit
8808f4b287
1 changed files with 24 additions and 0 deletions
|
@ -15,6 +15,7 @@
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
|
#include <functional>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
@ -461,6 +462,29 @@ TEST_P(TestSubscriptionInvalidIntraprocessQos, test_subscription_throws) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Testing subscription with invalid use_intra_process_comm
|
||||||
|
*/
|
||||||
|
TEST_P(TestSubscriptionInvalidIntraprocessQos, test_subscription_throws_intraprocess) {
|
||||||
|
rclcpp::SubscriptionOptionsWithAllocator<std::allocator<void>> options;
|
||||||
|
options.use_intra_process_comm = static_cast<rclcpp::IntraProcessSetting>(5);
|
||||||
|
|
||||||
|
initialize();
|
||||||
|
rclcpp::QoS qos = GetParam().qos;
|
||||||
|
auto callback = std::bind(
|
||||||
|
&TestSubscriptionInvalidIntraprocessQos::OnMessage,
|
||||||
|
this,
|
||||||
|
std::placeholders::_1);
|
||||||
|
|
||||||
|
RCLCPP_EXPECT_THROW_EQ(
|
||||||
|
{auto subscription = node->create_subscription<test_msgs::msg::Empty>(
|
||||||
|
"topic",
|
||||||
|
qos,
|
||||||
|
callback,
|
||||||
|
options);},
|
||||||
|
std::runtime_error("Unrecognized IntraProcessSetting value"));
|
||||||
|
}
|
||||||
|
|
||||||
static std::vector<TestParameters> invalid_qos_profiles()
|
static std::vector<TestParameters> invalid_qos_profiles()
|
||||||
{
|
{
|
||||||
std::vector<TestParameters> parameters;
|
std::vector<TestParameters> parameters;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue