Commit c38ae7df by Jamie Madill

Rename Optional::None to Invalid.

This fixes a name conflict with the XWindow headers on Linux. Only becomes an issue when using Optional inside GL-level libANGLE. BUG=angleproject:1123 Change-Id: I7f0eb278a8b6eb6fecd864e556428678cb90dcea Reviewed-on: https://chromium-review.googlesource.com/298892Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Tested-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 1170e474
......@@ -47,10 +47,7 @@ struct Optional
mValid = false;
}
static Optional None()
{
return Optional();
}
static Optional Invalid() { return Optional(); }
bool valid() const { return mValid; }
const T &value() const { return mValue; }
......
......@@ -18,7 +18,7 @@ TEST(OptionalTest, BasicInvalid)
{
Optional<int> testInvalid;
ASSERT_FALSE(testInvalid.valid());
ASSERT_EQ(Optional<int>::None(), testInvalid);
ASSERT_EQ(Optional<int>::Invalid(), testInvalid);
}
TEST(OptionalTest, BasicValid)
......@@ -26,7 +26,7 @@ TEST(OptionalTest, BasicValid)
Optional<int> testValid(3);
ASSERT_TRUE(testValid.valid());
ASSERT_EQ(3, testValid.value());
ASSERT_NE(Optional<int>::None(), testValid);
ASSERT_NE(Optional<int>::Invalid(), testValid);
}
TEST(OptionalTest, Copies)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment