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

Side by Side Diff: tools/gn/target_unittest.cc

Issue 26537002: Add a UniqueVector class to GN (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: REview comments, remove npos Created 6 years, 4 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 unified diff | Download patch
« no previous file with comments | « tools/gn/target_generator.cc ('k') | tools/gn/unique_vector.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "testing/gtest/include/gtest/gtest.h" 5 #include "testing/gtest/include/gtest/gtest.h"
6 #include "tools/gn/build_settings.h" 6 #include "tools/gn/build_settings.h"
7 #include "tools/gn/config.h" 7 #include "tools/gn/config.h"
8 #include "tools/gn/settings.h" 8 #include "tools/gn/settings.h"
9 #include "tools/gn/target.h" 9 #include "tools/gn/target.h"
10 #include "tools/gn/toolchain.h" 10 #include "tools/gn/toolchain.h"
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 a.deps().push_back(LabelTargetPair(&b)); 214 a.deps().push_back(LabelTargetPair(&b));
215 b.deps().push_back(LabelTargetPair(&c)); 215 b.deps().push_back(LabelTargetPair(&c));
216 c.deps().push_back(LabelTargetPair(&d)); 216 c.deps().push_back(LabelTargetPair(&d));
217 217
218 d.OnResolved(); 218 d.OnResolved();
219 c.OnResolved(); 219 c.OnResolved();
220 b.OnResolved(); 220 b.OnResolved();
221 a.OnResolved(); 221 a.OnResolved();
222 222
223 // C should have D in its inherited libs. 223 // C should have D in its inherited libs.
224 const std::set<const Target*>& c_inherited = c.inherited_libraries(); 224 const UniqueVector<const Target*>& c_inherited = c.inherited_libraries();
225 EXPECT_EQ(1u, c_inherited.size()); 225 EXPECT_EQ(1u, c_inherited.size());
226 EXPECT_TRUE(c_inherited.find(&d) != c_inherited.end()); 226 EXPECT_TRUE(c_inherited.IndexOf(&d) != static_cast<size_t>(-1));
227 227
228 // B should have C and D in its inherited libs. 228 // B should have C and D in its inherited libs.
229 const std::set<const Target*>& b_inherited = b.inherited_libraries(); 229 const UniqueVector<const Target*>& b_inherited = b.inherited_libraries();
230 EXPECT_EQ(2u, b_inherited.size()); 230 EXPECT_EQ(2u, b_inherited.size());
231 EXPECT_TRUE(b_inherited.find(&c) != b_inherited.end()); 231 EXPECT_TRUE(b_inherited.IndexOf(&c) != static_cast<size_t>(-1));
232 EXPECT_TRUE(b_inherited.find(&d) != b_inherited.end()); 232 EXPECT_TRUE(b_inherited.IndexOf(&d) != static_cast<size_t>(-1));
233 233
234 // A should have B in its inherited libs, but not any others (the shared 234 // A should have B in its inherited libs, but not any others (the shared
235 // library will include the static library and source set). 235 // library will include the static library and source set).
236 const std::set<const Target*>& a_inherited = a.inherited_libraries(); 236 const UniqueVector<const Target*>& a_inherited = a.inherited_libraries();
237 EXPECT_EQ(1u, a_inherited.size()); 237 EXPECT_EQ(1u, a_inherited.size());
238 EXPECT_TRUE(a_inherited.find(&b) != a_inherited.end()); 238 EXPECT_TRUE(a_inherited.IndexOf(&b) != static_cast<size_t>(-1));
239 } 239 }
OLDNEW
« no previous file with comments | « tools/gn/target_generator.cc ('k') | tools/gn/unique_vector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698