Add a unit test for the copy constructor.

I would not normally add tests like these, but the copy constructor is not
used at all in our codebase with c++11, so having this tests might prevent
breaking the c++03 build again.

llvm-svn: 198886
This commit is contained in:
Rafael Espindola 2014-01-09 19:47:39 +00:00
parent 96af9886ef
commit cd56deb6bf

View File

@ -23,6 +23,9 @@ TEST(ErrorOr, SimpleValue) {
EXPECT_TRUE(a);
EXPECT_EQ(1, *a);
ErrorOr<int> b = a;
EXPECT_EQ(1, *b);
a = t2();
EXPECT_FALSE(a);
EXPECT_EQ(errc::invalid_argument, a.getError());