Changeset 207237 in webkit
- Timestamp:
- Oct 12, 2016 1:38:37 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r207225 r207237 1 2016-10-12 Ryan Haddad <ryanhaddad@apple.com> 2 3 Unreviewed, rolling out r207225. 4 5 This change causes debug tests to exit early with crashes. 6 7 Reverted changeset: 8 9 "Optional's move-constructor and move-assignment operator 10 don't disengage the value being moved from" 11 https://bugs.webkit.org/show_bug.cgi?id=163309 12 http://trac.webkit.org/changeset/207225 13 1 14 2016-10-11 Sam Weinig <sam@webkit.org> 2 15 -
trunk/Source/WTF/wtf/Optional.h
r207225 r207237 72 72 : m_isEngaged(other.m_isEngaged) 73 73 { 74 if (m_isEngaged) {74 if (m_isEngaged) 75 75 new (NotNull, &m_value) T(WTFMove(*other.asPtr())); 76 other.m_isEngaged = false;77 }78 76 } 79 77 … … 124 122 new (NotNull, &m_value) T(WTFMove(*other.asPtr())); 125 123 m_isEngaged = true; 126 other.m_isEngaged = false;127 124 } 128 125 return *this; -
trunk/Tools/ChangeLog
r207236 r207237 1 2016-10-12 Ryan Haddad <ryanhaddad@apple.com> 2 3 Unreviewed, rolling out r207225. 4 5 This change causes debug tests to exit early with crashes. 6 7 Reverted changeset: 8 9 "Optional's move-constructor and move-assignment operator 10 don't disengage the value being moved from" 11 https://bugs.webkit.org/show_bug.cgi?id=163309 12 http://trac.webkit.org/changeset/207225 13 1 14 2016-10-12 Alex Christensen <achristensen@webkit.org> 2 15 -
trunk/Tools/TestWebKitAPI/Tests/WTF/Optional.cpp
r207225 r207237 26 26 #include "config.h" 27 27 28 #include "Counters.h"29 28 #include <wtf/Optional.h> 30 29 … … 148 147 } 149 148 150 TEST(WTF_Optional, MoveConstructor)151 {152 {153 CopyMoveCounter::TestingScope scope;154 155 Optional<CopyMoveCounter> optional(InPlace);156 157 EXPECT_EQ(1U, CopyMoveCounter::constructionCount);158 EXPECT_EQ(0U, CopyMoveCounter::copyCount);159 EXPECT_EQ(0U, CopyMoveCounter::moveCount);160 161 EXPECT_TRUE(static_cast<bool>(optional));162 163 Optional<CopyMoveCounter> movedTo(WTFMove(optional));164 165 EXPECT_EQ(1U, CopyMoveCounter::constructionCount);166 EXPECT_EQ(0U, CopyMoveCounter::copyCount);167 EXPECT_EQ(1U, CopyMoveCounter::moveCount);168 169 EXPECT_FALSE(static_cast<bool>(optional));170 EXPECT_TRUE(static_cast<bool>(movedTo));171 }172 }173 174 TEST(WTF_Optional, MoveAssignment)175 {176 {177 CopyMoveCounter::TestingScope scope;178 179 Optional<CopyMoveCounter> optional(InPlace);180 181 EXPECT_EQ(1U, CopyMoveCounter::constructionCount);182 EXPECT_EQ(0U, CopyMoveCounter::copyCount);183 EXPECT_EQ(0U, CopyMoveCounter::moveCount);184 185 EXPECT_TRUE(static_cast<bool>(optional));186 187 Optional<CopyMoveCounter> movedTo = WTFMove(optional);188 189 EXPECT_EQ(1U, CopyMoveCounter::constructionCount);190 EXPECT_EQ(0U, CopyMoveCounter::copyCount);191 EXPECT_EQ(1U, CopyMoveCounter::moveCount);192 193 EXPECT_FALSE(static_cast<bool>(optional));194 EXPECT_TRUE(static_cast<bool>(movedTo));195 }196 }197 149 198 150 } // namespace TestWebKitAPI
Note: See TracChangeset
for help on using the changeset viewer.