diff options
author | evanm@google.com <evanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-29 20:32:31 +0000 |
---|---|---|
committer | evanm@google.com <evanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-29 20:32:31 +0000 |
commit | fcbaeacfce08303236709e2603e64fc40bdba435 (patch) | |
tree | 115a3402a9e71344d4e68e47705c2c09e1520f08 /chrome/browser/greasemonkey_master_unittest.cc | |
parent | 250c6a4df01732194e05559918174bcf5fb05f42 (diff) | |
download | chromium_src-fcbaeacfce08303236709e2603e64fc40bdba435.zip chromium_src-fcbaeacfce08303236709e2603e64fc40bdba435.tar.gz chromium_src-fcbaeacfce08303236709e2603e64fc40bdba435.tar.bz2 |
Free memory in unit test, so purify doesn't complain.
Review URL: http://codereview.chromium.org/8405
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4163 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/greasemonkey_master_unittest.cc')
-rw-r--r-- | chrome/browser/greasemonkey_master_unittest.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/chrome/browser/greasemonkey_master_unittest.cc b/chrome/browser/greasemonkey_master_unittest.cc index b3ce12f..0987a6b 100644 --- a/chrome/browser/greasemonkey_master_unittest.cc +++ b/chrome/browser/greasemonkey_master_unittest.cc @@ -53,7 +53,7 @@ class GreasemonkeyMasterTest : public testing::Test, const NotificationDetails& details) { DCHECK(type == NOTIFY_NEW_USER_SCRIPTS); - shared_memory_ = Details<SharedMemory>(details).ptr(); + shared_memory_.reset(Details<SharedMemory>(details).ptr()); if (MessageLoop::current() == &message_loop_) MessageLoop::current()->Quit(); } @@ -65,13 +65,13 @@ class GreasemonkeyMasterTest : public testing::Test, FilePath script_dir_; // Updated to the script shared memory when we get notified. - SharedMemory* shared_memory_; + scoped_ptr<SharedMemory> shared_memory_; }; // Test that we *don't* get spurious notifications. TEST_F(GreasemonkeyMasterTest, NoScripts) { // Set shared_memory_ to something non-NULL, so we can check it became NULL. - shared_memory_ = reinterpret_cast<SharedMemory*>(1); + shared_memory_.reset(reinterpret_cast<SharedMemory*>(1)); scoped_refptr<GreasemonkeyMaster> master( new GreasemonkeyMaster(MessageLoop::current(), script_dir_)); @@ -80,7 +80,7 @@ TEST_F(GreasemonkeyMasterTest, NoScripts) { // There were no scripts in the script dir, so we shouldn't have gotten // a notification. - ASSERT_EQ(NULL, shared_memory_); + ASSERT_EQ(NULL, shared_memory_.get()); } // Test that we get notified about new scripts after they're added. |