diff options
author | Michael Stahl <mstahl@redhat.com> | 2014-09-26 15:35:09 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-09-26 16:38:34 +0200 |
commit | ea2d767d4475ac3399fdfa59a4d0e2fbc38d1aa9 (patch) | |
tree | a0c57c0208e00a56bc498bdda7f7ae5db35ec746 /tools/qa | |
parent | 325ce86b56131f1e874e8cb2c5948fed719afe07 (diff) |
tools: change INetURLObject::getData to return std::unique_ptr
Life-cycle becomes a lot more obvious this way.
Change-Id: I1ca99607f609a2223011c40447ad1cd9ca5ccaa5
Diffstat (limited to 'tools/qa')
-rw-r--r-- | tools/qa/cppunit/test_urlobj.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tools/qa/cppunit/test_urlobj.cxx b/tools/qa/cppunit/test_urlobj.cxx index 6cfca9609bdb..df866bc85e2c 100644 --- a/tools/qa/cppunit/test_urlobj.cxx +++ b/tools/qa/cppunit/test_urlobj.cxx @@ -246,7 +246,7 @@ namespace tools_urlobj void urlobjTest_data() { INetURLObject url; - SvMemoryStream * strm; + std::unique_ptr<SvMemoryStream> strm; unsigned char const * buf; url = INetURLObject("data:"); @@ -259,7 +259,7 @@ namespace tools_urlobj strm = url.getData(); CPPUNIT_ASSERT(strm != 0); CPPUNIT_ASSERT_EQUAL(sal_uIntPtr(0), strm->GetSize()); - delete strm; + strm.reset(); url = INetURLObject("data:,,%C3%A4%90"); CPPUNIT_ASSERT(!url.HasError()); @@ -271,7 +271,7 @@ namespace tools_urlobj CPPUNIT_ASSERT_EQUAL(0xC3, int(buf[1])); CPPUNIT_ASSERT_EQUAL(0xA4, int(buf[2])); CPPUNIT_ASSERT_EQUAL(0x90, int(buf[3])); - delete strm; + strm.reset(); url = INetURLObject("data:base64,"); //TODO: CPPUNIT_ASSERT(url.HasError()); @@ -283,14 +283,14 @@ namespace tools_urlobj strm = url.getData(); CPPUNIT_ASSERT(strm != 0); CPPUNIT_ASSERT_EQUAL(sal_uIntPtr(0), strm->GetSize()); - delete strm; + strm.reset(); url = INetURLObject("data:;bAsE64,"); CPPUNIT_ASSERT(!url.HasError()); strm = url.getData(); CPPUNIT_ASSERT(strm != 0); CPPUNIT_ASSERT_EQUAL(sal_uIntPtr(0), strm->GetSize()); - delete strm; + strm.reset(); url = INetURLObject("data:;base64,YWJjCg=="); CPPUNIT_ASSERT(!url.HasError()); @@ -302,7 +302,7 @@ namespace tools_urlobj CPPUNIT_ASSERT_EQUAL(0x62, int(buf[1])); CPPUNIT_ASSERT_EQUAL(0x63, int(buf[2])); CPPUNIT_ASSERT_EQUAL(0x0A, int(buf[3])); - delete strm; + strm.reset(); url = INetURLObject("data:;base64,YWJjCg="); CPPUNIT_ASSERT(!url.HasError()); @@ -324,7 +324,7 @@ namespace tools_urlobj CPPUNIT_ASSERT_EQUAL(0x51, int(buf[1])); CPPUNIT_ASSERT_EQUAL(0x3D, int(buf[2])); CPPUNIT_ASSERT_EQUAL(0x3D, int(buf[3])); - delete strm; + strm.reset(); url = INetURLObject("http://example.com"); CPPUNIT_ASSERT(!url.HasError()); |