| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google 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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 OwnPtr<DestructCounter> ownCounter1 = map.take(1); | 128 OwnPtr<DestructCounter> ownCounter1 = map.take(1); |
| 129 EXPECT_EQ(ownCounter1.get(), counter1); | 129 EXPECT_EQ(ownCounter1.get(), counter1); |
| 130 EXPECT_FALSE(map.contains(1)); | 130 EXPECT_FALSE(map.contains(1)); |
| 131 EXPECT_EQ(0, destructNumber); | 131 EXPECT_EQ(0, destructNumber); |
| 132 | 132 |
| 133 map.remove(2); | 133 map.remove(2); |
| 134 EXPECT_FALSE(map.contains(2)); | 134 EXPECT_FALSE(map.contains(2)); |
| 135 EXPECT_EQ(0UL, map.size()); | 135 EXPECT_EQ(0UL, map.size()); |
| 136 EXPECT_EQ(1, destructNumber); | 136 EXPECT_EQ(1, destructNumber); |
| 137 | 137 |
| 138 ownCounter1.clear(); | 138 ownCounter1.reset(); |
| 139 EXPECT_EQ(2, destructNumber); | 139 EXPECT_EQ(2, destructNumber); |
| 140 } | 140 } |
| 141 | 141 |
| 142 class DummyRefCounted : public RefCounted<DummyRefCounted> { | 142 class DummyRefCounted : public RefCounted<DummyRefCounted> { |
| 143 public: | 143 public: |
| 144 DummyRefCounted(bool& isDeleted) : m_isDeleted(isDeleted) { m_isDeleted = fa
lse; } | 144 DummyRefCounted(bool& isDeleted) : m_isDeleted(isDeleted) { m_isDeleted = fa
lse; } |
| 145 ~DummyRefCounted() | 145 ~DummyRefCounted() |
| 146 { | 146 { |
| 147 ASSERT(!m_isDeleted); | 147 ASSERT(!m_isDeleted); |
| 148 m_isDeleted = true; | 148 m_isDeleted = true; |
| (...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 604 Map::AddResult addResult = map.add(1, std::move(one)); | 604 Map::AddResult addResult = map.add(1, std::move(one)); |
| 605 EXPECT_TRUE(addResult.isNewEntry); | 605 EXPECT_TRUE(addResult.isNewEntry); |
| 606 EXPECT_EQ(1, addResult.storedValue->key); | 606 EXPECT_EQ(1, addResult.storedValue->key); |
| 607 EXPECT_EQ(1, *addResult.storedValue->value); | 607 EXPECT_EQ(1, *addResult.storedValue->value); |
| 608 } | 608 } |
| 609 } | 609 } |
| 610 | 610 |
| 611 } // anonymous namespace | 611 } // anonymous namespace |
| 612 | 612 |
| 613 } // namespace WTF | 613 } // namespace WTF |
| OLD | NEW |