19 #include "gtest/gtest.h" 25 TEST(OptionalTest, CreateDisengagedObject) {
26 const optional<int> o;
27 EXPECT_FALSE(o.has_value());
28 const optional<float> x;
29 EXPECT_FALSE(x.has_value());
32 TEST(OptionalTest, CreateWithValue) {
33 const optional<int> a(5);
34 EXPECT_TRUE(a.has_value());
35 EXPECT_EQ(5, a.value());
38 TEST(OptionalTest, CreateFromOtherOptional) {
39 const optional<int> a(5);
40 const optional<int> b = a;
41 EXPECT_TRUE(a.has_value());
42 EXPECT_TRUE(b.has_value());
43 EXPECT_EQ(5, a.value());
44 EXPECT_EQ(5, b.value());
47 TEST(OptionalTest, AssignmentOperator) {
52 EXPECT_TRUE(a.has_value());
53 EXPECT_EQ(4, a.value());
55 EXPECT_FALSE(a.has_value());
57 EXPECT_TRUE(a.has_value());
58 EXPECT_EQ(3, a.value());
TEST(TrajectoryConnectivityStateTest, UnknownTrajectory)