summaryrefslogtreecommitdiff
path: root/unittests
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2014-04-28 23:44:14 +0000
committerChandler Carruth <chandlerc@gmail.com>2014-04-28 23:44:14 +0000
commitb86c32fe3859989447d1b31fbf74b216d32c0405 (patch)
treec26563e106d1c91062934160d64e01d0b8cf6cc9 /unittests
parente3976b241c65aa4a1643c479dfe6b188a09564a2 (diff)
downloadllvm-b86c32fe3859989447d1b31fbf74b216d32c0405.tar.gz
llvm-b86c32fe3859989447d1b31fbf74b216d32c0405.tar.bz2
llvm-b86c32fe3859989447d1b31fbf74b216d32c0405.tar.xz
[cleanup] Add some actual positive tests for equality. This unittest
never actually compared for equality two pointer unions that were equal. Fortunately, things seem to work. =] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207468 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r--unittests/ADT/PointerUnionTest.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/unittests/ADT/PointerUnionTest.cpp b/unittests/ADT/PointerUnionTest.cpp
index 87c60887ad..23a833310d 100644
--- a/unittests/ADT/PointerUnionTest.cpp
+++ b/unittests/ADT/PointerUnionTest.cpp
@@ -19,14 +19,18 @@ struct PointerUnionTest : public testing::Test {
float f;
int i;
- PU a, b, n;
+ PU a, b, c, n;
- PointerUnionTest() : f(3.14f), i(42), a(&f), b(&i), n() {}
+ PointerUnionTest() : f(3.14f), i(42), a(&f), b(&i), c(&i), n() {}
};
TEST_F(PointerUnionTest, Comparison) {
+ EXPECT_TRUE(a == a);
+ EXPECT_FALSE(a != a);
EXPECT_TRUE(a != b);
EXPECT_FALSE(a == b);
+ EXPECT_TRUE(b == c);
+ EXPECT_FALSE(b != c);
EXPECT_TRUE(b != n);
EXPECT_FALSE(b == n);
}