Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(401)

Unified Diff: third_party/WebKit/Source/wtf/VectorTest.cpp

Issue 2128583004: Add a standard placement new operator to WTF_USE_ALLOCATOR. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/wtf/allocator/PartitionAllocator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/wtf/VectorTest.cpp
diff --git a/third_party/WebKit/Source/wtf/VectorTest.cpp b/third_party/WebKit/Source/wtf/VectorTest.cpp
index 74b08ca5bdc19e93e4113672f360496a65966b2a..aa7509b11586e4ed79b13f43e3ca1f5165a11aa1 100644
--- a/third_party/WebKit/Source/wtf/VectorTest.cpp
+++ b/third_party/WebKit/Source/wtf/VectorTest.cpp
@@ -27,6 +27,7 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "wtf/HashSet.h"
+#include "wtf/Optional.h"
#include "wtf/PtrUtil.h"
#include "wtf/text/WTFString.h"
#include <memory>
@@ -688,6 +689,15 @@ TEST(VectorTest, InitializerList)
EXPECT_EQ(3, vector3[2]);
}
+TEST(VectorTest, Optional)
+{
+ Optional<Vector<int>> vector;
+ EXPECT_FALSE(vector);
+ vector.emplace(3);
+ EXPECT_TRUE(vector);
+ EXPECT_EQ(3u, vector->size());
+}
+
static_assert(VectorTraits<int>::canCopyWithMemcpy, "int should be copied with memcopy.");
static_assert(VectorTraits<char>::canCopyWithMemcpy, "char should be copied with memcpy.");
static_assert(VectorTraits<LChar>::canCopyWithMemcpy, "LChar should be copied with memcpy.");
« no previous file with comments | « no previous file | third_party/WebKit/Source/wtf/allocator/PartitionAllocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698