From 9f465b406222aba77d5a57f626b52be17d1749e3 Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Sun, 12 Nov 2017 17:00:35 -0600 Subject: TESTS: Remove unnecessary heap allocation --- test/common/ptr.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/common/ptr.h b/test/common/ptr.h index 0c871a761d..790d541b13 100644 --- a/test/common/ptr.h +++ b/test/common/ptr.h @@ -127,14 +127,14 @@ class PtrTestSuite : public CxxTest::TestSuite { void test_deleter() { Deleter myDeleter; - myDeleter.test = new bool(false); + bool test = false; + myDeleter.test = &test; { Common::SharedPtr p(new int(1), myDeleter); } - TS_ASSERT_EQUALS(*myDeleter.test, true); - delete myDeleter.test; + TS_ASSERT_EQUALS(test, true); } void test_compare() { -- cgit v1.2.3