diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2014-04-28 23:42:22 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2014-04-28 23:42:22 +0000 |
commit | e3976b241c65aa4a1643c479dfe6b188a09564a2 (patch) | |
tree | 152d5cd5c1c1b10ac8fa3a4a99afc77be2addc2b /unittests | |
parent | e753df356653f746d11d05754f2481b7dcb8814a (diff) | |
download | llvm-e3976b241c65aa4a1643c479dfe6b188a09564a2.tar.gz llvm-e3976b241c65aa4a1643c479dfe6b188a09564a2.tar.bz2 llvm-e3976b241c65aa4a1643c479dfe6b188a09564a2.tar.xz |
[cleanup] Make this test use a proper fixture rather than globals.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207466 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r-- | unittests/ADT/PointerUnionTest.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/unittests/ADT/PointerUnionTest.cpp b/unittests/ADT/PointerUnionTest.cpp index 4dfcb7ea75..87c60887ad 100644 --- a/unittests/ADT/PointerUnionTest.cpp +++ b/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); |