aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/ADT/PointerUnionTest.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2014-04-28 23:42:22 +0000
committerChandler Carruth <chandlerc@gmail.com>2014-04-28 23:42:22 +0000
commit275c5fc9c23e4b14d6d4b808eb92b98eec7858a9 (patch)
treeb554c4c221c216493d3c57dde9eaa6f898fe5b99 /llvm/unittests/ADT/PointerUnionTest.cpp
parent1284df1306042bb2286c49cd79fbe64ab2df6cbc (diff)
downloadllvm-275c5fc9c23e4b14d6d4b808eb92b98eec7858a9.zip
llvm-275c5fc9c23e4b14d6d4b808eb92b98eec7858a9.tar.gz
llvm-275c5fc9c23e4b14d6d4b808eb92b98eec7858a9.tar.bz2
[cleanup] Make this test use a proper fixture rather than globals.
llvm-svn: 207466
Diffstat (limited to 'llvm/unittests/ADT/PointerUnionTest.cpp')
-rw-r--r--llvm/unittests/ADT/PointerUnionTest.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/llvm/unittests/ADT/PointerUnionTest.cpp b/llvm/unittests/ADT/PointerUnionTest.cpp
index 4dfcb7e..87c6088 100644
--- a/llvm/unittests/ADT/PointerUnionTest.cpp
+++ b/llvm/unittests/ADT/PointerUnionTest.cpp
@@ -15,15 +15,14 @@ namespace {
typedef PointerUnion<int *, float *> PU;
-// Test fixture
-class PointerUnionTest : public testing::Test {};
+struct PointerUnionTest : public testing::Test {
+ float f;
+ int i;
-float f = 3.14f;
-int i = 42;
+ PU a, b, n;
-const PU a(&f);
-const PU b(&i);
-const PU n;
+ PointerUnionTest() : f(3.14f), i(42), a(&f), b(&i), n() {}
+};
TEST_F(PointerUnionTest, Comparison) {
EXPECT_TRUE(a != b);