From a468b8ecafe84896352ab61a049ce468ba3ef3ae Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Mon, 28 Apr 2014 23:44:14 +0000 Subject: [PATCH] [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 --- llvm/unittests/ADT/PointerUnionTest.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/llvm/unittests/ADT/PointerUnionTest.cpp b/llvm/unittests/ADT/PointerUnionTest.cpp index 87c60887ad37..23a833310d27 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); }