| 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 <stddef.h> |
| 6 |
| 5 #include <algorithm> | 7 #include <algorithm> |
| 6 | 8 |
| 7 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 9 #include "tools/gn/unique_vector.h" | 11 #include "tools/gn/unique_vector.h" |
| 10 | 12 |
| 11 TEST(UniqueVector, PushBack) { | 13 TEST(UniqueVector, PushBack) { |
| 12 UniqueVector<int> foo; | 14 UniqueVector<int> foo; |
| 13 EXPECT_TRUE(foo.push_back(1)); | 15 EXPECT_TRUE(foo.push_back(1)); |
| 14 EXPECT_FALSE(foo.push_back(1)); | 16 EXPECT_FALSE(foo.push_back(1)); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 34 std::string a("a"); | 36 std::string a("a"); |
| 35 EXPECT_TRUE(vect.PushBackViaSwap(&a)); | 37 EXPECT_TRUE(vect.PushBackViaSwap(&a)); |
| 36 EXPECT_EQ("", a); | 38 EXPECT_EQ("", a); |
| 37 | 39 |
| 38 a = "a"; | 40 a = "a"; |
| 39 EXPECT_FALSE(vect.PushBackViaSwap(&a)); | 41 EXPECT_FALSE(vect.PushBackViaSwap(&a)); |
| 40 EXPECT_EQ("a", a); | 42 EXPECT_EQ("a", a); |
| 41 | 43 |
| 42 EXPECT_EQ(0u, vect.IndexOf("a")); | 44 EXPECT_EQ(0u, vect.IndexOf("a")); |
| 43 } | 45 } |
| OLD | NEW |