Skip to content

Commit

Permalink
Add missing check
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-kirienko committed Feb 8, 2024
1 parent a6a2ddb commit 2afe3e3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cetlvast/suites/unittest/test_pf17_optional.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1376,8 +1376,10 @@ TEST(test_optional, make_optional_3)

TEST(test_optional, value_or)
{
const optional<std::int64_t> a = 12345;
optional<std::int64_t> a = 12345;
EXPECT_EQ(12345, a.value_or(23456));
a = nullopt;
EXPECT_EQ(23456, a.value_or(23456));
EXPECT_EQ(12345, (optional<std::int64_t>{12345}).value_or(23456));
EXPECT_EQ(23456, (optional<std::int64_t>{}).value_or(23456));
}

0 comments on commit 2afe3e3

Please sign in to comment.