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

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

Issue 1869503004: Convert //tools to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase, change iwyu fixes for converted directories to include <memory> Created 4 years, 8 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
« no previous file with comments | « tools/json_schema_compiler/h_generator.py ('k') | tools/json_schema_compiler/test/any_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/json_schema_compiler/test/additional_properties_unittest.cc
diff --git a/tools/json_schema_compiler/test/additional_properties_unittest.cc b/tools/json_schema_compiler/test/additional_properties_unittest.cc
index dc980af1c0de1c1b03e4370d5c9424c48dc4d867..67efea849bfeed031c4f9ef38225716557dd19bb 100644
--- a/tools/json_schema_compiler/test/additional_properties_unittest.cc
+++ b/tools/json_schema_compiler/test/additional_properties_unittest.cc
@@ -2,42 +2,49 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "testing/gtest/include/gtest/gtest.h"
#include "tools/json_schema_compiler/test/additional_properties.h"
+#include <memory>
+
+#include "testing/gtest/include/gtest/gtest.h"
+
using namespace test::api::additional_properties;
TEST(JsonSchemaCompilerAdditionalPropertiesTest,
AdditionalPropertiesTypePopulate) {
{
- scoped_ptr<base::ListValue> list_value(new base::ListValue());
+ std::unique_ptr<base::ListValue> list_value(new base::ListValue());
list_value->Append(new base::StringValue("asdf"));
list_value->Append(new base::FundamentalValue(4));
- scoped_ptr<base::DictionaryValue> type_value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> type_value(
+ new base::DictionaryValue());
type_value->SetString("string", "value");
type_value->SetInteger("other", 9);
type_value->Set("another", list_value.release());
- scoped_ptr<AdditionalPropertiesType> type(new AdditionalPropertiesType());
+ std::unique_ptr<AdditionalPropertiesType> type(
+ new AdditionalPropertiesType());
ASSERT_TRUE(AdditionalPropertiesType::Populate(*type_value, type.get()));
EXPECT_TRUE(type->additional_properties.Equals(type_value.get()));
}
{
- scoped_ptr<base::DictionaryValue> type_value(new base::DictionaryValue());
+ std::unique_ptr<base::DictionaryValue> type_value(
+ new base::DictionaryValue());
type_value->SetInteger("string", 3);
- scoped_ptr<AdditionalPropertiesType> type(new AdditionalPropertiesType());
+ std::unique_ptr<AdditionalPropertiesType> type(
+ new AdditionalPropertiesType());
EXPECT_FALSE(AdditionalPropertiesType::Populate(*type_value, type.get()));
}
}
TEST(JsonSchemaCompilerAdditionalPropertiesTest,
AdditionalPropertiesParamsCreate) {
- scoped_ptr<base::DictionaryValue> param_object_value(
+ std::unique_ptr<base::DictionaryValue> param_object_value(
new base::DictionaryValue());
param_object_value->SetString("str", "a");
param_object_value->SetInteger("num", 1);
- scoped_ptr<base::ListValue> params_value(new base::ListValue());
+ std::unique_ptr<base::ListValue> params_value(new base::ListValue());
params_value->Append(param_object_value->DeepCopy());
- scoped_ptr<AdditionalProperties::Params> params(
+ std::unique_ptr<AdditionalProperties::Params> params(
AdditionalProperties::Params::Create(*params_value));
EXPECT_TRUE(params.get());
EXPECT_TRUE(params->param_object.additional_properties.Equals(
« no previous file with comments | « tools/json_schema_compiler/h_generator.py ('k') | tools/json_schema_compiler/test/any_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698