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

Unified Diff: tools/json_schema_compiler/test/choices_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/choices_unittest.cc
diff --git a/tools/json_schema_compiler/test/choices_unittest.cc b/tools/json_schema_compiler/test/choices_unittest.cc
index e96268d54f60f50e53ad9f5fd32eae96ec22a14c..f42fc01e4ddadc16eb957da8e3f0fef88bddd6dd 100644
--- a/tools/json_schema_compiler/test/choices_unittest.cc
+++ b/tools/json_schema_compiler/test/choices_unittest.cc
@@ -6,6 +6,8 @@
#include <stddef.h>
+#include <utility>
+
#include "base/strings/string_piece.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "tools/json_schema_compiler/test/test_util.h"
@@ -77,7 +79,7 @@ TEST(JsonSchemaCompilerChoicesTest, ObjectWithChoicesParamsCreateFail) {
object_param->SetWithoutPathExpansion("strings",
new base::FundamentalValue(5));
std::unique_ptr<base::ListValue> params_value(new base::ListValue());
- params_value->Append(object_param.release());
+ params_value->Append(std::move(object_param));
std::unique_ptr<ObjectWithChoices::Params> params(
ObjectWithChoices::Params::Create(*params_value));
EXPECT_FALSE(params.get());
@@ -90,7 +92,7 @@ TEST(JsonSchemaCompilerChoicesTest, ObjectWithChoicesParamsCreateFail) {
object_param->SetWithoutPathExpansion("integers",
new base::StringValue("asdf"));
std::unique_ptr<base::ListValue> params_value(new base::ListValue());
- params_value->Append(object_param.release());
+ params_value->Append(std::move(object_param));
std::unique_ptr<ObjectWithChoices::Params> params(
ObjectWithChoices::Params::Create(*params_value));
EXPECT_FALSE(params.get());
@@ -101,7 +103,7 @@ TEST(JsonSchemaCompilerChoicesTest, ObjectWithChoicesParamsCreateFail) {
object_param->SetWithoutPathExpansion("integers",
new base::FundamentalValue(6));
std::unique_ptr<base::ListValue> params_value(new base::ListValue());
- params_value->Append(object_param.release());
+ params_value->Append(std::move(object_param));
std::unique_ptr<ObjectWithChoices::Params> params(
ObjectWithChoices::Params::Create(*params_value));
EXPECT_FALSE(params.get());

Powered by Google App Engine
This is Rietveld 408576698