Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(95)

Unified Diff: tools/json_schema_compiler/test/objects_unittest.cc

Issue 2051663003: base::ListValue::Append cleanup: pass unique_ptr instead of the released pointer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/json_schema_compiler/test/objects_unittest.cc
diff --git a/tools/json_schema_compiler/test/objects_unittest.cc b/tools/json_schema_compiler/test/objects_unittest.cc
index 14b63464dcfcd7644d72d4340cdfadbd8cdc1539..e4f82bcb1bb0224063643dba9e9244965af7a0af 100644
--- a/tools/json_schema_compiler/test/objects_unittest.cc
+++ b/tools/json_schema_compiler/test/objects_unittest.cc
@@ -2,11 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "tools/json_schema_compiler/test/objects.h"
+
#include <stddef.h>
+#include <utility>
+
#include "base/json/json_writer.h"
#include "testing/gtest/include/gtest/gtest.h"
-#include "tools/json_schema_compiler/test/objects.h"
#include "tools/json_schema_compiler/test/objects_movable.h"
#include "tools/json_schema_compiler/test/objects_movable_json.h"
@@ -26,7 +29,7 @@ TEST(JsonSchemaCompilerObjectsTest, ObjectParamParamsCreate) {
info_value->Set("boolean", new base::FundamentalValue(true));
std::unique_ptr<base::ListValue> params_value(new base::ListValue());
- params_value->Append(info_value.release());
+ params_value->Append(std::move(info_value));
std::unique_ptr<ObjectParam::Params> params(
ObjectParam::Params::Create(*params_value));
EXPECT_TRUE(params.get());
@@ -46,7 +49,7 @@ TEST(JsonSchemaCompilerObjectsTest, ObjectParamParamsCreate) {
info_value->Set("integer", new base::FundamentalValue(5));
std::unique_ptr<base::ListValue> params_value(new base::ListValue());
- params_value->Append(info_value.release());
+ params_value->Append(std::move(info_value));
std::unique_ptr<ObjectParam::Params> params(
ObjectParam::Params::Create(*params_value));
EXPECT_FALSE(params.get());

Powered by Google App Engine
This is Rietveld 408576698