Skip to content

Commit 52e22af

Browse files
Fix the boost::optional usage (#1459)
Remove the has_value usage, since it's not available in old boost Relates-To: OLPEDGE-2853 Signed-off-by: Mykhailo Kuchma <ext-mykhailo.kuchma@here.com>
1 parent 6ec925a commit 52e22af

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

olp-cpp-sdk-dataservice-read/tests/MetadataApiTest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ TEST_P(MetadataApiParamTest, GetPartitionsStream) {
162162
const std::uint64_t offset{7};
163163

164164
const auto range_header = [&]() -> boost::optional<olp::http::Header> {
165-
if (test_params.range.has_value()) {
165+
if (test_params.range) {
166166
return olp::http::Header{"Range", test_params.range.value()};
167167
}
168168
return boost::none;
@@ -184,7 +184,7 @@ TEST_P(MetadataApiParamTest, GetPartitionsStream) {
184184

185185
EXPECT_EQ(response.GetStatus(), http::HttpStatusCode::OK);
186186
EXPECT_STREQ(ref_stream_data.c_str(), received_stream_data.c_str());
187-
EXPECT_TRUE(received_offset.has_value());
187+
EXPECT_TRUE(received_offset);
188188
EXPECT_EQ(received_offset.value_or(0), offset);
189189
}
190190

olp-cpp-sdk-dataservice-read/tests/PartitionsRepositoryTest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1887,7 +1887,7 @@ TEST_F(PartitionsRepositoryTest, StreamPartitions) {
18871887
repository.StreamPartitions(async_stream, kVersion, additional_fields,
18881888
billing_tag, context);
18891889
EXPECT_TRUE(async_stream->IsClosed());
1890-
EXPECT_FALSE(async_stream->GetError().has_value());
1890+
EXPECT_FALSE(async_stream->GetError());
18911891
EXPECT_STREQ(ref_stream_data.c_str(),
18921892
get_stream_content(*async_stream).c_str());
18931893

@@ -1902,7 +1902,7 @@ TEST_F(PartitionsRepositoryTest, StreamPartitions) {
19021902
billing_tag, context);
19031903

19041904
EXPECT_TRUE(second_stream->IsClosed());
1905-
EXPECT_FALSE(second_stream->GetError().has_value());
1905+
EXPECT_FALSE(second_stream->GetError());
19061906
EXPECT_STREQ((initial_value + ref_stream_data).c_str(),
19071907
get_stream_content(*second_stream).c_str());
19081908
}

0 commit comments

Comments
 (0)