From e700d3becdc745ab5250b7b898dfe9423fe4ab39 Mon Sep 17 00:00:00 2001 From: brawner Date: Fri, 9 Oct 2020 10:47:43 -0700 Subject: [PATCH] [foxy backport] Add ostream test for FutureReturnCode (#1327) (#1393) * Remove deprecated executor::FutureReturnCode APIs. (#1327) While we are here, add in another test for the stream operator for future_return_code.cpp Signed-off-by: Chris Lalancette * Revert removing deprecated API Signed-off-by: Stephen Brawner Co-authored-by: Chris Lalancette --- rclcpp/test/rclcpp/test_future_return_code.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/rclcpp/test/rclcpp/test_future_return_code.cpp b/rclcpp/test/rclcpp/test_future_return_code.cpp index f4647b6..0ad2dcd 100644 --- a/rclcpp/test/rclcpp/test_future_return_code.cpp +++ b/rclcpp/test/rclcpp/test_future_return_code.cpp @@ -1,4 +1,4 @@ -// Copyright 2015 Open Source Robotics Foundation, Inc. +// Copyright 2020 Open Source Robotics Foundation, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -14,6 +14,7 @@ #include +#include #include #include "rclcpp/future_return_code.hpp" @@ -32,3 +33,10 @@ TEST(TestFutureReturnCode, to_string) { EXPECT_EQ( "Unknown enum value (100)", rclcpp::to_string(rclcpp::FutureReturnCode(100))); } + +TEST(FutureReturnCode, ostream) { + std::ostringstream ostream; + + ostream << rclcpp::FutureReturnCode::SUCCESS; + ASSERT_EQ("SUCCESS (0)", ostream.str()); +}