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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gn/target_generator.cc ('k') | tools/gn/unique_vector.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/target_unittest.cc
diff --git a/tools/gn/target_unittest.cc b/tools/gn/target_unittest.cc
index f9a1f972a43c36ed9af20a51159b8b39b7bb6f66..9dcaf08e468ba3fa7db2f0f9a4c3b666b5982806 100644
--- a/tools/gn/target_unittest.cc
+++ b/tools/gn/target_unittest.cc
@@ -221,19 +221,19 @@ TEST_F(TargetTest, InheritLibs) {
a.OnResolved();
// C should have D in its inherited libs.
- const std::set<const Target*>& c_inherited = c.inherited_libraries();
+ const UniqueVector<const Target*>& c_inherited = c.inherited_libraries();
EXPECT_EQ(1u, c_inherited.size());
- EXPECT_TRUE(c_inherited.find(&d) != c_inherited.end());
+ EXPECT_TRUE(c_inherited.IndexOf(&d) != static_cast<size_t>(-1));
// B should have C and D in its inherited libs.
- const std::set<const Target*>& b_inherited = b.inherited_libraries();
+ const UniqueVector<const Target*>& b_inherited = b.inherited_libraries();
EXPECT_EQ(2u, b_inherited.size());
- EXPECT_TRUE(b_inherited.find(&c) != b_inherited.end());
- EXPECT_TRUE(b_inherited.find(&d) != b_inherited.end());
+ EXPECT_TRUE(b_inherited.IndexOf(&c) != static_cast<size_t>(-1));
+ EXPECT_TRUE(b_inherited.IndexOf(&d) != static_cast<size_t>(-1));
// A should have B in its inherited libs, but not any others (the shared
// library will include the static library and source set).
- const std::set<const Target*>& a_inherited = a.inherited_libraries();
+ const UniqueVector<const Target*>& a_inherited = a.inherited_libraries();
EXPECT_EQ(1u, a_inherited.size());
- EXPECT_TRUE(a_inherited.find(&b) != a_inherited.end());
+ EXPECT_TRUE(a_inherited.IndexOf(&b) != static_cast<size_t>(-1));
}
« 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