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 | 275c5fc9c23e4b14d6d4b808eb92b98eec7858a9 (patch) | |
| tree | b554c4c221c216493d3c57dde9eaa6f898fe5b99 | |
| parent | 1284df1306042bb2286c49cd79fbe64ab2df6cbc (diff) | |
| download | bcm5719-llvm-275c5fc9c23e4b14d6d4b808eb92b98eec7858a9.tar.gz bcm5719-llvm-275c5fc9c23e4b14d6d4b808eb92b98eec7858a9.zip | |
[cleanup] Make this test use a proper fixture rather than globals.
llvm-svn: 207466
| -rw-r--r-- | llvm/unittests/ADT/PointerUnionTest.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/llvm/unittests/ADT/PointerUnionTest.cpp b/llvm/unittests/ADT/PointerUnionTest.cpp index 4dfcb7ea75d..87c60887ad3 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); |

