aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/ADT/PointerUnionTest.cpp
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
commita468b8ecafe84896352ab61a049ce468ba3ef3ae (patch)
tree7e667ddd613bd587294d3972a453bb4e9dc3c37c /llvm/unittests/ADT/PointerUnionTest.cpp
parent0c790015dfd3072f664e45605dd805d4a9b481f1 (diff)
downloadllvm-a468b8ecafe84896352ab61a049ce468ba3ef3ae.zip
llvm-a468b8ecafe84896352ab61a049ce468ba3ef3ae.tar.gz
llvm-a468b8ecafe84896352ab61a049ce468ba3ef3ae.tar.bz2
[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. =] llvm-svn: 207468
Diffstat (limited to 'llvm/unittests/ADT/PointerUnionTest.cpp')
-rw-r--r--llvm/unittests/ADT/PointerUnionTest.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/unittests/ADT/PointerUnionTest.cpp b/llvm/unittests/ADT/PointerUnionTest.cpp
index 87c6088..23a8333 100644
--- a/llvm/unittests/ADT/PointerUnionTest.cpp
+++ b/llvm/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);
}