From 275c5fc9c23e4b14d6d4b808eb92b98eec7858a9 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Mon, 28 Apr 2014 23:42:22 +0000 Subject: [PATCH] [cleanup] Make this test use a proper fixture rather than globals. llvm-svn: 207466 --- llvm/unittests/ADT/PointerUnionTest.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/llvm/unittests/ADT/PointerUnionTest.cpp b/llvm/unittests/ADT/PointerUnionTest.cpp index 4dfcb7ea75da..87c60887ad37 100644 --- a/llvm/unittests/ADT/PointerUnionTest.cpp +++ b/llvm/unittests/ADT/PointerUnionTest.cpp @@ -15,15 +15,14 @@ namespace { typedef PointerUnion 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);