| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 } | 193 } |
| 194 EXPECT_EQ(0, destructNumber); | 194 EXPECT_EQ(0, destructNumber); |
| 195 | 195 |
| 196 EXPECT_EQ(0, vector[0]->get()); | 196 EXPECT_EQ(0, vector[0]->get()); |
| 197 EXPECT_EQ(1, vector[1]->get()); | 197 EXPECT_EQ(1, vector[1]->get()); |
| 198 vector.remove(0); | 198 vector.remove(0); |
| 199 EXPECT_EQ(1, vector[0]->get()); | 199 EXPECT_EQ(1, vector[0]->get()); |
| 200 EXPECT_EQ(1u, vector.size()); | 200 EXPECT_EQ(1u, vector.size()); |
| 201 EXPECT_EQ(1, destructNumber); | 201 EXPECT_EQ(1, destructNumber); |
| 202 | 202 |
| 203 OwnPtr<DestructCounter> ownCounter1 = vector[0].release(); | 203 OwnPtr<DestructCounter> ownCounter1 = std::move(vector[0]); |
| 204 vector.remove(0); | 204 vector.remove(0); |
| 205 ASSERT_EQ(counter1, ownCounter1->get()); | 205 ASSERT_EQ(counter1, ownCounter1->get()); |
| 206 ASSERT_EQ(0u, vector.size()); | 206 ASSERT_EQ(0u, vector.size()); |
| 207 ASSERT_EQ(1, destructNumber); | 207 ASSERT_EQ(1, destructNumber); |
| 208 | 208 |
| 209 ownCounter1.clear(); | 209 ownCounter1.clear(); |
| 210 EXPECT_EQ(2, destructNumber); | 210 EXPECT_EQ(2, destructNumber); |
| 211 | 211 |
| 212 size_t count = 1025; | 212 size_t count = 1025; |
| 213 destructNumber = 0; | 213 destructNumber = 0; |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 611 EXPECT_TRUE(!vector[3]); | 611 EXPECT_TRUE(!vector[3]); |
| 612 vector.remove(3); | 612 vector.remove(3); |
| 613 vector[0] = Pointer(new int(-1)); | 613 vector[0] = Pointer(new int(-1)); |
| 614 ASSERT_EQ(3u, vector.size()); | 614 ASSERT_EQ(3u, vector.size()); |
| 615 EXPECT_EQ(-1, *vector[0]); | 615 EXPECT_EQ(-1, *vector[0]); |
| 616 } | 616 } |
| 617 | 617 |
| 618 } // anonymous namespace | 618 } // anonymous namespace |
| 619 | 619 |
| 620 } // namespace WTF | 620 } // namespace WTF |
| OLD | NEW |