diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-06-22 14:47:27 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-06-22 15:49:04 +0200 |
commit | 921ee37ea3b648e210ecaff21074456c09b91882 (patch) | |
tree | 0874fdb3851845a14107a9fe80839e0fd7cfa70a /tools | |
parent | 65b5a9848bd01cabbbee8f6e751679a04c1da10f (diff) |
Consolidate unique_ptr deleters calling free
Change-Id: I57a977dbb521270a466d464df8c31c364179ec20
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96854
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qa/cppunit/test_json_writer.cxx | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/tools/qa/cppunit/test_json_writer.cxx b/tools/qa/cppunit/test_json_writer.cxx index 6a2cc7813574..6d473e605497 100644 --- a/tools/qa/cppunit/test_json_writer.cxx +++ b/tools/qa/cppunit/test_json_writer.cxx @@ -12,6 +12,7 @@ #include <cstdlib> #include <cppunit/extensions/HelperMacros.h> +#include <o3tl/deleter.hxx> #include <test/bootstrapfixture.hxx> #include <rtl/ustring.hxx> #include <tools/stream.hxx> @@ -38,11 +39,6 @@ public: CPPUNIT_TEST_SUITE_END(); }; -struct Free -{ - void operator()(void* p) const { std::free(p); } -}; - void JsonWriterTest::test1() { tools::JsonWriter aJson; @@ -55,7 +51,7 @@ void JsonWriterTest::test1() aJson.put("int", 12); } - std::unique_ptr<char, Free> result(aJson.extractData()); + std::unique_ptr<char, o3tl::free_delete> result(aJson.extractData()); CPPUNIT_ASSERT_EQUAL(std::string("{ \"node\": { \"oustring\": \"val1\", \"ostring\": \"val2\", " "\"charptr\": \"val3\", \"int\": 12}}"), @@ -81,7 +77,7 @@ void JsonWriterTest::test2() } } - std::unique_ptr<char, Free> result(aJson.extractData()); + std::unique_ptr<char, o3tl::free_delete> result(aJson.extractData()); CPPUNIT_ASSERT_EQUAL(std::string("{ \"node\": { \"field1\": \"val1\", \"field2\": \"val2\", " "\"node\": { \"field3\": \"val3\", \"node\": { \"field4\": " |