diff options
author | Chase Douglas <chase.douglas@ubuntu.com> | 2011-12-08 14:20:53 -0800 |
---|---|---|
committer | Chase Douglas <chase.douglas@ubuntu.com> | 2011-12-08 14:20:53 -0800 |
commit | 3eda6c1380ab4bdfaf891d6d20097dc83dac8e65 (patch) | |
tree | cd55651027fc1b040885f56ebba3999c5603c9ba | |
parent | 826c9bbf23fd5650cd2ca0e3314e4e8559b1061e (diff) |
Use std::auto_ptr for Test pimpl too
-rw-r--r-- | include/xorg/gtest/test.h | 5 | ||||
-rw-r--r-- | src/test.cpp | 4 |
2 files changed, 3 insertions, 6 deletions
diff --git a/include/xorg/gtest/test.h b/include/xorg/gtest/test.h index 0890cbf..e27a947 100644 --- a/include/xorg/gtest/test.h +++ b/include/xorg/gtest/test.h @@ -22,6 +22,8 @@ #ifndef XORG_GTEST_TEST_H_ #define XORG_GTEST_TEST_H_ +#include <memory> + #include <gtest/gtest.h> #include <X11/Xlib.h> @@ -33,7 +35,6 @@ namespace testing { class Test : public ::testing::Test { public: Test(); - virtual ~Test(); virtual void SetUp(); virtual void TearDown(); @@ -42,7 +43,7 @@ class Test : public ::testing::Test { ::Display* Display() const; struct Private; - Private* d_; + std::auto_ptr<Private> d_; private: /* Disable copy c'tor, assignment operator */ diff --git a/src/test.cpp b/src/test.cpp index 0ae31cf..565c321 100644 --- a/src/test.cpp +++ b/src/test.cpp @@ -44,7 +44,3 @@ void xorg::testing::Test::TearDown() { ::Display* xorg::testing::Test::Display() const { return d_->display; } - -xorg::testing::Test::~Test() { - delete d_; -} |