Skip to content

Commit 1746798

Browse files
f0reachARRpre-commit-ci[bot]HansRobo
authored
fix: fix Boost.Optional build error on Jazzy (#7602)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Kotaro Yoshimoto <pythagora.yoshimoto@gmail.com>
1 parent 2ab8f88 commit 1746798

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

common/autoware_signal_processing/test/src/lowpass_filter_1d_test.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
#include "autoware/signal_processing/lowpass_filter_1d.hpp"
1616

17+
#include <boost/optional/optional_io.hpp>
18+
1719
#include <gtest/gtest.h>
1820

1921
constexpr double epsilon = 1e-6;
@@ -25,7 +27,7 @@ TEST(lowpass_filter_1d, filter)
2527
LowpassFilter1d lowpass_filter_1d(0.1);
2628

2729
// initial state
28-
EXPECT_EQ(lowpass_filter_1d.getValue(), boost::none);
30+
EXPECT_FALSE(lowpass_filter_1d.getValue());
2931

3032
// random filter
3133
EXPECT_NEAR(lowpass_filter_1d.filter(0.0), 0.0, epsilon);
@@ -35,7 +37,7 @@ TEST(lowpass_filter_1d, filter)
3537

3638
// reset without value
3739
lowpass_filter_1d.reset();
38-
EXPECT_EQ(lowpass_filter_1d.getValue(), boost::none);
40+
EXPECT_FALSE(lowpass_filter_1d.getValue());
3941

4042
// reset with value
4143
lowpass_filter_1d.reset(-1.1);

common/autoware_signal_processing/test/src/lowpass_filter_test.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
#include "autoware/signal_processing/lowpass_filter.hpp"
1616

17+
#include <boost/optional/optional_io.hpp>
18+
1719
#include <gtest/gtest.h>
1820

1921
constexpr double epsilon = 1e-6;
@@ -41,7 +43,7 @@ TEST(lowpass_filter_twist, filter)
4143
LowpassFilterTwist lowpass_filter_(0.1);
4244

4345
{ // initial state
44-
EXPECT_EQ(lowpass_filter_.getValue(), boost::none);
46+
EXPECT_FALSE(lowpass_filter_.getValue());
4547
}
4648

4749
{ // random filter
@@ -58,7 +60,7 @@ TEST(lowpass_filter_twist, filter)
5860

5961
{ // reset without value
6062
lowpass_filter_.reset();
61-
EXPECT_EQ(lowpass_filter_.getValue(), boost::none);
63+
EXPECT_FALSE(lowpass_filter_.getValue());
6264
}
6365

6466
{ // reset with value

common/object_recognition_utils/test/src/test_predicted_path_utils.cpp

+7-5
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
#include "autoware/universe_utils/math/unit_conversion.hpp"
1717
#include "object_recognition_utils/predicted_path_utils.hpp"
1818

19+
#include <boost/optional/optional_io.hpp>
20+
1921
#include <gtest/gtest.h>
2022

2123
using autoware::universe_utils::Point2d;
@@ -75,7 +77,7 @@ TEST(predicted_path_utils, testCalcInterpolatedPose)
7577
for (double t = 0.0; t < 9.0 + 1e-6; t += 1.0) {
7678
const auto p = calcInterpolatedPose(path, t);
7779

78-
EXPECT_NE(p, boost::none);
80+
EXPECT_TRUE(p);
7981
EXPECT_NEAR(p->position.x, t * 1.0, epsilon);
8082
EXPECT_NEAR(p->position.y, 0.0, epsilon);
8183
EXPECT_NEAR(p->position.z, 0.0, epsilon);
@@ -92,7 +94,7 @@ TEST(predicted_path_utils, testCalcInterpolatedPose)
9294
for (double t = 0.0; t < 9.0; t += 0.3) {
9395
const auto p = calcInterpolatedPose(path, t);
9496

95-
EXPECT_NE(p, boost::none);
97+
EXPECT_TRUE(p);
9698
EXPECT_NEAR(p->position.x, t * 1.0, epsilon);
9799
EXPECT_NEAR(p->position.y, 0.0, epsilon);
98100
EXPECT_NEAR(p->position.z, 0.0, epsilon);
@@ -108,20 +110,20 @@ TEST(predicted_path_utils, testCalcInterpolatedPose)
108110
// Negative time
109111
{
110112
const auto p = calcInterpolatedPose(path, -1.0);
111-
EXPECT_EQ(p, boost::none);
113+
EXPECT_FALSE(p);
112114
}
113115

114116
// Over the time horizon
115117
{
116118
const auto p = calcInterpolatedPose(path, 11.0);
117-
EXPECT_EQ(p, boost::none);
119+
EXPECT_FALSE(p);
118120
}
119121

120122
// Empty Path
121123
{
122124
PredictedPath empty_path;
123125
const auto p = calcInterpolatedPose(empty_path, 5.0);
124-
EXPECT_EQ(p, boost::none);
126+
EXPECT_FALSE(p);
125127
}
126128
}
127129
}

0 commit comments

Comments
 (0)