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

Unified Diff: tools/gn/builder_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/gn/builder_record.h ('k') | tools/gn/command_format.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/builder_unittest.cc
diff --git a/tools/gn/builder_unittest.cc b/tools/gn/builder_unittest.cc
index 5129063d2ec3bdf321c53d9c48e3ae9012e3ae92..96fad7d268be2c5e8a8016a00bdadd0cbd8c1c48 100644
--- a/tools/gn/builder_unittest.cc
+++ b/tools/gn/builder_unittest.cc
@@ -78,7 +78,7 @@ class BuilderTest : public testing::Test {
Toolchain* DefineToolchain() {
Toolchain* tc = new Toolchain(&settings_, settings_.toolchain_label());
TestWithScope::SetupToolchain(tc);
- builder_->ItemDefined(scoped_ptr<Item>(tc));
+ builder_->ItemDefined(std::unique_ptr<Item>(tc));
return tc;
}
@@ -107,7 +107,7 @@ TEST_F(BuilderTest, BasicDeps) {
Target* a = new Target(&settings_, a_label);
a->public_deps().push_back(LabelTargetPair(b_label));
a->set_output_type(Target::EXECUTABLE);
- builder_->ItemDefined(scoped_ptr<Item>(a));
+ builder_->ItemDefined(std::unique_ptr<Item>(a));
// Should have requested that B and the toolchain is loaded.
EXPECT_TRUE(loader_->HasLoadedTwo(SourceFile("//tc/BUILD.gn"),
@@ -152,7 +152,7 @@ TEST_F(BuilderTest, BasicDeps) {
Target* c = new Target(&settings_, c_label);
c->set_output_type(Target::STATIC_LIBRARY);
c->visibility().SetPublic();
- builder_->ItemDefined(scoped_ptr<Item>(c));
+ builder_->ItemDefined(std::unique_ptr<Item>(c));
// C only depends on the already-loaded toolchain so we shouldn't have
// requested anything else.
@@ -163,7 +163,7 @@ TEST_F(BuilderTest, BasicDeps) {
a->public_deps().push_back(LabelTargetPair(c_label));
b->set_output_type(Target::SHARED_LIBRARY);
b->visibility().SetPublic();
- builder_->ItemDefined(scoped_ptr<Item>(b));
+ builder_->ItemDefined(std::unique_ptr<Item>(b));
// B depends only on the already-loaded C and toolchain so we shouldn't have
// requested anything else.
@@ -194,7 +194,7 @@ TEST_F(BuilderTest, ShouldGenerate) {
settings2.set_toolchain_label(toolchain_label2);
Toolchain* tc2 = new Toolchain(&settings2, toolchain_label2);
TestWithScope::SetupToolchain(tc2);
- builder_->ItemDefined(scoped_ptr<Item>(tc2));
+ builder_->ItemDefined(std::unique_ptr<Item>(tc2));
// Construct a dependency chain: A -> B. A is in the default toolchain, B
// is not.
@@ -207,7 +207,7 @@ TEST_F(BuilderTest, ShouldGenerate) {
Target* b = new Target(&settings2, b_label);
b->visibility().SetPublic();
b->set_output_type(Target::EXECUTABLE);
- builder_->ItemDefined(scoped_ptr<Item>(b));
+ builder_->ItemDefined(std::unique_ptr<Item>(b));
// B should not be marked generated by default.
BuilderRecord* b_record = builder_->GetRecord(b_label);
@@ -217,7 +217,7 @@ TEST_F(BuilderTest, ShouldGenerate) {
Target* a = new Target(&settings_, a_label);
a->public_deps().push_back(LabelTargetPair(b_label));
a->set_output_type(Target::EXECUTABLE);
- builder_->ItemDefined(scoped_ptr<Item>(a));
+ builder_->ItemDefined(std::unique_ptr<Item>(a));
// A should have the generate bit set since it's in the default toolchain.
BuilderRecord* a_record = builder_->GetRecord(a_label);
@@ -242,7 +242,7 @@ TEST_F(BuilderTest, ConfigLoad) {
// The builder will take ownership of the pointers.
Config* a = new Config(&settings_, a_label);
a->configs().push_back(LabelConfigPair(b_label));
- builder_->ItemDefined(scoped_ptr<Item>(a));
+ builder_->ItemDefined(std::unique_ptr<Item>(a));
// Should have requested that B is loaded.
EXPECT_TRUE(loader_->HasLoadedOne(SourceFile("//b/BUILD.gn")));
« no previous file with comments | « tools/gn/builder_record.h ('k') | tools/gn/command_format.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698