[llvm] r198886 - Add a unit test for the copy constructor.
Rafael Espindola
rafael.espindola at gmail.com
Thu Jan 9 11:47:39 PST 2014
Author: rafael
Date: Thu Jan 9 13:47:39 2014
New Revision: 198886
URL: http://llvm.org/viewvc/llvm-project?rev=198886&view=rev
Log:
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.
Modified:
llvm/trunk/unittests/Support/ErrorOrTest.cpp
Modified: llvm/trunk/unittests/Support/ErrorOrTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Support/ErrorOrTest.cpp?rev=198886&r1=198885&r2=198886&view=diff
==============================================================================
--- llvm/trunk/unittests/Support/ErrorOrTest.cpp (original)
+++ llvm/trunk/unittests/Support/ErrorOrTest.cpp Thu Jan 9 13:47:39 2014
@@ -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());
More information about the llvm-commits
mailing list