OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |