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

Unified Diff: tools/gn/function_get_target_outputs_unittest.cc

Issue 2972113002: Remove ScopedVector from tools/gn/. (Closed)
Patch Set: Created 3 years, 5 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/function_get_target_outputs.cc ('k') | tools/gn/function_toolchain.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/function_get_target_outputs_unittest.cc
diff --git a/tools/gn/function_get_target_outputs_unittest.cc b/tools/gn/function_get_target_outputs_unittest.cc
index 3bff2386c4d17c1705c246ee9efdc0f23532191f..2f746a70fa7bea3a61eee3bea62d67008c350458 100644
--- a/tools/gn/function_get_target_outputs_unittest.cc
+++ b/tools/gn/function_get_target_outputs_unittest.cc
@@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <utility>
+
+#include "base/memory/ptr_util.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "tools/gn/functions.h"
#include "tools/gn/target.h"
@@ -57,13 +60,14 @@ class GetTargetOutputsTest : public testing::Test {
} // namespace
TEST_F(GetTargetOutputsTest, Copy) {
- Target* action = new Target(setup_.settings(), GetLabel("//foo/", "bar"), {});
+ auto action = base::MakeUnique<Target>(
+ setup_.settings(), GetLabel("//foo/", "bar"), InputFileSet{});
action->set_output_type(Target::COPY_FILES);
action->sources().push_back(SourceFile("//file.txt"));
action->action_values().outputs() =
SubstitutionList::MakeForTest("//out/Debug/{{source_file_part}}.one");
- items_.push_back(action);
+ items_.push_back(std::move(action));
Err err;
Value result = GetTargetOutputs("//foo:bar", &err);
@@ -72,13 +76,14 @@ TEST_F(GetTargetOutputsTest, Copy) {
}
TEST_F(GetTargetOutputsTest, Action) {
- Target* action = new Target(setup_.settings(), GetLabel("//foo/", "bar"), {});
+ auto action = base::MakeUnique<Target>(
+ setup_.settings(), GetLabel("//foo/", "bar"), InputFileSet{});
action->set_output_type(Target::ACTION);
action->action_values().outputs() = SubstitutionList::MakeForTest(
"//output1.txt",
"//output2.txt");
- items_.push_back(action);
+ items_.push_back(std::move(action));
Err err;
Value result = GetTargetOutputs("//foo:bar", &err);
@@ -87,14 +92,15 @@ TEST_F(GetTargetOutputsTest, Action) {
}
TEST_F(GetTargetOutputsTest, ActionForeach) {
- Target* action = new Target(setup_.settings(), GetLabel("//foo/", "bar"), {});
+ auto action = base::MakeUnique<Target>(
+ setup_.settings(), GetLabel("//foo/", "bar"), InputFileSet{});
action->set_output_type(Target::ACTION_FOREACH);
action->sources().push_back(SourceFile("//file.txt"));
action->action_values().outputs() = SubstitutionList::MakeForTest(
"//out/Debug/{{source_file_part}}.one",
"//out/Debug/{{source_file_part}}.two");
- items_.push_back(action);
+ items_.push_back(std::move(action));
Err err;
Value result = GetTargetOutputs("//foo:bar", &err);
« no previous file with comments | « tools/gn/function_get_target_outputs.cc ('k') | tools/gn/function_toolchain.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698